Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(angular): Add Sentry setup in App Config #769

Merged
merged 3 commits into from
Feb 4, 2025

Conversation

onurtemizkan
Copy link
Collaborator

Supersedes #741 - Part 3

Targeted to the epic branch.

Adds Sentry setup in app-config files

Locally tested on Angular 17/19

#skip-changelog

Copy link

github-actions bot commented Jan 22, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against e095e8d

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looking good generally, one concern but otherwise ready to go soon!

Comment on lines +39 to +75
const appConfigFilename = 'app.config.ts';
const appConfigPath = path.join(
process.cwd(),
'src',
'app',
appConfigFilename,
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I'm a bit concerned that we don't find this file, given it's in src/app/app.config.ts only by convention but afaik not required. Suggestion: let's check if the file exists and add a tag so that we can track hit/miss rates. If the file doesn't exist, we can bail out of this step and link to the setup docs. Depending on the hit/miss rate, we can make our detection logic or fallback behaviour smarter later. WDYT? (cc @andreiborza)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just adding to this since I re-checked documentation: I think we can just go with the suggested tracking and bail approach. I don't think this should be a major concern, given that docs don't mention renaming or moving these files. Nevertheless, tracking hit/miss is still helpful

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated 👍

import { updateAppConfigMod } from './codemods/app-config';
import type { SemVer } from 'semver';

export function hasSentryContent(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l (already suggested in #768): let's use the ast-utils version if possible

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated 👍

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @onur! Mind rebasing this once more?

@onurtemizkan onurtemizkan force-pushed the onur/angular-setup-app-config branch from 6baf639 to e095e8d Compare February 3, 2025 22:29
@Lms24 Lms24 merged commit 0d8936d into onur/angular-wizard-base Feb 4, 2025
15 checks passed
@Lms24 Lms24 deleted the onur/angular-setup-app-config branch February 4, 2025 11:02
onurtemizkan added a commit that referenced this pull request Feb 5, 2025
* feat(angular): Add Sentry setup in App Config

* Use `hasSentryContent` from `ast-utils`

* Bail out if `app-config` is not under pre-defined location
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants