Skip to content

🌱 Allow override of go-verdiff result via label #1964

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 1 commit into from
May 14, 2025

Conversation

tmshort
Copy link
Contributor

@tmshort tmshort commented May 13, 2025

Rather than disabling the go-verdiff CI to allow it to pass when there is a legitimate golang version change, use a label to override the test results.

The label is (override-go-verdiff).

Description

Reviewer Checklist

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

@tmshort tmshort requested a review from a team as a code owner May 13, 2025 14:52
Copy link

netlify bot commented May 13, 2025

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 5c9faa7
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/6824a40557aeba00084854e9
😎 Deploy Preview https://deploy-preview-1964--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.

@openshift-ci openshift-ci bot requested review from perdasilva and thetechnick May 13, 2025 14:52
@tmshort
Copy link
Contributor Author

tmshort commented May 13, 2025

/approve

Copy link

codecov bot commented May 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.78%. Comparing base (d873ec1) to head (5c9faa7).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1964   +/-   ##
=======================================
  Coverage   66.78%   66.78%           
=======================================
  Files          75       75           
  Lines        6337     6337           
=======================================
  Hits         4232     4232           
  Misses       1841     1841           
  Partials      264      264           
Flag Coverage Δ
e2e 45.19% <ø> (ø)
unit 56.38% <ø> (ø)

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 13, 2025
@grokspawn
Copy link
Contributor

grokspawn commented May 13, 2025

Why?
We already made this unconditionally executed and required.
Is there a reason we need to provide an override capability as well?

Is the issue here that the golang version went up, not that it threatened to exceed our high-water mark? (in other words, is the check enforcing the wrong thing?)

@tmshort
Copy link
Contributor Author

tmshort commented May 13, 2025

Why? We already made this unconditionally executed and required. Is there a reason we need to provide an override capability as well?

Is the issue here that the golang version went up, not that it threatened to exceed our high-water mark? (in other words, is the check enforcing the wrong thing?)

There are times we want to be able to override this check. For example, we can go up to golang 1.23.6 as of right now without any downstreaming challenges. But we can't do that if the test is required and always fails. That would mean making the test non-required, and I'm not sure we want to do that and allow something we don't want to slip through.

But yes, there may be bingo tools and other updates that can be permitted, and we should allow that EXPLICIT override.

@grokspawn
Copy link
Contributor

grokspawn commented May 13, 2025

There are times we want to be able to override this check. For example, we can go up to golang 1.23.6 as of right now without any downstreaming challenges. But we can't do that if the test is required and always fails. That would mean making the test non-required, and I'm not sure we want to do that and allow something we don't want to slip through.

Aside from vendoring challenges, this project is concerned with coordinating the golang version (including bingo'd tools) to not grow. That isn't really the right goal, IMO, since growth under a threshold should not be problematic. It's when this project (and projects which include its packages) advances a version collectively.

So maybe it makes more sense for this to obtain a threshold version, and allow anything which doesn't exceed it. We could follow the pattern of actions/setup-go's go-version-file and still use the underlying concept that the project's root go.mod is the "do not exceed" threshold.

Edit: we use the root go.mod as reference, but I still don't see the value in erroring when any go version changes.

@grokspawn
Copy link
Contributor

grokspawn commented May 13, 2025

I'd delete lines 63-78. The failures we're seeing in the kustomize bump are where the golang version changed but still lies at/below the threshold.
Does it matter if the version changed, if it's below the threshold?

@tmshort
Copy link
Contributor Author

tmshort commented May 14, 2025

I'd delete lines 63-78. The failures we're seeing in the kustomize bump are where the golang version changed but still lies at/below the threshold. Does it matter if the version changed, if it's below the threshold?

We already use the root go.mod as the threshold, so we're good there, and yes we ought to be fine if nothing exceeds that.
I'd prefer to keep those lines, and instead put it under a flag option; I'd rather not discard that code.

@grokspawn
Copy link
Contributor

We already use the root go.mod as the threshold, so we're good there, and yes we ought to be fine if nothing exceeds that.
I'd prefer to keep those lines, and instead put it under a flag option; I'd rather not discard that code.

It's not discarded if it was previously committed.
But my point is really that we need the check to keep us from advancing beyond a specific version. If we can use the go.mod in the root here as the sentinel version, fine.
But why would we want to alert if any go version changes in future commits?
IMO, this should be something which is enabled with a flag and not in the common path, if we want to keep it.

@tmshort
Copy link
Contributor Author

tmshort commented May 14, 2025

That's what I meant.
Please review the updated code.
However, we need to check if the threshold version has changed, so that's kept as an error, otherwise, it could mask a problem!

GO_VER=$(sed -En 's/^go (.*)$/\1/p' "go.mod")
OLDIFS="${IFS}"
IFS='.' MAX_VER=(${GO_VER})
IFS="${OLDIFS}"
ROOT_GO_MOD="./go.mod"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: define GO_VER after ROOT_GO_MOD, and change it to

GO_VER=$(sed -En 's/^go (.*)$/\1/p' ${ROOT_GO_MOD})

grokspawn
grokspawn previously approved these changes May 14, 2025
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 14, 2025
Rather than disabling the go-verdiff CI to allow it to pass when
there is a legitimate golang version change, use a label to override
the test results.

The label is `(override-go-verdiff)`.

Signed-off-by: Todd Short <[email protected]>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label May 14, 2025
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 14, 2025
Copy link

openshift-ci bot commented May 14, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: grokspawn, tmshort

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@grokspawn grokspawn merged commit b4763ae into operator-framework:main May 14, 2025
21 checks passed
@tmshort tmshort deleted the gover-override branch May 14, 2025 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants