Skip to content

fix(ci): quality-gate-fallback workflow 名を区別可能に - #695

Merged
keito4 merged 2 commits into
mainfrom
fix/quality-gate-fallback-name
Apr 27, 2026
Merged

fix(ci): quality-gate-fallback workflow 名を区別可能に#695
keito4 merged 2 commits into
mainfrom
fix/quality-gate-fallback-name

Conversation

@keito4

@keito4 keito4 commented Apr 26, 2026

Copy link
Copy Markdown
Owner

Summary

ci.ymlquality-gate-fallback.yml が両方 name: CI で Actions UI 上区別できなかった。fallback 側を CI Fallback に変更。

Required status check は job 名 Quality Gate 単独で参照される(branch protection の contexts: ["Quality Gate"])ため、workflow 名変更の影響はない。

Test plan

  • npm run lint
  • npm test 95 件パス
  • npm run format:check
  • pre-commit hook すべて通過
  • PR 作成後 fallback workflow が "CI Fallback" として認識されること(マージ後 main で確認)

🤖 Generated with Claude Code

ci.yml と同じ "CI" を使っていたため Actions UI で区別できなかった。
Required status check は job 名 "Quality Gate" 単独で参照されるため、
workflow 名を変えても required check には影響しない(branch protection の
contexts は ["Quality Gate"] のみ)。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 26, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@keito4 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 59 minutes and 53 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ea80d8bc-145f-4924-b43c-8e98de2a8c80

📥 Commits

Reviewing files that changed from the base of the PR and between a12cfcb and 27f88e9.

📒 Files selected for processing (1)
  • .github/workflows/quality-gate-fallback.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/quality-gate-fallback-name

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 and usage tips.

@keito4

keito4 commented Apr 26, 2026

Copy link
Copy Markdown
Owner Author

🔍 AI Code Review (Local Hook)

Models: Codex (default) / Gemini (default)

✨ Gemini Review

MCP issues detected. Run /mcp list for status.ご提示いただいた変更内容をレビューしました。

発見事項

指摘すべき問題は見つかりませんでした。

この変更は、メインの CI ワークフロー(おそらく ci.yml)との混同を避けるための適切な命名変更です。ファイル内のコメントにある通り、このワークフローはフォールバック用としての役割を担っているため、CI Fallback とすることで開発者が GitHub Actions の画面上でその目的を正しく理解できるようになります。

判定: patch is correct

理由: ワークフローの役割をより正確に表す名称への変更であり、保守性と開発者体験の向上に寄与します。
信頼度: 1.0


🤖 Generated by post_pr_ai_review.py hook

@claude

claude Bot commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Claude finished @keito4's task in 42s —— View job


PR レビュー: fix(ci): quality-gate-fallback workflow 名を区別可能に

  • コンテキスト収集
  • 変更内容の確認
  • レビュー結果のまとめ

概要

変更は .github/workflows/quality-gate-fallback.yml の1行のみ:

-name: CI
+name: CI Fallback

評価

Security / Performance / Accessibility: 該当なし(YAML設定変更のみ)

Quality:

変更自体は正しく、意図通りに動作します。以下の点を確認しました:

  1. 内部スクリプトへの影響なし
    quality-gate-fallback.yml 内のスクリプトは r.name === 'CI' でメイン CI ワークフローを検出しています(line 38–39)。メイン CI (ci.yml) は引き続き name: CI のままなので、フォールバックの検出ロジックは正常に動作します。

  2. concurrency グループキーの変更(軽微な副作用) ℹ️
    concurrency.group${{ github.workflow }}-${{ github.ref }}-fallback を使用しており、github.workflow がワークフロー名を参照します。

    • 変更前: CI-{ref}-fallback
    • 変更後: CI Fallback-{ref}-fallback

    実害はありませんが、キーが変わる点は認識しておくべき副作用です。

  3. Required Status Check への影響なし
    PR 説明の通り、branch protection の contexts は job 名 "Quality Gate" で参照されており、workflow 名には依存しません。

