Skip to content

Comments

build(ci): Add/fix webpack instrumentation for GHA#22034

Merged
billyvg merged 2 commits intomasterfrom
build/ci/add-webpack-instrumentation
Nov 19, 2020
Merged

build(ci): Add/fix webpack instrumentation for GHA#22034
billyvg merged 2 commits intomasterfrom
build/ci/add-webpack-instrumentation

Conversation

@billyvg
Copy link
Member

@billyvg billyvg commented Nov 13, 2020

This updates our webpack instrumentation so that it works on GHA

This updates our webpack instrumentation so that it works on GHA
@billyvg billyvg marked this pull request as ready for review November 13, 2020 20:05
@billyvg billyvg requested a review from a team as a code owner November 13, 2020 20:05
@billyvg billyvg requested a review from a team November 17, 2020 00:07
CI,
} = process.env;
const IS_CI = !!TRAVIS_COMMIT;
const IS_CI = !!CI;
Copy link
Member

Choose a reason for hiding this comment

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

No. Please use a more specific identifier to do this rather than just checking CI. See #21415 and related bug for more context around this.

Copy link
Member Author

Choose a reason for hiding this comment

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

@BYK FWIW it's only enabled when SENTRY_INSTRUMENTATION is configured: https://github.com/getsentry/sentry/pull/22034/files#diff-bb490b7bd0a004bce840fd8ce6b94911de263f1eb455491f30596ea4a0aee48eR29

IS_CI is used for Sentry tags to see if we are in a CI env.

Copy link
Member

Choose a reason for hiding this comment

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

Sure but I've got burned by this before. Maybe we should rename it or something?

CI,
} = process.env;
const IS_CI = !!CI;
const IS_CI = !!GITHUB_SHA;
Copy link
Member

@BYK BYK Nov 17, 2020

Choose a reason for hiding this comment

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

❤️

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be GITHUB_REF as the connection is through this env var below. Also I wonder if we really need IS_CI? Why not just check GITHUB_REF directly below?

Copy link
Member Author

Choose a reason for hiding this comment

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

We use IS_CI elsewhere, https://github.com/getsentry/sentry/pull/22034/files#diff-bb490b7bd0a004bce840fd8ce6b94911de263f1eb455491f30596ea4a0aee48eR76

  1. GITHUB_REF is not guaranteed to exist and 2) we currently only use GITHUB_REF, but we could add other Sentry tags later

Copy link
Member

Choose a reason for hiding this comment

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

Eh, okay. Then that usage becomes GHA-only though (won't detect GCB as "ci env" correctly if we wanted in the future).

I think this is fine right now, but I feel like there's a need to review and refactor all CI and IS_CI usages to make them accurate.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, that's why it was using CI before

@billyvg billyvg requested a review from BYK November 18, 2020 19:13
CI,
} = process.env;
const IS_CI = !!CI;
const IS_CI = !!GITHUB_SHA;
Copy link
Member

Choose a reason for hiding this comment

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

Eh, okay. Then that usage becomes GHA-only though (won't detect GCB as "ci env" correctly if we wanted in the future).

I think this is fine right now, but I feel like there's a need to review and refactor all CI and IS_CI usages to make them accurate.

@billyvg billyvg merged commit f325d54 into master Nov 19, 2020
@billyvg billyvg deleted the build/ci/add-webpack-instrumentation branch November 19, 2020 00:52
iProgramStuff pushed a commit that referenced this pull request Nov 19, 2020
This updates our webpack instrumentation so that it works on GHA
@github-actions github-actions bot locked and limited conversation to collaborators Dec 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants