gateway-api icon indicating copy to clipboard operation
gateway-api copied to clipboard

Fix conformance test flags are exported to other libraries that use the conformance test suite

Open hanxiaop opened this issue 1 year ago • 13 comments

What type of PR is this?

What this PR does / why we need it:

/kind bug /area conformance

Which issue(s) this PR fixes:

Fixes https://github.com/kubernetes-sigs/gateway-api/issues/2841.

Currently when implementing GEP-2162, the features need to be imported. However, in the test suite, this import results in the variation of flags within our production code. The goal is to allow the importation of features without modifying the product code.

Does this PR introduce a user-facing change?:


hanxiaop avatar Mar 05 '24 03:03 hanxiaop

Welcome @hanxiaop!

It looks like this is your first PR to kubernetes-sigs/gateway-api 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/gateway-api has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Mar 05 '24 03:03 k8s-ci-robot

Hi @hanxiaop. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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.

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/test-infra repository.

k8s-ci-robot avatar Mar 05 '24 03:03 k8s-ci-robot

Also cc @LiorLieberman to take a look, the feature was introducted in https://github.com/istio/istio/pull/48770.

hanxiaop avatar Mar 13 '24 03:03 hanxiaop

Thanks @hanxiaop! Can you elaborate on the problem? I am not sure I understand

LiorLieberman avatar Mar 13 '24 07:03 LiorLieberman

Thanks @hanxiaop! Can you elaborate on the problem? I am not sure I understand

@LiorLieberman So basically, in that PR, you imported the test suite code into the product code:

https://github.com/istio/istio/blob/42572fab5be79af8de284953ec72cbf439631da8/pilot/pkg/config/kube/gateway/supported_features.go#L24,

and after https://github.com/kubernetes-sigs/gateway-api/pull/2801/files#diff-3532d0dde2d46785ab138cfe0fa7bddc5c1901dde4fe4079880451c010ea8254R34, the flag package was also imported into the suite. After that, our command-line tool was filled with gateway conformance test flags alongside our own pflags, since the test flags were imported in the dependency and thus in the flag set. This PR moves the features file out of the suite, so that we can directly import the features instead of the entire suite package and avoid issues like flags being altered.

hanxiaop avatar Mar 13 '24 07:03 hanxiaop

cc @mlavacca - since you're refactoring the experimental suite

dprotaso avatar Mar 13 '24 14:03 dprotaso

Thanks @hanxiaop! Can you elaborate on the problem? I am not sure I understand

@LiorLieberman So basically, in that PR, you imported the test suite code into the product code:

https://github.com/istio/istio/blob/42572fab5be79af8de284953ec72cbf439631da8/pilot/pkg/config/kube/gateway/supported_features.go#L24,

and after https://github.com/kubernetes-sigs/gateway-api/pull/2801/files#diff-3532d0dde2d46785ab138cfe0fa7bddc5c1901dde4fe4079880451c010ea8254R34, the flag package was also imported into the suite. After that, our command-line tool was filled with gateway conformance test flags alongside our own pflags, since the test flags were imported in the dependency and thus in the flag set. This PR moves the features file out of the suite, so that we can directly import the features instead of the entire suite package and avoid issues like flags being altered.

Thanks, I think many implementations uses suite to import features. This would require all of them to move to features or their code wont work.

Not sure whats the procedure in such case and whether it is considered breaking change or not. /cc @youngnick @shaneutt @robscott

LiorLieberman avatar Mar 13 '24 14:03 LiorLieberman

Thanks, I think many implementations uses suite to import features. This would require all of them to move to features or their code wont work.

If we really want to maintain Go-level compatibility (which I think is a non-goal of the project, but I could be wrong) we can always add a type alias in suite.

howardjohn avatar Mar 13 '24 14:03 howardjohn

Not sure whats the procedure in such case and whether it is considered breaking change or not. /cc @youngnick @shaneutt @robscott

I think this will not be an issue or a breaking change, as it's fairly common for bumping a dependency to result in a change in the package path.

hanxiaop avatar Mar 14 '24 01:03 hanxiaop

This looks good to me, @hanxiaop! Would you mind if we wait for #2868 to land before merging this one (that's part of the conformance suite epic and is required for 1.1)?

@mlavacca no problem, I'll rebase once it's merged, thanks for the review!

hanxiaop avatar Mar 15 '24 01:03 hanxiaop

@mlavacca PTAL, thanks!

hanxiaop avatar Mar 29 '24 06:03 hanxiaop

Thanks @hanxiaop! Can you elaborate on the problem? I am not sure I understand

@LiorLieberman So basically, in that PR, you imported the test suite code into the product code: https://github.com/istio/istio/blob/42572fab5be79af8de284953ec72cbf439631da8/pilot/pkg/config/kube/gateway/supported_features.go#L24, and after https://github.com/kubernetes-sigs/gateway-api/pull/2801/files#diff-3532d0dde2d46785ab138cfe0fa7bddc5c1901dde4fe4079880451c010ea8254R34, the flag package was also imported into the suite. After that, our command-line tool was filled with gateway conformance test flags alongside our own pflags, since the test flags were imported in the dependency and thus in the flag set. This PR moves the features file out of the suite, so that we can directly import the features instead of the entire suite package and avoid issues like flags being altered.

Thanks, I think many implementations uses suite to import features. This would require all of them to move to features or their code wont work.

Not sure whats the procedure in such case and whether it is considered breaking change or not. /cc @youngnick @shaneutt @robscott

Many changes have been made to the suite for its graduation; implementations will have to adapt to those changes in any case when bumping to the next Gateway API version. I do not see this kind of change as problematic.

mlavacca avatar Mar 29 '24 10:03 mlavacca

We need to change all the references to the features in the actual tests, under conformance/tests. As it is, the code does not even compile.

@mlavacca Fixed, missed that dependency. It would be great if someone could add the ok-to-test label so I can check if there are more things being broken.

hanxiaop avatar Apr 01 '24 02:04 hanxiaop

@mlavacca @youngnick @shaneutt @robscott @howardjohn @keithmattix PTAL, thanks!

hanxiaop avatar Apr 08 '24 02:04 hanxiaop

@howardjohn PTAL again, thanks!

hanxiaop avatar Apr 14 '24 02:04 hanxiaop

@robscott PTAL, thanks!

hanxiaop avatar Apr 16 '24 01:04 hanxiaop

/lgtm

howardjohn avatar Apr 16 '24 01:04 howardjohn

Thanks @hanxiaop!

/approve

robscott avatar Apr 16 '24 18:04 robscott

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hanxiaop, howardjohn, robscott

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 avatar Apr 16 '24 18:04 k8s-ci-robot

/ok-to-test /release-note-none

robscott avatar Apr 16 '24 21:04 robscott

@hanxiaop if you'd prefer we can use #2980 which copied this PR and made some modifications to pass presubmits.

robscott avatar Apr 16 '24 23:04 robscott

@hanxiaop if you'd prefer we can use #2980 which copied this PR and made some modifications to pass presubmits.

@robscott Thanks! I think it should be good now. New tests are continually being added to the folder, so I need to do a rebase again. If it doesn't work I think we can use that PR.

hanxiaop avatar Apr 17 '24 01:04 hanxiaop

@howardjohn just rebased and can you LGTM again? Thanks!

hanxiaop avatar Apr 17 '24 02:04 hanxiaop

/lgtm

howardjohn avatar Apr 17 '24 16:04 howardjohn