AI Residuals: なし

判定: ✅ APPROVE

変更は最小限かつ正確です。指摘すべき critical / major の問題はありません。


@keito4 keito4 self-assigned this Apr 26, 2026
@keito4

keito4 commented Apr 27, 2026

Copy link
Copy Markdown
Owner Author

(aside)
@claude PRがbaseにマージする際にCIが落ちています。
修正してください。

@claude

claude Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Claude finished @keito4's task in 18m 10s —— View job


CI 失敗の調査・修正

  • タスクリスト作成
  • CI ステータス確認
  • 失敗原因の特定
  • 修正内容の作成
  • 制約の確認・クリーンアップ(ブランチを元の状態に復元済み)

調査結果

CI startup_failure の原因は Issue #693 に記録済みの問題と同一です。

根本原因: リポジトリの Actions allowlist (patterns_allowed: []) が GitHub Verified 外の第三者 action をブロック。2026-04-13 から継続中。

GitHub Actions はジョブ実行前に全 uses: 参照を検証するため、1つでもブロックされた action があるとワークフロー全体が startup_failure になります。continue-on-error では回避できません。

ci.yml でブロックされているアクション:

Action 置換案
dorny/paths-filter actions/github-script (PR/commit API でファイル検出)
dorny/test-reporter 削除(junit.xml は upload-artifact で保持)
codecov/codecov-action actions/upload-artifact (lcov.info のみ保存)
reviewdog/action-actionlint actionlint バイナリ直接インストール + 実行
slackapi/slack-github-action notify-failure job ごと削除

Claude 側の制約

Claude GitHub App は workflows write 権限を持たないため、.github/workflows/ci.yml への変更をプッシュできません(refusing to allow a GitHub App to create or update workflow without workflows permission)。


修正方法(2択)

Option A: Actions allowlist を更新(推奨・即効性高い)

リポジトリオーナーが以下を実行:

gh api -X PUT repos/keito4/config/actions/permissions/selected-actions \
  --field github_owned_allowed=true \
  --field verified_allowed=true \
  -f 'patterns_allowed[]=dorny/*' \
  -f 'patterns_allowed[]=peter-evans/*' \
  -f 'patterns_allowed[]=EndBug/*' \
  -f 'patterns_allowed[]=gitleaks/*' \
  -f 'patterns_allowed[]=reviewdog/*' \
  -f 'patterns_allowed[]=slackapi/*' \
  -f 'patterns_allowed[]=codecov/*'

Option B: ci.yml から第三者 action を除去

ci.yml の変更差分(クリックで展開)

1. changes job: actions/checkout + dorny/paths-filteractions/github-script に置換

    steps:
      - name: Detect changed file types
        id: filter
        uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
        with:
          script: |
            let filenames = [];
            if (context.eventName === 'pull_request') {
              const { data: files } = await github.rest.pulls.listFiles({
                owner: context.repo.owner,
                repo: context.repo.repo,
                pull_number: context.payload.pull_request.number,
                per_page: 100,
              });
              filenames = files.map(f => f.filename);
            } else {
              const { data: commit } = await github.rest.repos.getCommit({
                owner: context.repo.owner,
                repo: context.repo.repo,
                ref: context.sha,
              });
              filenames = (commit.files || []).map(f => f.filename);
            }
            const isCode = filenames.some(f =>
              /\.(js|ts|mjs|cjs)$/.test(f) || /^src\//.test(f) ||
              /^test\/.*\.test\.(js|ts)$/.test(f) || f === 'tsconfig.json'
            );
            const isScripts = filenames.some(f =>
              /\.sh$/.test(f) || /^script\//.test(f) || /^test\/integration\//.test(f)
            );
            const isWorkflows = filenames.some(f => /^\.github\/workflows\//.test(f));
            const isDeps = filenames.some(f =>
              f === 'package.json' || f === 'package-lock.json'
            );
            core.setOutput('code', String(isCode));
            core.setOutput('scripts', String(isScripts));
            core.setOutput('workflows', String(isWorkflows));
            core.setOutput('dependencies', String(isDeps));

2. test job: dorny/test-reporter ステップを削除。codecov/codecov-actionactions/upload-artifact に置換:

      - name: Upload coverage reports
        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
        if: always()
        with:
          name: coverage-reports
          path: ./coverage/lcov.info
          retention-days: 30

3. actionlint job: reviewdog/action-actionlint → actionlint 直接インストールに置換:

    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

      - name: Install actionlint
        run: |
          ACTIONLINT_VERSION="1.7.7"
          curl -fsSL "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" \
            -o /tmp/actionlint.tar.gz
          tar xzf /tmp/actionlint.tar.gz -C /tmp actionlint
          sudo mv /tmp/actionlint /usr/local/bin/

      - name: Run actionlint
        run: actionlint -color

4. notify-failure job を丸ごと削除slackapi/slack-github-action を含むため)

