Skip to content

🌱 fix catalogd version variable paths in Makefile #1705

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

Conversation

ankitathomas
Copy link
Contributor

Description

Fix for the catalogd version package path in the Makefile to ensure catalogd binary contains the correct version information.

See https://issues.redhat.com/browse/OCPBUGS-49866

@ankitathomas ankitathomas requested a review from a team as a code owner February 4, 2025 22:16
Copy link

netlify bot commented Feb 4, 2025

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 1eb3461
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/67a291b771333c00083a71de
😎 Deploy Preview https://deploy-preview-1705--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 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.49%. Comparing base (68b500b) to head (1eb3461).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1705   +/-   ##
=======================================
  Coverage   67.49%   67.49%           
=======================================
  Files          59       59           
  Lines        5003     5003           
=======================================
  Hits         3377     3377           
  Misses       1379     1379           
  Partials      247      247           
Flag Coverage Δ
e2e 53.29% <ø> (-0.09%) ⬇️
unit 55.28% <ø> (ø)

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.

@@ -121,7 +121,7 @@ VERSION := $(shell git describe --tags --always --dirty)
endif
export VERSION

export VERSION_PKG := $(shell go list -m)/internal/version
export VERSION_PKG := $(shell go list -mod=mod ./internal/version)
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the fix, but I am not sure why we need to use -mod.

Copy link
Member

@LalatenduMohanty LalatenduMohanty Feb 5, 2025

Choose a reason for hiding this comment

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

I tested this in the Makefile by printing the VERSION_PKG. Without this fix it resolves to github.com/operator-framework/operator-controller/internal/version and with the fix it resolves to github.com/operator-framework/operator-controller/catalogd/internal/version

.PHONY: print-version
+print-version:
+       echo "$(VERSION_PKG)"
$ git diff
diff --git a/catalogd/Makefile b/catalogd/Makefile
index ce56ed5..447a6a0 100644
--- a/catalogd/Makefile
+++ b/catalogd/Makefile
@@ -122,6 +122,9 @@ endif
 export VERSION
 
 export VERSION_PKG     := $(shell go list -m)/internal/version
+.PHONY: print-version
+print-version:
+       echo "$(VERSION_PKG)"
 
 export GIT_COMMIT      := $(shell git rev-parse HEAD)
 export GIT_VERSION     := $(shell git describe --tags --always --dirty)
lmohanty@LenovoP16v:~/code/github.com/OLM-Upstream/operator-controller/catalogd$ make print-version 
echo "github.com/operator-framework/operator-controller/internal/version"
github.com/operator-framework/operator-controller/internal/version

$ git diff
diff --git a/catalogd/Makefile b/catalogd/Makefile
index ce56ed5..c2cc8c6 100644
--- a/catalogd/Makefile
+++ b/catalogd/Makefile
@@ -121,7 +121,10 @@ VERSION := $(shell git describe --tags --always --dirty)
 endif
 export VERSION
 
-export VERSION_PKG     := $(shell go list -m)/internal/version
+export VERSION_PKG     := $(shell go list -mod=mod ./internal/version)
+.PHONY: print-version
+print-version:
+       echo "$(VERSION_PKG)"
 
 export GIT_COMMIT      := $(shell git rev-parse HEAD)
 export GIT_VERSION     := $(shell git describe --tags --always --dirty)

$ make print-version 
echo "github.com/operator-framework/operator-controller/catalogd/internal/version"
github.com/operator-framework/operator-controller/catalogd/internal/version

Copy link
Member

@LalatenduMohanty LalatenduMohanty Feb 5, 2025

Choose a reason for hiding this comment

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

-mod=mod Forces the command to use module mode to resolve dependencies instead of old GOPATH mode.

Copy link
Member

@LalatenduMohanty LalatenduMohanty 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 Feb 5, 2025
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.

/lgtm

NIT; IHMO 🌱 would be a more accurate emoji because this change does not impact end-users. However, because we are not use the tooling https://github.com/kubernetes-sigs/kubebuilder-release-tools to generate the release notes I think that is not a big deal.

@LalatenduMohanty LalatenduMohanty added this pull request to the merge queue Feb 5, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 5, 2025
@LalatenduMohanty LalatenduMohanty added this pull request to the merge queue Feb 5, 2025
Merged via the queue into operator-framework:main with commit b73874e Feb 5, 2025
22 checks passed
camilamacedo86 pushed a commit to camilamacedo86/operator-controller that referenced this pull request Feb 5, 2025
)

Signed-off-by: Ankita Thomas <[email protected]>

[monorepo - phase 2] : Move the internal files from catalogd to operator-controller
@ankitathomas ankitathomas changed the title 🐛 fix catalogd version variable paths in Makefile 🌱 fix catalogd version variable paths in Makefile Feb 6, 2025
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.

3 participants