Skip to content

ci: Dependabot bundler PR에서 gem RBI를 자동 재생성 - #1195

Open
stadia wants to merge 1 commit into
mainfrom
ci/dependabot-rbi
Open

stadia wants to merge 1 commit into
mainfrom
ci/dependabot-rbi

Conversation

@stadia

@stadia stadia commented Nov 26, 2026

Copy link
Copy Markdown
Owner

배경

Dependabot은 Gemfile.lock만 올리고 sorbet/rbi/gems는 그대로 둡니다. 그래서 머지할 때마다 main typecheck의 tapioca gem --verify가 깨졌습니다. 최근 사례는 #1187·#1192 → #1190이고, 이 실패는 #1194에서 수동으로 고쳤습니다.

변경

.github/workflows/dependabot-rbi.yml

  • Dependabot PR에서 Gemfile.lock이 바뀌면 bin/tapioca gem -e test를 돌립니다. 바뀐 젬의 RBI만 재생성해 같은 브랜치에 커밋합니다.
  • GITHUB_TOKEN으로 push한 커밋에는 CI가 새로 붙지 않습니다. 그래서 gh workflow run ci.yml --ref <branch>로 CI를 다시 돌립니다. workflow_dispatch는 이 제한의 예외라 실행됩니다.
  • actor와 PR 작성자가 모두 dependabot[bot]일 때만 실행되므로, 이 워크플로가 만든 커밋 때문에 다시 돌아가는 루프는 생기지 않습니다.
  • main에 브랜치 보호가 없고 Dependabot 시크릿도 없어서, PAT 없이 GITHUB_TOKEN(contents·actions write)만 씁니다.

sorbet/tapioca/skip_broken_rbs_rewrite.rb

  • 로컬에서만 쓰던 herb·reactionview RBS 리라이터 우회 패치를 저장소로 옮겼습니다. tapioca 0.20.0 + herb 0.11.2에서는 이 패치가 없으면 여전히 생성이 깨집니다.
  • 패치가 spoom RBI에 extend 줄로 새어 들어가는 문제는 워크플로에서 sed로 지웁니다.

AGENTS.md

  • 로컬 재생성 명령과 이 워크플로를 적었습니다.

로컬 확인

  • 앱 부팅에 DB 연결이 필요합니다. 그래서 boundaries 잡과 같은 ra-pg 서비스, libvips, schema load를 준비합니다.
  • main에서 -e test로 재생성한 bootsnap 1.26.2·image_processing 2.2.2 RBI를 dev 환경에서 만든 결과(chore(sorbet): bootsnap 1.26.2·image_processing 2.2.2 gem RBI 갱신 #1194)와 비교했습니다. 바이트 단위로 같았고, 패치 누수도 없었습니다.
  • rubocop, srb tc, 워크플로 YAML 파싱 모두 통과했습니다.

미확인 / 위험

  • 워크플로는 Dependabot PR이 와야 실행되므로 아직 실제로 돌려 보지 못했습니다. 머지 후 다음 Dependabot bundler PR에서 확인해야 합니다.
  • 비교는 macOS에서만 했습니다. Linux 러너에서 플랫폼별 젬의 RBI가 다르게 나올 수 있는데, 다르면 CI의 verify가 잡아냅니다.
  • Dependabot은 다른 커밋이 섞인 PR을 자동으로 rebase하지 않습니다. 충돌이 나면 @dependabot recreate로 다시 만들면 되고, 그때 이 워크플로가 다시 돕니다.
  • 이 잡은 쓰기 토큰을 가진 채 Dependabot이 올린 젬 코드를 실행합니다. 기존 CI도 같은 코드를 실행하지만, 이 잡은 쓰기 권한이 있다는 점이 다릅니다.

🤖 Generated with Claude Code

https://claude.ai/code/session_013Hry66K6wzb2UhKgHmAjuR

Dependabot은 Gemfile.lock만 올리고 sorbet/rbi/gems를 그대로 둔다. 그래서 머지 후 main
typecheck의 `tapioca gem --verify`가 계속 깨졌다(#1187·#1192 → #1190, #1194).

- .github/workflows/dependabot-rbi.yml: Gemfile.lock이 바뀐 Dependabot PR에서 `bin/tapioca gem -e test`로
  바뀐 젬의 RBI만 재생성해 같은 브랜치에 커밋한다. GITHUB_TOKEN push는 새 CI를 만들지 않으므로
  `gh workflow run ci.yml`로 다시 돌린다(workflow_dispatch는 예외). actor와 PR 작성자가 모두
  dependabot[bot]일 때만 돌아 자기 커밋으로 루프가 생기지 않는다. main 브랜치 보호와 Dependabot
  시크릿이 없어 PAT 없이 GITHUB_TOKEN(contents·actions write)만 쓴다.
- sorbet/tapioca/skip_broken_rbs_rewrite.rb: 로컬에서만 쓰던 herb·reactionview RBS 리라이터 우회
  패치를 저장소로 옮겼다. tapioca 0.20.0 + herb 0.11.2에서 패치 없이는 여전히 생성이 깨진다.
  spoom RBI로의 extend 누수는 워크플로에서 sed로 지운다.
- AGENTS.md: 로컬 재생성 명령과 워크플로를 적었다.

로컬 확인:
- 앱 부팅에 DB 연결이 필요하다(잘못된 DATABASE_URL로 ConnectionNotEstablished). 그래서 boundaries
  잡과 같은 ra-pg 서비스·libvips·schema load를 준비한다.
- main에서 `-e test`로 재생성한 bootsnap 1.26.2·image_processing 2.2.2 RBI가 dev 환경 결과(#1194)와
  바이트 단위로 같았고, 패치 누수는 없었다.
- `--all`은 도구 버전 포맷 드리프트로 90파일이 바뀌어 쓰지 않는다.
- rubocop OK, srb tc OK, 워크플로 YAML 파싱 OK.
- 워크플로 자체는 Dependabot PR이 와야 실행되므로 아직 돌려 보지 못했다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Hry66K6wzb2UhKgHmAjuR
@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bcd90477-125b-4fa9-8ae3-2e7b3b328a69
Commits

Reviewing files that changed from the base of the PR and between a5032c6 and 0abf237.

Files selected for processing: 3

  • .github/workflows/dependabot-rbi.yml
  • AGENTS.md
  • sorbet/tapioca/skip_broken_rbs_rewrite.rb
  • Autofix · 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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T23:48:31.379755Z 0abf237 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

1 participant