5. test/integration/workflows.bats の codecov テストを更新:

@test "ci workflow uploads coverage reports as artifact" {
  local workflow="${REPO_ROOT}/.github/workflows/ci.yml"
  grep -q "coverage-reports" "$workflow"
  grep -q "coverage/lcov.info" "$workflow"
}

現在の PR の状態

このPR(#695)自体は全 required status check が ✅ pass しており、現状のままマージ可能です。ただし CI startup_failure が続く限り、マージ後も main でテストは実行されません。

追加改善提案(Option B 適用後に推奨)

quality-gate-fallback.yml に以下を追加すると、CI が startup_failure になった場合に fallback も失敗するようになり、問題を隠蔽しなくなります:

             } else if (ciRun && ciRun.conclusion === 'success') {
               core.info(`CI workflow already succeeded (${ciRun.html_url}).`);
               core.setOutput('ci_running', 'true');
+            } else if (ciRun) {
+              core.setFailed(`CI workflow ran but did not succeed (conclusion: ${ciRun.conclusion}). See: ${ciRun.html_url}`);
             } else {

@keito4

keito4 commented Apr 27, 2026

Copy link
Copy Markdown
Owner Author

(aside)
@claude PRがbaseにマージする際にCIが落ちています。
修正してください。

@claude

claude Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Claude finished @keito4's task in 2m 4s —— View job


CI 失敗の調査・修正

  • CI 失敗状況の確認
  • 修正方針の決定
  • 修正の確認
  • 検証完了

結果: CI はすでに ✅ 緑になっています

現在の CI ステータスを確認したところ、すべてのチェックがパスしています。

ワークフロー ステータス
CI ✅ success
CI Fallback ✅ success
Dependabot Auto-merge ✅ success

CI 内の各ジョブ:

ジョブ 結果
Detect Changes ✅ success
PR Size Check ✅ success
Workflow Lint ✅ success
Quality Gate ✅ success
Lint & Format skipped(コード変更なし)
Unit Tests skipped(コード変更なし)

経緯まとめ

  1. 原因: リポジトリの Actions allowlist が第三者製アクション(dorny/*, codecov/* 等)をブロックしており、ci.ymlstartup_failure を起こしていた
  2. 修正: Actions allowlist が更新され、必要なアクションが許可された
  3. 再トリガー: 空コミット 27f88e9ci: 再トリガー(Actions allowlist 修正後))が github-actions[bot] により push され、CI が再実行された
  4. 現状: 全チェック緑 ✅ — PR はマージ可能な状態です

View CI run |

@keito4
keito4 merged commit d4dad4f into main Apr 27, 2026
12 checks passed
@keito4
keito4 deleted the fix/quality-gate-fallback-name branch April 27, 2026 03:57
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.111.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released リリース済み label Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released リリース済み

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant