ROX-35657: Replace pre-modules pseudo-versions with actual dependency versions (backport to release-1.9) - #1363
Conversation
|
Hi @guzalv. Thanks for your PR. I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@guzalv: This pull request references ROX-35657 which is a valid jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/ok-to-test |
|
/ok-to-test |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: guzalv, yuumasato The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@guzalv Commit in this PR is not signed. |
Backport of master commit cdef8fe (PR ComplianceAsCode#1301, ROX-35657) to release-1.9. The go.mod declared pre-Go-modules pseudo-versions for several dependencies (openshift/api v0.0.1, openshift/client-go v0.0.1, k8s.io/client-go v1.5.2) and used replace directives to redirect them to the real versions. While this works for building the CO itself, replace directives do not propagate to consumers of the module. Every downstream consumer (e.g. stackrox/stackrox) was forced to duplicate these replace directives in their own go.mod to avoid pulling broken ancient code. Fix this by declaring the actual resolved versions directly in the require section and removing all replace directives, then running 'go mod tidy' and 'go mod vendor' to reconcile the rest of the module graph. release-1.9 had already diverged from master here: openshift/client-go had been re-resolved to an indirect dependency and openshift/api's only remaining require line was a stray duplicate at the broken v0.0.1 version (both artifacts of release-1.9-only tidy runs). 'go mod tidy' correctly re-derives openshift/api as direct and openshift/client-go as indirect at their real versions once the replace directives are gone. Partially generated by AI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5 (1M context) <noreply@anthropic.com>
dcd2e49 to
557c890
Compare
|
New changes are detected. LGTM label has been removed. |
Thanks! Done |
Description
Backport of #1301 (ROX-35657, originally merged to
masteras cdef8fe) torelease-1.9.go.modonrelease-1.9still declares pre-Go-modules pseudo-versions foropenshift/api(v0.0.1) andopenshift/client-go(v0.0.1), redirected viareplacedirectives to the real versions.replacedirectives don't propagate to consumers, so every downstream consumer (e.g. stackrox/stackrox) has to duplicate them in their owngo.modto avoid pulling broken pre-modules code — see the recent stackroxgo mod tidybreakage caused by the orphanedcompliance-sdkcommit (mitigated separately by #1356 and thearchive-gomod-20250925tag), which resurfaced this same class of issue.This backport declares the real resolved versions directly and drops the
replaceblock, same as #1301 on master.release-1.9had already diverged from master on this file:openshift/client-gohad been re-resolved to an indirect dependency, andopenshift/api's only remainingrequireline was a stray duplicate still at the brokenv0.0.1. Appliedgo mod tidy+go mod vendorafter resolving conflicts so the module graph re-derives correctly forrelease-1.9's actual current dependency set (openshift/apidirect,openshift/client-goindirect, both at real versions).Motivation for landing this on
release-1.9specifically (rather than only onmaster): it letsstackrox/stackroxbump to a proper tagged release (e.g. a futurev1.9.3) instead of pinning amasterpseudo-version to get a go.mod without the legacyreplacedirectives.Testing
go build ./...— cleango vet ./...— cleango test $(go list ./... | grep -v -E '/vendor/|/test|/examples')— all passgofmt -lclean on all non-vendored changed files (vendoredopenshift/api/openshift/client-gosource carries its own upstream formatting, unmodified by us)🤖 Generated with Claude Code / OpenCode, reviewed by @guzalv