Skip to content

OCPSTRAT-2876: Manifest inclusion filtering based on major version#2069

Merged
openshift-merge-bot[bot] merged 2 commits into
openshift:masterfrom
JoelSpeed:manifest-inclusion-major-version
Feb 10, 2026
Merged

OCPSTRAT-2876: Manifest inclusion filtering based on major version#2069
openshift-merge-bot[bot] merged 2 commits into
openshift:masterfrom
JoelSpeed:manifest-inclusion-major-version

Conversation

@JoelSpeed
Copy link
Copy Markdown
Contributor

Currently based on #2067

This teaches the manifest inclusion to filter based on a major-version annotation. This will allow us to concurrently build multiple major versions from a single branch while folks can include manifests (in particular feature gates) that apply only to 4, or 5, or 6 etc

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 2, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jan 2, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@JoelSpeed JoelSpeed force-pushed the manifest-inclusion-major-version branch from e409b04 to 6f6c4ca Compare January 21, 2026 17:58
@JoelSpeed JoelSpeed marked this pull request as ready for review January 22, 2026 15:42
@JoelSpeed JoelSpeed changed the title [WIP] Manifest inclusion filtering based on major version Manifest inclusion filtering based on major version Jan 22, 2026
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 22, 2026
@openshift-ci openshift-ci Bot requested review from deads2k and p0lyn0mial January 22, 2026 15:49
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jan 22, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: JoelSpeed
Once this PR has been reviewed and has the lgtm label, please assign petr-muller for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@JoelSpeed JoelSpeed force-pushed the manifest-inclusion-major-version branch from aeb7ced to 0cba804 Compare January 22, 2026 17:18
@p0lyn0mial
Copy link
Copy Markdown
Contributor

@JoelSpeed is this PR still relevant ?

@JoelSpeed
Copy link
Copy Markdown
Contributor Author

It is yes

I was having some back and forth last week with @wking and @everettraven about how we want this to look. I'm currently pausing on this for the moment while i focus on getting the CVO feature gate annotation work wrapped. But this is on the requirements list for 5.0 so I'll come back to this soon

@JoelSpeed JoelSpeed force-pushed the manifest-inclusion-major-version branch 3 times, most recently from 73e3e1c to 6e5ccfd Compare January 30, 2026 12:17
@JoelSpeed JoelSpeed force-pushed the manifest-inclusion-major-version branch from 6e5ccfd to 6f4c21d Compare January 30, 2026 14:01
@JoelSpeed JoelSpeed changed the title Manifest inclusion filtering based on major version OCPSTRAT-2876: Manifest inclusion filtering based on major version Jan 30, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 30, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Jan 30, 2026

@JoelSpeed: This pull request references OCPSTRAT-2876 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the feature to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Currently based on #2067

This teaches the manifest inclusion to filter based on a major-version annotation. This will allow us to concurrently build multiple major versions from a single branch while folks can include manifests (in particular feature gates) that apply only to 4, or 5, or 6 etc

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.

@p0lyn0mial
Copy link
Copy Markdown
Contributor

But this is on the requirements list for 5.0 so I'll come back to this soon

ok, sgtm, please let me know when it is ready for review.

@p0lyn0mial
Copy link
Copy Markdown
Contributor

/approve

/hold

I’m adding a hold so you can test the changes in the operator, if you haven’t already.

@p0lyn0mial p0lyn0mial added 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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Feb 9, 2026
@JoelSpeed
Copy link
Copy Markdown
Contributor Author

/hold cancel

I think we have enough consensus to move this forward

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 10, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Feb 10, 2026

@JoelSpeed: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot Bot merged commit 1b1e12b into openshift:master Feb 10, 2026
4 checks passed
{
name: "nil major version should include all",
annotations: map[string]string{"release.openshift.io/major-version": "4"},
clusterMajorVersion: nil,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

awsome

expectedErrorContains: "major version 4 does not match any required versions",
},
{
name: "multiple inclusions - first matches",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

awsome

expectIncluded: true,
},
{
name: "multiple inclusions - middle matches",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

awsome

expectIncluded: true,
},
{
name: "multiple inclusions - last matches",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

awsome

expectedErrorContains: "invalid excluded major version \"abc\" in annotation: strconv.ParseUint: parsing \"abc\": invalid syntax",
},
{
name: "zero version",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

awsome

}

// TestMajorVersionFilteringInteractionWithOtherFilters tests that major version filtering works alongside other filters
func TestMajorVersionFilteringInteractionWithOtherFilters(t *testing.T) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this is really great job!

Comment thread pkg/manifest/manifest.go
case includedVersions.Has(clusterMajorVersion):
return nil // Found matching version, include this manifest
case excludedVersions.Has(clusterMajorVersion):
return fmt.Errorf("major version %d matches excluded version %d", clusterMajorVersion, clusterMajorVersion)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It seems the second variable in the error string should be excludedVersions.

I got logs:

2026-03-19T03:56:10.602708782Z I0319 03:56:10.602688       1 payload.go:217] excluding Filename: "0000_03_version-4-5-6-false.yaml" Group: "apiextensions.k8s.io" Kind: "CustomResourceDefinition" Name: "version-4-5-6.test.io": major version 4 matches excluded version 4

@JoelSpeed please help condifrm.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it is actually correct. From the case condition we know that the clusterMajorVersion is in the excludedVersions set, so even if we tried to change this to print out the excluded versions, it would just show us a list of excluded versions rather than a specific excluded version that matched.

The error message that is printed out is always correct, the 4 here was an excluded version

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

um, it looks strange, but anyway from the message we can know the version is excluded

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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. 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