Skip to content

fix(source-control): babysit branch_rules does not URL-encode branch names #5954

Description

@kyle-sexton

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageNot yet classified. Floor until a type and one priority tier are set.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions