René's URL Explorer Experiment


Title: perf(ci): replace -X ldflags with go:embed for version data by davdhacs · Pull Request #19643 · stackrox/stackrox · GitHub

Open Graph Title: perf(ci): replace -X ldflags with go:embed for version data by davdhacs · Pull Request #19643 · stackrox/stackrox

X Title: perf(ci): replace -X ldflags with go:embed for version data by davdhacs · Pull Request #19643 · stackrox/stackrox

Description: Description Go's link ActionID includes -X ldflags verbatim. Today go-tool.sh passes per-commit values (full git describe output with commit count and SHA), so every commit invalidates the link cache for all binaries. This PR stabilizes build ldflags by using only the base tag (git describe --abbrev=0) in -X flags. Per-commit values (full version string, git short SHA) are written to untracked files and loaded at runtime via lazy go:embed + sync.Once. Depends on #19617 for the test-side ldflags fix. How it works go-tool.sh: ldflags use base tag for MainVersion (stable across commits). For builds only, writes MAIN_VERSION and GIT_SHORT_SHA_VERSION as untracked files. version_data.go: GetMainVersion() and GetGitShortSha() lazily read from embed.FS on first call. For tests (where files don't exist), falls back to ldflag values. EMPTY_SHA_VERSION: committed empty file satisfies the //go:embed *_SHA_VERSION glob when dynamic files are absent (fresh clone, go vet, tests). User-facing documentation CHANGELOG.md is updated OR update is not needed documentation PR is created and is linked above OR is not needed Testing and quality the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag CI results are inspected Automated testing modified existing tests How I validated my change CI green on seed run (all 11 unit-test jobs pass) local-roxctl-tests confirms version info is set correctly for builds go build and go vet work without go-tool.sh (embed glob matches EMPTY_SHA_VERSION) Partially generated by AI.

Open Graph Description: Description Go's link ActionID includes -X ldflags verbatim. Today go-tool.sh passes per-commit values (full git describe output with commit count and SHA), so every commit invalidates the link...

X Description: Description Go's link ActionID includes -X ldflags verbatim. Today go-tool.sh passes per-commit values (full git describe output with commit count and SHA), so every commit invalidates the ...

