8000 fix: use inferred supported features to set extendedSupportedFeatures by snorwin · Pull Request #4113 · kubernetes-sigs/gateway-api · GitHub
[go: up one dir, main page]

Skip to content

Conversation

snorwin
Copy link
Member
@snorwin snorwin commented Sep 22, 2025

What type of PR is this?

/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #4112

Does this PR introduce a user-facing change?:

Set extended supported/unsupported features in conformance test reports based on inferred supported features

Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 22, 2025
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 22, 2025
@LiorLieberman
Copy link
Member

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 22, 2025
Copy link
Member
@LiorLieberman LiorLieberman left a comment

Choose a reason for hiding this comment

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

/cc @bexxmodd

}
for _, f := range conformanceProfile.ExtendedFeatures.UnsortedList() {
if options.SupportedFeatures.Has(f) {
if suite.SupportedFeatures.Has(f) {
Copy link
Member

Choose a reason for hiding this comment

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

I think thats good, but need someone else's eyes on this to confirm.

Copy link
Contributor
@bexxmodd bexxmodd Sep 22, 2025

Choose a reason for hiding this comment

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

Can you describe and what's the changing here?

suite.SupportedFeatures is created from options.SupportedFeatures and when we are updating suite.SupoortedFeatures (which will be used for testing) we are checking if the proper features were populated in the options.SupportedFeatures, we don't want simultaneously check and update the same set, as it makes logic vulnerable to some obscure bugs.

P.S. also can you please add unit tests for the fixed logic.

Copy link
Member Author

Choose a reason for hiding this comment

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

@bexxmodd the bug is described in #4112.

The issue occurs when supported features are inferred from the GatewayClass, in those cases, they aren’t included in options.SupportedFeatures but only set in suite.SupportedFeatures. As a result, the conformance test report incorrectly marks them as unsupported.

Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed this with @LiorLieberman offline. I see the issue.

Just a nit: Can you please use supportedFeatures for check, instead of suite.SupportedFeatures ? As in above comment, it's not a great practice to update the set that is also checked upon in the loop.

Copy link
8000
Member Author
@snorwin snorwin Sep 22, 2025

Choose a reason for hiding this comment

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

But then we’d also have to change:

			if !suite.SupportedFeatures.Has(f) {
				suite.SupportedFeatures.Insert(f)
			}

to:

			if !supportedFeatures.Has(f) {
				suite.SupportedFeatures.Insert(f)
			}

That doesn’t seem right to me. I see supportedFeatures as a temporary variable that should only be used until the suite is initialized.

Copy link
Member Author

Choose a reason for hiding this comment

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

For unit test coverage, I’d propose adding assertions for extendedSupportedFeatures in TestInferGWCSupportedFeatures.

Copy link
Contributor

Choose a reason for hiding this comment

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

My bad. I meant to use supportedFeatures to check if it has a name or not.

Copy link
Member Author

Choose a reason for hiding this comment

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

@bexxmodd I’m not sure I understand what you’re requesting, could you provide a code suggestion?

@k8s-ci-robot
Copy link
Contributor

@LiorLieberman: GitHub didn't allow me to request PR reviews from the following users: bexxmodd.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

options.supportedFeatures are the supportedFeatures provided

/cc @bexxmodd

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.

@LiorLieberman
Copy link
Member
LiorLieberman commented Sep 22, 2025

@snorwin IIUC this only messes up reporting, right?

I think this is LGTM from my side, will leave approval for someone else

/lgtm
/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 22, 2025
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 22, 2025
}
}
for _, f := range conformanceProfile.ExtendedFeatures.UnsortedList() {
if options.SupportedFeatures.Has(f) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if !supportedFeatures.Has(f) {
    suite.SupportedFeatures.Insert(f)
}

It's a temporary variable until final supported features are determined for testing and NewConformanceTestSuite returns ConformanceTestSuite. Nothing limits it's scope until suite is initialized. There's no scope conflict or a misleading name so I don't see why it should go out of usage after suite is initialized. it's the sound representation of populated features from the Status field.

Copy link
Member Author
@snorwin snorwin Sep 23, 2025

Choose a reason for hiding this comment

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

In my opinion, it doesn’t make sense to use supportedFeatures after it has already been assigned to suite.SupportedFeatures. Modifying it at that point would even be incorrect, why should we still rely on it?

In case additional code was inserted above this section that changed suite.SupportedFeatures, then the logic here is supposed to use the actual (possibly modified) features of the suite (suite.SupportedFeatures) rather than the originally derived ones in supportedFeatures.

If it is important that supportedFeatures is used in this part, I would suggest moving the entire section before the initialization of the ConformanceTestSuite object.

Copy link
Contributor

Choose a reason for hiding this comment

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

It is actually a really good idea to move the whole section before initializing the ConformanceTestSuite.

Copy link
Member Author

Choose a reason for hiding this comment

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

@bexxmodd could you take a close look at the refactoring? I simplified the logic quite a bit.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is way cleaner! Thanks Norwin!

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 23, 2025
Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
@snorwin snorwin force-pushed the fix-inferred-supported-features branch from c4e6820 to 68dd9e7 Compare September 23, 2025 09:23
Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
@snorwin snorwin requested a review from bexxmodd September 23, 2025 18:34
}
}
for _, f := range conformanceProfile.ExtendedFeatures.UnsortedList() {
if options.SupportedFeatures.Has(f) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is way cleaner! Thanks Norwin!

@LiorLieberman
Copy link
Member

sweet, thank you!

/approve
/lgtm
/hold please update release notes and communicate on Slack that this WILL impact reporting from now on.

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Sep 23, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bexxmodd, LiorLieberman, snorwin

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 23, 2025
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Sep 23, 2025
@snorwin
Copy link
Member Author
snorwin commented Sep 23, 2025

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 23, 2025
@k8s-ci-robot k8s-ci-robot merged commit c26512f into kubernetes-sigs:main Sep 23, 2025
32 checks passed
@snorwin
Copy link
Member Author
snorwin commented Sep 23, 2025

/cherry-pick release-1.4

@k8s-infra-cherrypick-robot
Copy link
Contributor

@snorwin: new pull request created: #4118

In response to this:

/cherry-pick release-1.4

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.

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v.1.4.0: inferred supported features reported as unsupported in conformance results
5 participants
0