Skip to content

ref(dev): Improve labeling of checkout step in GHA #5156

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

Merged
merged 2 commits into from
May 24, 2022

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented May 24, 2022

Currently, when looking at runs of our Build & Test GHA workflow, it's often hard to tell exactly what commit is being used. When the workflow is triggered by a push to a PR, the PR title ends up as the label, which can be pretty uninformative:

image

Runs triggered manually are no better:

image

Runs triggered by pushes are better...

image

...at least from the outside, but once you're in one, it's not obvious from the logs which commit is being used:

image

(That SHA listed in the checkout step isn't even that helpful, because by default it's not the branch's HEAD commit but rather a made-up merge commit between HEAD and the base branch, making it useless for identifying HEAD.)

This fixes that problem, by adding a preliminary GHA job to gather and store the SHA of the actual branch head (along with its commit message). Subsequent jobs can then use that information to label their checkout step, making it much easier to tell where in the commit history the job falls:

image

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.33 KB (-4.03% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 59.9 KB (-7.29% 🔽)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.18 KB (-3.6% 🔽)
@sentry/browser - ES6 CDN Bundle (minified) 53.59 KB (-7.56% 🔽)
@sentry/browser - Webpack (gzipped + minified) 19.88 KB (-14.47% 🔽)
@sentry/browser - Webpack (minified) 63.04 KB (-22.86% 🔽)
@sentry/react - Webpack (gzipped + minified) 19.9 KB (-14.51% 🔽)
@sentry/nextjs Client - Webpack (gzipped + minified) 43.71 KB (-9.05% 🔽)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 25.33 KB (-2.86% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 23.89 KB (-2.44% 🔽)

@lobsterkatie lobsterkatie merged commit b0950aa into 7.x May 24, 2022
@lobsterkatie lobsterkatie deleted the kmclb-get-metadata-for-GHA branch May 24, 2022 13:28
AbhiPrasad pushed a commit that referenced this pull request May 30, 2022
Currently, when looking at runs of our `Build & Test` GHA workflow, it's often hard to tell exactly what commit is being used. When the workflow is triggered by a push to a PR, the PR title ends up as the label, which can be pretty uninformative. Runs triggered manually are no better, as they're merely labeled "Build & Test." Runs triggered by pushes _are_ better, at least from the Actions tab, because they're labeled for their commit, but once you open one up, it's not obvious from the logs which commit is being used, since "Check out current commit (<some SHA here>)" doesn't actually list the branch's `HEAD` commit but rather a made-up merge commit between `HEAD` and the base branch, making it useless for identifying `HEAD`.

(See the PR description for screenshots of these different cases.)

This fixes that problem, by adding a preliminary GHA job to gather and store the SHA of the actual branch head (along with its commit message). Subsequent jobs can then use that information to label their checkout step, making it much easier to tell where in the commit history the job falls.
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