Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conformance: add request header modifier test #1163

Merged

Conversation

skriss
Copy link
Contributor

@skriss skriss commented May 16, 2022

What type of PR is this?
/area conformance

What this PR does / why we need it:
Adds a request header modifier test.

Which issue(s) this PR fixes:

Updates #1103.

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added area/conformance cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 16, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @skriss. 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 k8s-ci-robot requested review from jpeach and robscott May 16, 2022 22:27
@skriss skriss mentioned this pull request May 16, 2022
14 tasks
@skriss skriss changed the title conformance: add header request modifier test conformance: add request header modifier test May 16, 2022
Copy link
Contributor

@markmc markmc left a comment

Choose a reason for hiding this comment

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

Looks pretty comprehensive to me. A case insensitivity check could be a good addition?

/lgtm

// is expected to arrive at the backend. If
// not specified, it is assumed to be the
// same as the original request.
BackendRequest *Request
Copy link
Contributor

Choose a reason for hiding this comment

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

This could have been reversed so that the "make request" code isn't dealing with a struct that includes AbsentHeaders

To do that, ExpectedRequest would embed Request, and adding AbsentHeaders. You'd always supply an ExpectedRequest, and it would be used for making the request if no Request was specified

But ... meh

Copy link
Member

Choose a reason for hiding this comment

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

Agree that this structure would be a bit better if it's not too much trouble.

Copy link
Contributor Author

@skriss skriss Jun 14, 2022

Choose a reason for hiding this comment

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

OK, I can make this change, just noting that this makes all of the struct literals more verbose in the test cases due to the additional nesting (which I think is why I decided against this approach originally), but if it's preferred I'm fine with it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will push a commit shortly that I think addresses the essence of this comment while keeping the test case struct literals simple for the normal cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, the latest version splits out two structs, Request and ExpectedRequest, with the latter embedding the former and adding AbsentHeaders. Request is the required one, though, with ExpectedRequest defaulting to matching Request if not specified. I think this is the best of both worlds, PTAL.

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels May 27, 2022
@skriss
Copy link
Contributor Author

skriss commented Jun 3, 2022

Looks pretty comprehensive to me. A case insensitivity check could be a good addition?

👍 added the case-insensitivity test case.

@robscott
Copy link
Member

robscott commented Jun 6, 2022

It looks like there's a conflict here, so tests will fail initially, but hopefully this helps post rebase.

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 6, 2022
@skriss skriss force-pushed the conf-header-modifier-filter branch from a609841 to c6d8e1c Compare June 6, 2022 21:53
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 6, 2022
@skriss
Copy link
Contributor Author

skriss commented Jun 6, 2022

Thanks @robscott, conflict fixed

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 8, 2022
@skriss skriss force-pushed the conf-header-modifier-filter branch from c6d8e1c to a057dea Compare June 8, 2022 14:54
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 8, 2022
@skriss
Copy link
Contributor Author

skriss commented Jun 14, 2022

If possible, it'd be nice to get this merged before the v0.5.0 release.

@skriss
Copy link
Contributor Author

skriss commented Jun 14, 2022

Note this will need to be updated after #1144 and #1158 merge.

@robscott
Copy link
Member

@skriss this LGTM but agree with @markmc's suggestions above, specifically the adjustments to types and adding a check that covers case insensitive matching.

@skriss skriss force-pushed the conf-header-modifier-filter branch from a057dea to b3a6d37 Compare June 14, 2022 20:38
@skriss
Copy link
Contributor Author

skriss commented Jun 14, 2022

and adding a check that covers case insensitive matching.

I added this in d2990dd

@skriss
Copy link
Contributor Author

skriss commented Jun 27, 2022

@robscott just a nudge here, the feedback has been addressed and would be great to have this included in v0.5.0 if possible, thanks!

@ghost
Copy link

ghost commented Jul 1, 2022

LGTM, thank you!

@robscott
Copy link
Member

robscott commented Jul 1, 2022

Sorry it took me so long to get back to this one! Took the time to verify that these tests pass locally for me.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 1, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: robscott, skriss

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 Jul 1, 2022
@robscott
Copy link
Member

robscott commented Jul 1, 2022

Looks like this conflicts with #1228. Will LGTM again once this is rebased.

skriss added 7 commits July 1, 2022 19:18
Signed-off-by: Steve Kriss <krisss@vmware.com>
Signed-off-by: Steve Kriss <krisss@vmware.com>
Signed-off-by: Steve Kriss <krisss@vmware.com>
Signed-off-by: Steve Kriss <krisss@vmware.com>
Signed-off-by: Steve Kriss <krisss@vmware.com>
Signed-off-by: Steve Kriss <krisss@vmware.com>
Signed-off-by: Steve Kriss <krisss@vmware.com>
@skriss skriss force-pushed the conf-header-modifier-filter branch from b3a6d37 to d896f12 Compare July 1, 2022 19:23
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 1, 2022
@skriss
Copy link
Contributor Author

skriss commented Jul 1, 2022

Rebased and fixed conflict, thanks @robscott! (Also re-validated that this is passing for Contour).

@robscott
Copy link
Member

robscott commented Jul 1, 2022

/lgtm

@robscott
Copy link
Member

robscott commented Jul 1, 2022

Seems like the first one didn't work...

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 1, 2022
@k8s-ci-robot k8s-ci-robot merged commit 46348cc into kubernetes-sigs:main Jul 1, 2022
@skriss skriss deleted the conf-header-modifier-filter branch July 1, 2022 21:15
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. area/conformance cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants