Problem
branch_rules builds repos/{repo}/rules/branches/{branch} without URL-encoding the branch. A base containing / (for example release/1.x) may be misread. Pre-existing.
Evidence
- plugins/source-control/skills/babysit-prs/scripts/babysit_merge.py:324 (
gh_json(["api", f"repos/{repo}/rules/branches/{branch}"]) in branch_rules, line 297).
Suggested fix
URL-encode the branch (urllib.parse.quote(branch, safe="")) before building the path; add a test with a slashed base.
Found while working on #5935.
Problem
branch_rulesbuildsrepos/{repo}/rules/branches/{branch}without URL-encoding the branch. A base containing/(for examplerelease/1.x) may be misread. Pre-existing.Evidence
gh_json(["api", f"repos/{repo}/rules/branches/{branch}"])inbranch_rules, line 297).Suggested fix
URL-encode the branch (
urllib.parse.quote(branch, safe="")) before building the path; add a test with a slashed base.Found while working on #5935.