Opengraph URL: https://github.com/stackrox/stackrox/pull/19643

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:c635b32a-0458-3066-f8a5-ee266eee5d62
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC92C:770CB:3C1E29:526A01:6A4D9FB5
html-safe-noncec1c2e9c4f8e2fd06bfd49ab32b76c9292d896f4f7807a21cde9ff1d537a86695
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTJDOjc3MENCOjNDMUUyOTo1MjZBMDE6NkE0RDlGQjUiLCJ2aXNpdG9yX2lkIjoiNjU4MTcxNDk1OTcwODU2MTMzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacec7ef3de348654db7965169d06e62d065819fcf6cefcdd78dd105780aa8d364b
hovercard-subject-tagpull_request:3454871692
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/stackrox/stackrox/pull/19643/files
twitter:imagehttps://avatars.githubusercontent.com/u/105243888?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/105243888?s=400&v=4
og:image:altDescription Go's link ActionID includes -X ldflags verbatim. Today go-tool.sh passes per-commit values (full git describe output with commit count and SHA), so every commit invalidates the link...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/stackrox/stackrox git https://github.com/stackrox/stackrox.git
octolytics-dimension-user_id40638982
octolytics-dimension-user_loginstackrox
octolytics-dimension-repository_id434017296
octolytics-dimension-repository_nwostackrox/stackrox
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id434017296
octolytics-dimension-repository_network_root_nwostackrox/stackrox
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7f13faa65cccc9b729d674da83335d5dcfdfd193
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/stackrox/stackrox/pull/19643/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fstackrox%2Fstackrox%2Fpull%2F19643%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fstackrox%2Fstackrox%2Fpull%2F19643%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=stackrox%2Fstackrox
Reloadhttps://github.com/stackrox/stackrox/pull/19643/files
Reloadhttps://github.com/stackrox/stackrox/pull/19643/files
Reloadhttps://github.com/stackrox/stackrox/pull/19643/files
Please reload this pagehttps://github.com/stackrox/stackrox/pull/19643/files
stackrox https://github.com/stackrox
stackroxhttps://github.com/stackrox/stackrox
Notifications https://github.com/login?return_to=%2Fstackrox%2Fstackrox
Fork 180 https://github.com/login?return_to=%2Fstackrox%2Fstackrox
Star 1.3k https://github.com/login?return_to=%2Fstackrox%2Fstackrox
Code https://github.com/stackrox/stackrox
Issues 52 https://github.com/stackrox/stackrox/issues
Pull requests 548 https://github.com/stackrox/stackrox/pulls
Actions https://github.com/stackrox/stackrox/actions
Security and quality 0 https://github.com/stackrox/stackrox/security
Insights https://github.com/stackrox/stackrox/pulse
Code https://github.com/stackrox/stackrox
Issues https://github.com/stackrox/stackrox/issues
Pull requests https://github.com/stackrox/stackrox/pulls
Actions https://github.com/stackrox/stackrox/actions
Security and quality https://github.com/stackrox/stackrox/security
Insights https://github.com/stackrox/stackrox/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fstackrox%2Fstackrox%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fstackrox%2Fstackrox%2Fissues%2Fnew%2Fchoose
davdhacshttps://github.com/davdhacs
davdhacs/fix-test-ldflagshttps://github.com/stackrox/stackrox/tree/davdhacs/fix-test-ldflags
davdhacs/embed-versionshttps://github.com/stackrox/stackrox/tree/davdhacs/embed-versions
Conversation 7 https://github.com/stackrox/stackrox/pull/19643
Commits 1 https://github.com/stackrox/stackrox/pull/19643/commits
Checks 82 https://github.com/stackrox/stackrox/pull/19643/checks
Files changed https://github.com/stackrox/stackrox/pull/19643/files
Please reload this pagehttps://github.com/stackrox/stackrox/pull/19643/files
perf(ci): replace -X ldflags with go:embed for version data https://github.com/stackrox/stackrox/pull/19643/files#top
Show all changes 1 commit https://github.com/stackrox/stackrox/pull/19643/files
d56de76 perf(ci): stabilize build ldflags for link cache hits davdhacs Mar 27, 2026 https://github.com/stackrox/stackrox/pull/19643/commits/d56de7618e5e9782287ce5bcdabb95046af48a04
Clear filters https://github.com/stackrox/stackrox/pull/19643/files
Please reload this pagehttps://github.com/stackrox/stackrox/pull/19643/files
Please reload this pagehttps://github.com/stackrox/stackrox/pull/19643/files
.gitignore https://github.com/stackrox/stackrox/pull/19643/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
EMPTY_VERSION https://github.com/stackrox/stackrox/pull/19643/files#diff-decacad67fab92c1a63f66f4d6f3bebe341f7f7724b6bc0dd7076600d4133fdc
version_data.go https://github.com/stackrox/stackrox/pull/19643/files#diff-81f3ccdffa58c26628e843c1a4aab994eaac96ad712d221d41dc0bf043d22031
version.go https://github.com/stackrox/stackrox/pull/19643/files#diff-73b8ec8a05213857da6e9598e34c5d7a18a6e5349250908ae6710578236977f2
go-tool.sh https://github.com/stackrox/stackrox/pull/19643/files#diff-98fe5781c9a901030c3ba8b40f129fe11769fec10b4b2fb6dd0c67af124ce298
status.sh https://github.com/stackrox/stackrox/pull/19643/files#diff-3b1bdfa4bc550b65cd746cc78fa102259ef5acf19fa18fc580bf25e3cd427419
.gitignorehttps://github.com/stackrox/stackrox/pull/19643/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
View file https://github.com/stackrox/stackrox/blob/d56de7618e5e9782287ce5bcdabb95046af48a04/.gitignore
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/stackrox/stackrox/pull/19643/{{ revealButtonHref }}
https://github.com/stackrox/stackrox/pull/19643/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
pkg/version/internal/EMPTY_VERSIONhttps://github.com/stackrox/stackrox/pull/19643/files#diff-decacad67fab92c1a63f66f4d6f3bebe341f7f7724b6bc0dd7076600d4133fdc
View file https://github.com/stackrox/stackrox/blob/d56de7618e5e9782287ce5bcdabb95046af48a04/pkg/version/internal/EMPTY_VERSION
Open in desktop https://desktop.github.com
pkg/version/internal/version_data.gohttps://github.com/stackrox/stackrox/pull/19643/files#diff-81f3ccdffa58c26628e843c1a4aab994eaac96ad712d221d41dc0bf043d22031
View file https://github.com/stackrox/stackrox/blob/d56de7618e5e9782287ce5bcdabb95046af48a04/pkg/version/internal/version_data.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/stackrox/stackrox/pull/19643/{{ revealButtonHref }}
https://github.com/stackrox/stackrox/pull/19643/files#diff-81f3ccdffa58c26628e843c1a4aab994eaac96ad712d221d41dc0bf043d22031
pkg/version/version.gohttps://github.com/stackrox/stackrox/pull/19643/files#diff-73b8ec8a05213857da6e9598e34c5d7a18a6e5349250908ae6710578236977f2
View file https://github.com/stackrox/stackrox/blob/d56de7618e5e9782287ce5bcdabb95046af48a04/pkg/version/version.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/stackrox/stackrox/pull/19643/{{ revealButtonHref }}
https://github.com/stackrox/stackrox/pull/19643/files#diff-73b8ec8a05213857da6e9598e34c5d7a18a6e5349250908ae6710578236977f2
https://github.com/stackrox/stackrox/pull/19643/files#diff-73b8ec8a05213857da6e9598e34c5d7a18a6e5349250908ae6710578236977f2
https://github.com/stackrox/stackrox/pull/19643/files#diff-73b8ec8a05213857da6e9598e34c5d7a18a6e5349250908ae6710578236977f2
https://github.com/stackrox/stackrox/pull/19643/files#diff-73b8ec8a05213857da6e9598e34c5d7a18a6e5349250908ae6710578236977f2
scripts/go-tool.shhttps://github.com/stackrox/stackrox/pull/19643/files#diff-98fe5781c9a901030c3ba8b40f129fe11769fec10b4b2fb6dd0c67af124ce298
View file https://github.com/stackrox/stackrox/blob/d56de7618e5e9782287ce5bcdabb95046af48a04/scripts/go-tool.sh
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/stackrox/stackrox/pull/19643/{{ revealButtonHref }}
https://github.com/stackrox/stackrox/pull/19643/files#diff-98fe5781c9a901030c3ba8b40f129fe11769fec10b4b2fb6dd0c67af124ce298
https://github.com/stackrox/stackrox/pull/19643/files#diff-98fe5781c9a901030c3ba8b40f129fe11769fec10b4b2fb6dd0c67af124ce298
https://github.com/stackrox/stackrox/pull/19643/files#diff-98fe5781c9a901030c3ba8b40f129fe11769fec10b4b2fb6dd0c67af124ce298
status.shhttps://github.com/stackrox/stackrox/pull/19643/files#diff-3b1bdfa4bc550b65cd746cc78fa102259ef5acf19fa18fc580bf25e3cd427419
View file https://github.com/stackrox/stackrox/blob/d56de7618e5e9782287ce5bcdabb95046af48a04/status.sh
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/stackrox/stackrox/pull/19643/{{ revealButtonHref }}
https://github.com/stackrox/stackrox/pull/19643/files#diff-3b1bdfa4bc550b65cd746cc78fa102259ef5acf19fa18fc580bf25e3cd427419
Please reload this pagehttps://github.com/stackrox/stackrox/pull/19643/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.