Skip to content

[Fix] 실패한 topology 갱신 run이 자기 빈 claim을 같은 run에서 정리해 전국 후보 갱신 대기를 막지 않도록 수정 - #1065

Merged
AquilaXk merged 4 commits into
mainfrom
fix/release-own-empty-topology-claim-1064
Oct 9, 2026
Merged

AquilaXk merged 4 commits into
mainfrom
fix/release-own-empty-topology-claim-1064

Conversation

@AquilaXk

@AquilaXk AquilaXk commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Related issue

Closes #1064
Refs #870, #964

Summary

  • Problem: 실패하는 topology 갱신 run이 빈 claim 브랜치를 남기면 전국 후보 갱신이 원장 writer 대기(PT2H)에 걸린다. claim은 다음 topology 실행(2시간 뒤)이 stale로 지우고 새로 만들기 때문에, 짝수 시 :29에 도는 후보 갱신이 보는 claim 나이가 항상 2시간 미만이 되어 매 주기 BLOCKED_BY_PENDING_PR로 끝날 수 있다(마지막 판정 02:29Z).
  • Outcome: 실패한 run이 자기 claim이 "출력 없는 빈 claim 하나(PR 없음)"일 때 같은 run에서 지운다. 지우기 전에 run 실패 보고([Fix] 원천 갱신 workflow 실패를 이슈로 드러내고 광주 보관 시간표 갱신에 수동 실행 경로 추가 #926)를 확인하고, 출력이 있거나 PR이 있는 claim은 그대로 둔다.

Changes

  • tools/ci/remove-orphan-claims.mjs: --self-run-id <run id>를 추가했다. claim을 만든 run이 자기 run이면 failure() step이 부르는 것을 근거로 끝난 failure run으로 본다.
    • OCI에 게시하지 않는 workflow(publicationSteps: null, 현재 topology 갱신)에서만 쓴다. 게시하는 workflow는 CLAIM_ORPHAN_REMOVE_REFUSED.
    • 빈 claim(ahead 1, 제목 일치, 변경 파일 0)이 아니거나 PR이 있거나 lease sha가 다르면 지우지 않는다. 보고가 실패해도 지우지 않는다.
    • 자기 run은 삭제 댓글을 따로 쌓지 않고 run 실패 보고만 확인한다. 삭제 사실은 notice와 step summary에 남는다.
  • .github/workflows/current-capital-topology-refresh.yml: 실패 보고 step 바로 앞에 "Remove this failed run's empty topology claim" step을 추가했다(failure() && env.TOPOLOGY_BRANCH != ''). 실패 보고 step은 계속 마지막이라 새 step의 실패도 보고된다.

claim-orphans.mjs(#995) 의미와의 대응

상태 기존 이 PR
이전 run이 만든 빈 claim, run 종료 ABANDONED(EMPTY_CLAIM_NO_PUBLICATION), 다음 실행이 보고 후 삭제 같다(변경 없음)
이번 run이 만든 빈 claim, 이번 run 실패 다음 실행까지 남음(ACTIVE 뒤 ABANDONED/재사용) 같은 run에서 보고 확인 후 삭제
출력 커밋이 있는 claim RECOVERABLE, 지우지 않음 같다(도구가 거부)
PR이 있는 claim 지우지 않음 같다(도구가 거부)
게시 step이 있는 workflow 게시 증거로 판정 자기 run 예외 불가

Scope

Included

  • 자기 run의 빈 claim 정리 경로와 그 테스트

Excluded

  • ledger-writers-idle의 대기 의미 변경 없음(다른 원장 writer에도 영향이 가는 공유 의미라 건드리지 않았다)
  • 취소된 run의 claim(기존 stale 정리가 맡는다)

Ownership / dependencies

Contract & Compatibility

  • Source / API / schema contract: 변경 없음
  • Artifact / provenance identity: 변경 없음
  • Backward compatibility: --self-run-id는 선택 인자다. 다른 workflow 호출은 그대로다.
  • Migration or cutover: 병합 후 다음 topology 실행부터 적용된다. 이미 남은 claim은 기존 stale 정리가 지운다.

Version impact

  • no version change
  • datapack release only
  • route-map artifact change
  • data contract change
  • product gate JSON change
  • CI workflow·계약 테스트 change

Product gate impact

  • release/product-gates/** 영향 없음
  • 변경한 gate의 근거를 갱신했습니다.
  • 검증되지 않은 지원 범위 claim을 추가하거나 확대하지 않습니다.

Provenance impact

  • source inventory·geometry provenance manifest 영향 없음
  • 제공처·라이선스·갱신 시점·적용 범위를 갱신했습니다.
  • 공식 source로 확인되지 않은 값을 배포 artifact에 추가하지 않습니다.

Version decision

  • datapack version: 변경 없음
  • data contract: 변경 없음
  • route-map artifact / product gate: 변경 없음
  • promotion request id: 없음

Verification

Check Result / Evidence
Focused RED → GREEN RED: remove-orphan-claims.test.mjs 5건·workflow 계약 2건 실패. GREEN: 34건·11건 통과
Affected integration node --test tools/ci/*.test.mjs: 907건 중 906 통과, 1건 실패(stageLocalMobileFixture)는 main(ad1455f)에서도 같은 로컬 실패다
actionlint actionlint .github/workflows/current-capital-topology-refresh.yml: 출력 없음
Required CI PR check 참조
Live provider / release Not required — reason: 실제 삭제 경로는 workflow 실패 시 실행되며 로컬에서는 fake gh/git으로 검증했다
Security / data integrity 반례: 출력 있는 claim, PR 있는 claim, 제목 불일치, 다른 run의 진행 중 claim, 게시 workflow, 보고 실패, lease 불일치 모두 삭제하지 않음

Not run

  • Check: 실제 GitHub Actions에서 실패 run으로 삭제 경로 재현
  • Reason: 의도적으로 실패시키는 run은 만들지 않았다. 병합 후 첫 실패 run의 로그(notice Orphan claim removed)로 확인한다.

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a26a3e9c-deec-4656-b923-905a9a6a07d5
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AquilaXk AquilaXk left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🎯 Linked issue & acceptance criteria audit
ID Acceptance criterion Status Evidence
AC1 Failed run removes its own empty claim only after the failure report PASS tools/ci/remove-orphan-claims.mjs; report precedes git push in the own-run test
AC2 Keep claims with output, PR, other title, publishing workflow or other run PASS tools/ci/remove-orphan-claims.test.mjs; counterexample tests refuse every shape
AC3 Record the removal in the run log and step summary PASS tools/ci/remove-orphan-claims.mjs; recordRemoval writes notice and summary
AC4 Do not delete when the report fails PASS tools/ci/remove-orphan-claims.test.mjs; failing report test sees no push
🛡️ Adversarial audit evidence
  • Falsifiability verified: Yes (Safety guards killed by tests; one reporting-only survivor is reported as F2)
  • Hollow assertions detected: 0
  • Production backdoors detected: 0
  • Ground-truth sources verified:
    • tools/ci/claim-orphans.mjs classification rules and CLAIM_OWNERS table
    • tools/ci/report-refresh-failure.mjs report contract
🤖 Prompt for all review comments with AI agents
Could we verify each finding against the current code and keep only those that
still apply? Could we make the smallest validated fix and briefly note why any
finding no longer applies?

Inline comments:
- `@tools/ci/remove-orphan-claims.mjs:81-87`
  Could the claim step export the claim commit sha, and could self mode require
  the ls-remote sha to equal it so the lease binds to the empty claim itself?
- `@tools/ci/remove-orphan-claims.mjs:124-124`
  Could the reused-claim test assert the exact report input, including orphan,
  so the AND to OR mutant turns RED?

---

Outside diff comments:
None.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository CLAUDE.md rules, PR 1065 text and linked issue 1064, applied by aquila-review

Review profile: ASSERTIVE

Plan: Aquila fallback

Run ID: N/A (Aquila fallback)

Review source: Aquila CLI

Repository visibility: public GitHub repository

Trigger:
Manual discovery review of a self-authored grade-A CI workflow PR

Base:
main@ad1455fb06ca72d8fbfce928a6e9a0478b3398a9

Head:
fix/release-own-empty-topology-claim-1064@351cdb3780d8449494197f56746cff5b01838512

Command:
aquila-review discovery for easysubway-data PR 1065

📥 Commits

Reviewing files changed in this pull request between:

  • Base: ad1455fb06ca72d8fbfce928a6e9a0478b3398a9
  • Head: 351cdb3780d8449494197f56746cff5b01838512
📒 Files selected for processing (4)
  • .github/workflows/current-capital-topology-refresh.yml
  • tools/ci/current-capital-topology-refresh-workflow.test.mjs
  • tools/ci/remove-orphan-claims.mjs
  • tools/ci/remove-orphan-claims.test.mjs
📜 Review details

Comment thread tools/ci/remove-orphan-claims.mjs
Comment thread tools/ci/remove-orphan-claims.mjs
@AquilaXk
AquilaXk marked this pull request as ready for review October 9, 2026 03:39
@AquilaXk AquilaXk added the automerge FIFO 병합 큐 대상 — 코디네이터가 순서대로 update-branch 후 auto-merge label Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

No description provided.

@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@AquilaXk
AquilaXk merged commit cdd9f37 into main Oct 9, 2026
13 checks passed
@AquilaXk
AquilaXk deleted the fix/release-own-empty-topology-claim-1064 branch October 9, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge FIFO 병합 큐 대상 — 코디네이터가 순서대로 update-branch 후 auto-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix] 반복 실패하는 topology 갱신이 남긴 빈 claim이 전국 후보 갱신을 매 주기 막지 않도록 같은 run에서 정리

1 participant