Skip to content

ci: golangci-lint の GitHub Actions を追加 (#373)#375

Merged
taminororo merged 1 commit into
developfrom
ci/golangci-lint-actions
Jun 21, 2026
Merged

ci: golangci-lint の GitHub Actions を追加 (#373)#375
taminororo merged 1 commit into
developfrom
ci/golangci-lint-actions

Conversation

@taminororo

Copy link
Copy Markdown
Collaborator

Summary

CodeRabbit は golangci-lint を root 起点で ./... 実行し、Go モジュールが api/ サブディレクトリにある本リポでは原理的に動かせない(#373)。回数無制限・CodeRabbit のクレジットに非依存な GitHub Actions で golangci-lint を working-directory: api 実行に置き換える。

Refs #373

ワークフロー

- uses: golangci/golangci-lint-action@v7
  with:
    version: v2.12
    working-directory: api      # ← CodeRabbit に無い、api/ で実行する指定
    only-new-issues: true       # ← 既存負債(約74件)を無視し、PR新規分だけ検査
  • working-directory: api: go.mod のある api/ で実行。CodeRabbit の directory prefix . does not contain main module を構造的に回避。
  • only-new-issues: true: 既存の lint 負債(ineffassign 約70・gosec 2・unused 2)で全PRが赤くならないよう、PR の差分で新規に増えた指摘だけを落とす(--new-from-patch)。
  • action は golangci-lint v2 対応の v7version: v2.12(CodeRabbit と同じ系統)。

実地検証済み

PR #372 のブランチ上でこのワークフローを動かし、成功を確認済み

Running golangci-lint-2.12.2 run --new-from-patch=... --path-prefix=api
  in [/home/runner/work/SeeFT/SeeFT/api]   ← api/ で実行されている
"0 issues." / "golangci-lint found no issues" → 45秒で pass(緑)

補足

  • このPRは .github/workflows/ のみの変更で api/** を含まないため、path filter によりこのPR自体では lint は起動しない(仕様)。develop マージ後、api/ を変更する以後の全PRで自動起動する。
  • CodeRabbit の golangci-lint は chore: CodeRabbit に golangci-lint の config_file を明示 (#373) #374(config_file)で改善が見込めるため無効化せず併存(クレジットがある時のレビュー補助として残す)。CI が確実な lint の担保、CodeRabbit は best-effort、という二段構え。
  • ログに Node 20 deprecation 警告が出るが非ブロッキング。将来 checkout@v5 / action@v8+ に上げれば解消。

Test plan

CodeRabbit は root 起点で golangci-lint を実行し api/ サブモジュールに
対して動かせない(#373)。回数無制限・クレジット非依存の GitHub Actions で
working-directory: api 実行に置き換える。

- 既存 lint 負債(約74件)で全PRが赤くならないよう only-new-issues: true で
  「PRで新規に増えた指摘」だけを対象にする
- golangci-lint v2 対応のため action は v7、version は v2.12
- PR #372 のブランチ上で実地検証済み(golangci-lint 2.12.2 が api/ で動作、
  --new-from-patch で新規0件 → 緑、45秒で完走)

Refs #373
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@taminororo, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 40 minutes and 43 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0e1bfb24-bc5d-4113-83e7-5ac8dd64fd6f

📥 Commits

Reviewing files that changed from the base of the PR and between 1afd465 and 5719d27.

📒 Files selected for processing (1)
  • .github/workflows/lint.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/golangci-lint-actions

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.

@taminororo taminororo merged commit f504f0f into develop Jun 21, 2026
1 check passed
@taminororo taminororo deleted the ci/golangci-lint-actions branch June 21, 2026 19:25
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