Skip to content

Fix jobsink status Location paths for slashy event metadata - #9100

Merged
knative-prow[bot] merged 1 commit into
knative:mainfrom
immanuwell:fix/jobsink-location-escaping
Jun 1, 2026
Merged

Fix jobsink status Location paths for slashy event metadata#9100
knative-prow[bot] merged 1 commit into
knative:mainfrom
immanuwell:fix/jobsink-location-escaping

Conversation

@immanuwell

@immanuwell immanuwell commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

  • escape source and id when jobsink builds the status Location header
  • unescape them on GET, so the status URL round-trips again
  • add unit tests for normal values and slash-heavy values

Repro

  1. Create a JobSink.
  2. Send an event with source=https://example.com/sources/my/source.
  3. Read the Location header from the POST response.
  4. GET that URL.

Before this patch, the GET can return 400 because raw / in source turn into extra path segments. Pretty normal input, the status URL just goes sideways a bit.

Pre-review Checklist

  • At least 80% unit test coverage
  • E2E tests for any new behavior
  • Docs PR for any user-facing impact
  • Spec PR for any new API feature
  • Conformance test for any change to the spec

Release Note

Fixed `jobsink` status `Location` URLs for events whose CloudEvents `source` or `id` contain `/`.

Docs

knative/docs#6651

Signed-off-by: immanuwell <pchpr.00@list.ru>
@knative-prow
knative-prow Bot requested review from Leo6Leo and creydr June 1, 2026 05:51
@knative-prow

knative-prow Bot commented Jun 1, 2026

Copy link
Copy Markdown

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

@knative-prow knative-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 1, 2026
@knative-prow

knative-prow Bot commented Jun 1, 2026

Copy link
Copy Markdown

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.

@creydr creydr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks a lot for the fix @immanuwell

/lgtm

@knative-prow knative-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 1, 2026
@knative-prow

knative-prow Bot commented Jun 1, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: creydr, 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 Jun 1, 2026
@creydr

creydr commented Jun 1, 2026

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 Jun 1, 2026
@codecov

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.53846% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.03%. Comparing base (f5180bc) to head (eef0d24).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/jobsink/main.go 61.53% 6 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9100      +/-   ##
==========================================
+ Coverage   51.01%   51.03%   +0.02%     
==========================================
  Files         411      411              
  Lines       22112    22130      +18     
==========================================
+ Hits        11281    11295      +14     
- Misses       9962     9963       +1     
- Partials      869      872       +3     

☔ 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.

@creydr

creydr commented Jun 1, 2026

Copy link
Copy Markdown
Member
Waiting until all pods in namespace cert-manager are up......................................................................................................................................................
ERROR: timeout waiting for pods to come up

/retest-required

@knative-prow
knative-prow Bot merged commit 9449661 into knative:main Jun 1, 2026
35 of 37 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/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.

2 participants