Skip to content

fix: correct ResponseRecorder hijack state tracking#16611

Merged
knative-prow[bot] merged 1 commit into
knative:mainfrom
immanuwell:fix-response-recorder-hijack
May 22, 2026
Merged

fix: correct ResponseRecorder hijack state tracking#16611
knative-prow[bot] merged 1 commit into
knative:mainfrom
immanuwell:fix-response-recorder-hijack

Conversation

@immanuwell
Copy link
Copy Markdown
Contributor

Proposed Changes

  • fix the inverted hijack state check in ResponseRecorder
  • add coverage for failed and successful hijack cases
  • keep the later error status intact when hijack fails, this was a small paper cut tbh

Repro

  1. Run go test ./pkg/http -run TestResponseRecorder -count=1
  2. Before this patch, failed_hijack ends up with 202 instead of 502
  3. The same old logic also flips successful_hijack the wrong way, kinda backwards

Release Note

NONE

Signed-off-by: immanuwell <pchpr.00@list.ru>
@knative-prow knative-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 22, 2026
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 22, 2026

Welcome @immanuwell! It looks like this is your first PR to knative/serving 🎉

@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 22, 2026

Hi @immanuwell. Thanks for your PR.

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

@knative-prow knative-prow Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 22, 2026
@knative-prow knative-prow Bot requested review from dprotaso and skonto May 22, 2026 09:50
@dprotaso
Copy link
Copy Markdown
Member

/ok-to-test

@knative-prow knative-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 22, 2026
@dprotaso
Copy link
Copy Markdown
Member

/lgtm
/approve

thanks for the fix!

@knative-prow knative-prow Bot added the lgtm Indicates that a PR is ready to be merged. label May 22, 2026
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 22, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, immanuwell

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

@knative-prow knative-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 22, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.28%. Comparing base (42d556e) to head (de5d30e).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16611      +/-   ##
==========================================
+ Coverage   80.22%   80.28%   +0.05%     
==========================================
  Files         217      217              
  Lines       13568    13568              
==========================================
+ Hits        10885    10893       +8     
+ Misses       2316     2310       -6     
+ Partials      367      365       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@knative-prow knative-prow Bot merged commit 8288576 into knative:main May 22, 2026
67 checks passed
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. lgtm 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/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.

2 participants