리트코드 주차 마무리 자동화 - #52
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
github | 03120a7 | Commit Preview URL Branch Preview URL |
Aug 10 2026, 12:17 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
매주 일요일 주차 마무리를 자동화하려면 워크플로우가 지금이 몇 기 몇 주차인지 알아야 합니다. 그런데 Actions의 기본
GITHUB_TOKEN으로는 조직 프로젝트 보드인 ProjectsV2를 읽을 수 없습니다. 그래서 App 토큰을 가진 이 워커가 대신 조회하도록POST /resolve-iteration을 추가했습니다. 날짜를 전달하면 보드의 Week Iteration을 기준으로 기수와 주차를 해석해서 반환합니다. 덕분에 릴리즈 버전인v{기수}.{주차}.0을 최신 태그에서 추론할 필요가 없고, 기수가 바뀌어도 설정을 수정하지 않아도 됩니다.전체 자동화에서 이 PR이 담당하는 부분은 아래
Cloudflare Worker박스입니다.flowchart TD CRON([매주 일요일 10:00 KST]) --> DATE[어제 날짜 계산<br/>KST 기준] DATE --> RESOLVE subgraph WORKER["Cloudflare Worker — 이 PR"] RESOLVE["POST /resolve-iteration<br/>보드 Week Iteration → 기수·주차"] APPROVE["POST /approve-prs<br/>CI SUCCESS 게이트"] MERGE["POST /merge-prs<br/>mergeable_state=clean 게이트"] end RESOLVE --> FOUND{주차 찾음?} FOUND -->|아니오| REST[기수 사이 휴식기<br/>요약만 남기고 성공 종료] FOUND -->|예| APPROVE APPROVE --> MERGE MERGE --> REL[릴리즈 v기수.주차.0<br/>이미 있으면 건너뜀] REL --> CHECK{미병합 PR 있음?} CHECK -->|있음| FAIL[exit 1 → 스케줄 실패 알림] CHECK -->|없음| DONE([완료])함께 일괄 승인에 CI 게이트를 추가했습니다. 기존에는 체크 상태를 확인하지 않아서 linelint가 실패한 PR에도 승인 리뷰가 남았습니다. 다만 병합 자체는
mergeable_state에서 막히고 있었습니다. 이제는statusCheckRollup이SUCCESS가 아니면 승인하지 않습니다. 프로젝트 필드를 읽는 기존 GraphQL 쿼리에 이 조건을 합쳤기 때문에 subrequest 수는 늘지 않습니다.마지막으로 워커에서
maintenance라벨에 의존하던 부분도 제거했습니다. 6곳에서 이 라벨을 참조하고 있었는데, 그중 5곳은 이미 파일 경로나 Week 필드로 같은 판단을 하고 있어 중복이었습니다. 게다가 라벨이 필요한 상황에도 제대로 붙지 않는 경우가 많았습니다. 최근 봇 테스트 PR 3건에서도maintenance라벨은 붙지 않고py라벨만 붙었습니다. 그래서 Week 경고 댓글을 다는 경로만 제목 기반의isSolutionPR()로 대체했습니다.다만 GitHub 라벨 자체는 그대로 둡니다.
leetcode-study의integration.yaml에서 이 라벨이 있으면 답안 파일명 규칙 검사를 건너뛰도록 되어 있어서, 관리 PR에는 이 동작이 필요합니다. 라벨을 삭제하면 해당 CI가 실패합니다. 이번 PR에서는 워커 쪽의 라벨 참조만 제거하고, 라벨의 역할을 자동화 전반을 제어하는 스위치에서 CI 파일명 검사 우회용으로 좁히는 것입니다.