Skip to content
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

🐛bugfix for operator-controller not outputting the right commit ID in the version #1811

Merged
merged 3 commits into from
Mar 4, 2025

Conversation

rashmigottipati
Copy link
Member

Description

The --version doesn't output the source code commit ID. It refers to "vcs-ref" in the image instead of "io.openshift.build.commit.id".

Setting the GIT_COMMIT value to SOURCE_GIT_COMMIT if empty (which is a corresponding downstream variable) will ensure that the version outputs the right commit ID as the code from this repo gets copied to another repo for building purposes.

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

@rashmigottipati rashmigottipati requested a review from a team as a code owner February 25, 2025 21:05
Copy link

netlify bot commented Feb 25, 2025

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit fcebcb7
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/67c734dba65ef30008400f13
😎 Deploy Preview https://deploy-preview-1811--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Feb 25, 2025

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 68.45%. Comparing base (c899dc1) to head (fcebcb7).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/shared/version/version.go 0.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1811      +/-   ##
==========================================
+ Coverage   68.44%   68.45%   +0.01%     
==========================================
  Files          63       63              
  Lines        5134     5136       +2     
==========================================
+ Hits         3514     3516       +2     
  Misses       1390     1390              
  Partials      230      230              
Flag Coverage Δ
e2e 51.60% <0.00%> (+0.02%) ⬆️
unit 56.01% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@joelanford
Copy link
Member

If this is a downstream-only concern, is it possible to make a change in the downstream repo instead?

I'm kinda curious why the existing upstream implementation doesn't "just work" in downstreams since it should be pulling commit refs for the downstream git repo in the same way.

camilamacedo86

This comment was marked as resolved.

@rashmigottipati
Copy link
Member Author

@joelanford yeah, this is a downstream only concern. And I think it's fine when we build from the repo downstream too, but it's something to do with the way images get generated using ART. That's when it's using the env var SOURCE_GIT_COMMIT which is the downstream equivalent of GIT_COMMIT.

We can fix this in downstream repo directly as well without fixing it here, but I thought fixing it here and sync'ing it downstream would be better to have both repos as close as possible for maintainability purposes. Let me know if you disagree.

@rashmigottipati
Copy link
Member Author

@camilamacedo86 since we were discussing this on slack, will continue the conversation there to avoid typing in two different places :)

@camilamacedo86 camilamacedo86 dismissed their stale review February 28, 2025 06:53

I marked as solved my above comment #1811 (review) to make it easier for the review since we had already sorted out the raised concerns, and we will move with the change for upstream.

@rashmigottipati rashmigottipati force-pushed the fix-commit-ID branch 4 times, most recently from 7afc14c to 6217d52 Compare March 3, 2025 19:58
Copy link
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

I am OK with 👍

@tmshort WDYT?

Copy link
Contributor

@tmshort tmshort left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 4, 2025
@tmshort tmshort added this pull request to the merge queue Mar 4, 2025
Merged via the queue into operator-framework:main with commit 7fc18c6 Mar 4, 2025
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants