-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
ref(admin): Upload sourcemaps to Sentry for the admin tool #4441
Conversation
Add the webpack integration for Sentry into webpack, and setup the integration key to be passed down into the build step.
.github/workflows/image.yml
Outdated
@@ -42,6 +43,7 @@ jobs: | |||
--build-arg BUILDKIT_INLINE_CACHE=1 \ | |||
--build-arg SHOULD_BUILD_ADMIN_UI="$SHOULD_BUILD_ADMIN_UI" \ | |||
--build-arg SHOULD_BUILD_RUST=false \ | |||
--build-arg ADMIN_SOURCEMAP_KEY="$ADMIN_SOURCEMAP_KEY" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as written this value will be in the image -- if it's actually secret this will leak the secret
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't think of that. How would you recommend doing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think getsentry does this through the deploy pipeline -- I'm not entirely sure would have to check that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking that too, but our images are built during CI, and I need this value during the build steps I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the value an actual secret? if not then we can just inline it
does it need to be in the source?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be a secret? It's an internal integration API key for our Sentry projects. It would allow anyone with the key at minimum to upload files to our internal projects (that's what I plan to do with it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use docker build --secret id=mysecret,env=MYSECRET .
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that will help here -- the value is exposed in ENV
and appears to get baked in by webpack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I can have a separate step that builds webpack outside of the docker image just to get the sourcemaps uploaded. I don't need this value after the image is built.
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #4441 +/- ##
=======================================
Coverage 90.28% 90.28%
=======================================
Files 817 817
Lines 40386 40386
Branches 285 285
=======================================
Hits 36462 36462
Misses 3883 3883
Partials 41 41 ☔ View full report in Codecov by Sentry. |
…d of inserting logic into the existing build flow.
name: "build sourcemaps" | ||
runs-on: ubuntu-latest | ||
env: | ||
SENTRY_AUTH_TOKEN: ${{ secrets.SNUBA_SENTRY_SOURCEMAP_KEY }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asottile-sentry I don't think this question was answered: how do I go about getting this secret set up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the team which owns the repo (I believe sns) should have admin to add / alter repository-specific secrets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thank you for all your help!
Add the webpack integration for Sentry into webpack, and setup the integration key to be passed down into the build step.
Add the webpack integration for Sentry into webpack, and setup the integration
key to be passed down into the build step.
NOTE: The secret has already been created for this.