Repository navigation
fix(list): filter the Gitea open-PR lookup by head branch for same-repo branches - #4864
Merged
Merged
Conversation
…ranches `wt list --full` found a same-repo branch's Gitea/Forgejo PR only if it was among the first 20 open PRs. Same-repo branches now add `&head=<branch>` to the one `tea api .../pulls` call: Forgejo 16+ filters on it, Gitea will once go-gitea/gitea#40164 ships, and older servers ignore the parameter and return the same first page as before. The client-side match is unchanged. Fork branches keep the unfiltered request, since Forgejo and new Gitea read the `head` value in incompatible forms. Closes #4746
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
wt list --fulland the statusline found a same-repo branch's Gitea/Forgejo PR only if it was among the repository's first 20 open PRs (#4746). Following the direction agreed on the issue, a same-repo branch now adds&head=<branch>to the existingtea api .../pulls?state=open&limit=20request. It stays one call:head(matchinghead_branch), so the page holds only that branch's PRs.The client-side branch + owner match is unchanged. A fork branch keeps the unfiltered request. Forgejo wants the bare name and new Gitea wants
owner:branch, and each form matches nothing on the other server. "Same-repo" means the branch's push remote resolves to the same owner/repo as the primary remote, compared case-insensitively. The branch name is percent-encoded, sofeat/a&bstays oneheadvalue.Tests.
setup_mock_tea_with_ci_datanow registers thepullsresponse perhead=filter, or as the unfiltered path when given none. The same-repo Giteawt list --fulltests register the filtered paths and the fork test (test_list_full_with_gitea_fork_pr) registers the unfiltered one. With thegitea.rschange reverted, five same-repo tests fail because their requests miss the registered paths. With the change, all 34 Gitea integration tests pass.test_open_pulls_pathpins the path and its encoding. Nothing here was run against a live Gitea or Forgejo server. The server behavior comes from reading their source, as detailed on the issue.Closes #4746