Skip to content

Fix pagination prefix duplication on GHE with redirect#754

Open
petr-muller wants to merge 1 commit into
kubernetes-sigs:mainfrom
petr-muller:fix-748-ghe-redirect
Open

Fix pagination prefix duplication on GHE with redirect#754
petr-muller wants to merge 1 commit into
kubernetes-sigs:mainfrom
petr-muller:fix-748-ghe-redirect

Conversation

@petr-muller

Copy link
Copy Markdown
Contributor

Summary

Fixes the known limitation noted in #748: on GitHub Enterprise instances (where the base URL includes a path prefix like /api/v3), a redirect (e.g. repo rename) causes the pagination prefix detection to fail, doubling the prefix in the next-page URL (/api/v3/api/v3/...) and producing a 404.

Replaces the string-suffix-matching prefix computation with host-aware lookup: the GHE path prefix is determined by matching the Link header URL's host against c.bases and extracting the path component. This is immune to redirects because it doesn't depend on the request/response path matching.

Depends on #753.

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 12, 2026
@netlify

netlify Bot commented Jun 12, 2026

Copy link
Copy Markdown

Deploy Preview for k8s-prow ready!

Name Link
🔨 Latest commit 55cf6c6
🔍 Latest deploy log https://app.netlify.com/projects/k8s-prow/deploys/6a3011502425ef000804f047
😎 Deploy Preview https://deploy-preview-754--k8s-prow.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: petr-muller

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

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 12, 2026
Determine the GHE path prefix by matching the Link header
URL host against c.bases, instead of inferring it from path
suffix matching which breaks when a redirect changes the
response URL path.
@petr-muller petr-muller force-pushed the fix-748-ghe-redirect branch from 6bc30a8 to 55cf6c6 Compare June 15, 2026 14:50
@petr-muller petr-muller marked this pull request as ready for review June 15, 2026 14:50
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 15, 2026
@k8s-ci-robot k8s-ci-robot requested a review from smg247 June 15, 2026 14:51
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 15, 2026
@petr-muller

Copy link
Copy Markdown
Contributor Author

/cc @jmguzik

@k8s-ci-robot k8s-ci-robot requested a review from jmguzik June 15, 2026 15:15
@Prucek

Prucek commented Jun 24, 2026

Copy link
Copy Markdown
Member

/lgtm
/hold for @jmguzik or whenever you are ready

@kubernetes-prow kubernetes-prow Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 24, 2026
@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 24, 2026
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. 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. 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.

3 participants