Skip to content

fix(gh-pr-flow): approve-via-relay.sh --base NAME for promotion-branch PRs (#2492) - #2494

Merged
jinon86 merged 1 commit into
mainfrom
fix/2492-relay-approve-promotion-base
Oct 23, 2026
Merged

jinon86 merged 1 commit into
mainfrom
fix/2492-relay-approve-promotion-base

Conversation

@jinon86

@jinon86 jinon86 commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Closes #2492

문제

approve-via-relay.sh가 기본 브랜치 대상 PR만 승인한다. 승격 브랜치(#2292, 예: wiki-agent stable)는 protected-branch-NAME ruleset이 교차 계정 승인 1건을 요구하는데, 그 승인을 기록할 경로가 없다. 실측: wiki-agent#223 오너 승인 후 헬퍼 실행 → review target base is not the repository default branch(exit 65).

변경

  • --base NAME (명시 옵션)
    • 로컬: plain 이름만, master/main(대소문자 무관) 거부 — 릴레이 접속 전.
    • 원격: NAME == default_branch면 거부. rules/branches/NAME에 deletion + non_fast_forward + pull_request(required_approving_review_count ≥ 1)가 모두 있어야 허용, 읽기 실패는 fail-closed.
    • PR base가 NAME과 같아야 하며, 필수 체크(classic + ruleset)는 NAME 기준으로 평가.
  • --base가 없으면 기본 브랜치 검사·메시지 그대로. 결과 JSON에 promotion 필드 추가(소비자 영향 없음 — 추가 키).
  • exact-head 체크 0개 거부는 유지: 승격 PR에도 CI가 돌아야 한다(wiki-agent 쪽은 CI 트리거에 stable 추가로 별도 처리).
  • 문서: skills/gh-pr-flow/SKILL.md Promotion branches 절 + skills/registry.json 해시, changelog 조각.

검증

  • scripts/gh-pr-flow-jinon86.test.sh 34/34 (신규 12): 승격 dry-run·실승인(base=stable, promotion=true, 필수 체크를 stable에서 조회) / --base 없이 stable → 기존 메시지로 거부 / 미보호 브랜치·규칙 읽기 실패·base 불일치·--base=기본 브랜치 → 거부(리뷰 미제출) / master·MAIN·refs/heads/stable·origin/stable → 릴레이 접속 전 거부.
  • 규칙 판정 jq를 실데이터로 확인: wiki-agent stable=true, wiki-agent master=false, ccc-node main=false, 없는 브랜치=false.
  • CCC_HARNESS_PHASE=static bash scripts/validate-harness.sh PASS(레지스트리 해시 갱신 후), shellcheck -S warning, changelog_fragments.py check, git diff --check.

범위 밖

  • 배포·재시작 없음. 노드 반영은 ccc-node self-update 경로.

🤖 Generated with Claude Code

…h PRs (#2492)

The relay approval helper accepted only PRs into the default branch, so a
promotion PR (#2292) that the protected-branch-NAME ruleset requires a
cross-account approval for had no approval path (wiki-agent#223, refused with
exit 65).

--base NAME accepts the PR only when its base is NAME and NAME's applied rules
include deletion, non_fast_forward and a pull_request rule requiring >=1
approval (unreadable rules fail closed); required checks are read from NAME.
master/main and non-plain names are refused locally, NAME equal to the default
branch remotely; without --base the default-branch check is unchanged. The
result JSON gains `promotion`. Exact-head checks remain mandatory.

Tests: 12 new cases in scripts/gh-pr-flow-jinon86.test.sh (34/34); the rule
predicate was checked against live data (wiki-agent stable=true, wiki-agent
master/ccc-node main/missing branch=false). Skill doc + registry hash updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jinon86
jinon86 requested a review from seoseo-ai as a code owner October 23, 2026 07:37

@seoseo-ai seoseo-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after exact-head validation and fresh operator authorization using the relay-held seoseo-ai credential.

@jinon86
jinon86 added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit e695759 Oct 23, 2026
14 checks passed
@jinon86
jinon86 deleted the fix/2492-relay-approve-promotion-base branch October 23, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gh-pr-flow: approve-via-relay.sh가 승격 브랜치(stable) 대상 PR을 거부 — #2292 교차 계정 승격 리뷰 경로 부재

2 participants