-
Notifications
You must be signed in to change notification settings - Fork 64
🐛 set GIT_COMMIT in Makefile to populate version info #2007
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
base: main
Are you sure you want to change the base?
🐛 set GIT_COMMIT in Makefile to populate version info #2007
Conversation
Signed-off-by: Rashmi Gottipati <[email protected]>
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2007 +/- ##
==========================================
- Coverage 69.17% 69.16% -0.02%
==========================================
Files 79 79
Lines 7037 7037
==========================================
- Hits 4868 4867 -1
- Misses 1887 1888 +1
Partials 282 282
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This still feels off to me from a supply chain security perspective. Under what circumstances does it make sense for a CI system to build commit |
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.
/lgtm
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ankitathomas The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold Can we discuss this a bit more? Besides my concern about supply chain security, this still feels like a downstream-only concern. |
@joelanford Thanks for raising this. You're right—if the build is for commit A, we absolutely shouldn't be marking it as commit B and this is certainly a concern from a supply chain security standpoint. This is a downstream only concern. Previously I've created #1811 but that didn't resolve the bug (downstream) as confirmed by QE in the report (which says that with the latest change it's returning empty commit info). The purpose of this change is to ensure that GIT_COMMIT gets correctly set in environments where the actual git metadata isn't available at build time—specifically in some downstream OpenShift build pipelines. It looks like in those cases, the build system injects the commit SHA via the SOURCE_GIT_COMMIT env var, probably due to not having access to .git directly (this is my assumption - I am not very familiar with the build process downstream). Without it, the resulting binaries end up with an empty gitCommit field. Upstream, we expect If the concern is around upstream builds incorrectly using SOURCE_GIT_COMMIT, maybe we could explicitly scope the override to CI? Or, we could leave GIT_COMMIT empty unless it's explicitly set by the caller. Or we could make this change downstream and leave upstream as it is. Happy to adjust based on what we agree is the cleanest path forward. |
I'm guessing that #1811 is the upstream plumbing that was needed such that we could add some downstream plumbing to set ENV GIT_COMMIT=$SOURCE_GIT_COMMIT prior to calling |
Description
Reviewer Checklist