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

Open
wants to merge 3 commits into
base: onur/angular-wizard-base
Choose a base branch
from

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 6baf639

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 +45
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 👍

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