Skip to content

ROX-35657: Replace pre-modules pseudo-versions with actual dependency versions (backport to release-1.9) - #1363

Open
guzalv wants to merge 1 commit into
ComplianceAsCode:release-1.9from
guzalv:backport-gomod-fix-release-1.9
Open

ROX-35657: Replace pre-modules pseudo-versions with actual dependency versions (backport to release-1.9)#1363
guzalv wants to merge 1 commit into
ComplianceAsCode:release-1.9from
guzalv:backport-gomod-fix-release-1.9

Conversation

@guzalv

@guzalv guzalv commented Aug 19, 2026

Copy link
Copy Markdown

Description

Backport of #1301 (ROX-35657, originally merged to master as cdef8fe) to release-1.9.

go.mod on release-1.9 still declares pre-Go-modules pseudo-versions for openshift/api (v0.0.1) and openshift/client-go (v0.0.1), redirected via replace directives to the real versions. replace directives don't propagate to consumers, so every downstream consumer (e.g. stackrox/stackrox) has to duplicate them in their own go.mod to avoid pulling broken pre-modules code — see the recent stackrox go mod tidy breakage caused by the orphaned compliance-sdk commit (mitigated separately by #1356 and the archive-gomod-20250925 tag), which resurfaced this same class of issue.

This backport declares the real resolved versions directly and drops the replace block, same as #1301 on master.

release-1.9 had already diverged from master on this file: openshift/client-go had been re-resolved to an indirect dependency, and openshift/api's only remaining require line was a stray duplicate still at the broken v0.0.1. Applied go mod tidy + go mod vendor after resolving conflicts so the module graph re-derives correctly for release-1.9's actual current dependency set (openshift/api direct, openshift/client-go indirect, both at real versions).

Motivation for landing this on release-1.9 specifically (rather than only on master): it lets stackrox/stackrox bump to a proper tagged release (e.g. a future v1.9.3) instead of pinning a master pseudo-version to get a go.mod without the legacy replace directives.

Testing

  • go build ./... — clean
  • go vet ./... — clean
  • go test $(go list ./... | grep -v -E '/vendor/|/test|/examples') — all pass
  • gofmt -l clean on all non-vendored changed files (vendored openshift/api/openshift/client-go source carries its own upstream formatting, unmodified by us)

🤖 Generated with Claude Code / OpenCode, reviewed by @guzalv

@openshift-ci

openshift-ci Bot commented Aug 19, 2026

Copy link
Copy Markdown

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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 kubernetes-sigs/prow repository.

@guzalv guzalv changed the title Backport to release-1.9: Replace pre-modules pseudo-versions with actual dependency versions ROX-35657: Replace pre-modules pseudo-versions with actual dependency versions (backport to release-1.9) Aug 19, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Collaborator

@guzalv: This pull request references ROX-35657 which is a valid jira issue.

Details

In response to this:

Description

Backport of #1301 (ROX-35657, originally merged to master as cdef8fe) to release-1.9.

go.mod on release-1.9 still declares pre-Go-modules pseudo-versions for openshift/api (v0.0.1) and openshift/client-go (v0.0.1), redirected via replace directives to the real versions. replace directives don't propagate to consumers, so every downstream consumer (e.g. stackrox/stackrox) has to duplicate them in their own go.mod to avoid pulling broken pre-modules code — see the recent stackrox go mod tidy breakage caused by the orphaned compliance-sdk commit (mitigated separately by #1356 and the archive-gomod-20250925 tag), which resurfaced this same class of issue.

This backport declares the real resolved versions directly and drops the replace block, same as #1301 on master.

release-1.9 had already diverged from master on this file: openshift/client-go had been re-resolved to an indirect dependency, and openshift/api's only remaining require line was a stray duplicate still at the broken v0.0.1. Applied go mod tidy + go mod vendor after resolving conflicts so the module graph re-derives correctly for release-1.9's actual current dependency set (openshift/api direct, openshift/client-go indirect, both at real versions).

Motivation for landing this on release-1.9 specifically (rather than only on master): it lets stackrox/stackrox bump to a proper tagged release (e.g. a future v1.9.3) instead of pinning a master pseudo-version to get a go.mod without the legacy replace directives.

Testing

  • go build ./... — clean
  • go vet ./... — clean
  • go test $(go list ./... | grep -v -E '/vendor/|/test|/examples') — all pass
  • gofmt -l clean on all non-vendored changed files (vendored openshift/api/openshift/client-go source carries its own upstream formatting, unmodified by us)

🤖 Generated with Claude Code / OpenCode, reviewed by @guzalv

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.

@guzalv
guzalv marked this pull request as ready for review August 19, 2026 09:22
@abushkin-redhat

Copy link
Copy Markdown
Collaborator

/ok-to-test

@yuumasato

Copy link
Copy Markdown
Member

/ok-to-test

@yuumasato yuumasato added this to the 1.9.3 milestone Aug 21, 2026

@yuumasato yuumasato left a comment

Copy link
Copy Markdown
Member

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 commented Aug 21, 2026

Copy link
Copy Markdown

[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

Details 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

@yuumasato

Copy link
Copy Markdown
Member

@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>
@guzalv
guzalv force-pushed the backport-gomod-fix-release-1.9 branch from dcd2e49 to 557c890 Compare August 21, 2026 22:37
@openshift-ci openshift-ci Bot removed the lgtm label Aug 21, 2026
@openshift-ci

openshift-ci Bot commented Aug 21, 2026

Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

@guzalv

guzalv commented Aug 22, 2026

Copy link
Copy Markdown
Author

@guzalv Commit in this PR is not signed.

Thanks! Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants