1.7 KiB
1.7 KiB
PR readiness shortcuts
Background
Pull request workflows already support list, create, view, merge, review, comments, changed files, and patchset/version inspection. Two helper endpoints were still documented as Raw API calls:
GET /:owner/:repo/pulls/get_branchesPOST /:owner/:repo/pulls/check_can_merge
This change adds first-class shortcuts for those PR preparation workflows.
New shortcuts
pr +brancheslists PR source/target branch candidates.pr +check-can-mergechecks whether a source branch can merge into a target branch.
Safety model
pr +branches is read-only and can run directly:
gitlink-cli pr +branches --owner Gitlink --repo forgeplus
pr +check-can-merge uses a remote POST endpoint, so it supports dry-run and
requires explicit confirmation for real execution:
gitlink-cli pr +check-can-merge --owner Gitlink --repo forgeplus \
--head feature/search --base master --dry-run
gitlink-cli pr +check-can-merge --owner Gitlink --repo forgeplus \
--head feature/search --base master --yes
Documentation updates
- README and README.zh-CN include branch helper and merge readiness examples.
skills/gitlink-prnow preferspr +branchesandpr +check-can-mergeover Raw API calls.skills/gitlink-gatekeeperincludes merge readiness as a PR preflight signal.
Tests
Unit tests cover:
- endpoint method/path mapping for
pr +branches; pr +check-can-mergedry-run behavior;--yesconfirmation guard;- request payload and default
--base master; - HTTP error propagation for both shortcuts.
Suggested verification:
go test ./shortcuts/pr ./shortcuts
Full project verification:
go test ./...