Skip to content

feat(ci): add cora AI review job to CI pipeline#44

Merged
ajianaz merged 2 commits into
developfrom
feat/ci-cora-review
May 30, 2026
Merged

feat(ci): add cora AI review job to CI pipeline#44
ajianaz merged 2 commits into
developfrom
feat/ci-cora-review

Conversation

@ajianaz

@ajianaz ajianaz commented May 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add cora-review job to CI that runs on every PR to develop.

What it does

  1. Builds cora from source in CI
  2. Fetches LLM secrets from Infisical (OIDC) — CORA_API_KEY, CORA_PROVIDER, CORA_BASE_URL, CORA_MODEL
  3. Runs cora review --base origin/develop --severity major --quiet — reviews diff against develop, filters to major+ severity
  4. Uploads SARIF to GitHub Code Scanning (shows in Checks tab)
  5. Posts PR comment with grouped issues (errors/warnings/notes) — updates existing comment on re-run
  6. Checks for blocking issues — fails the job if error-level issues found

Design decisions

  • needs: [check, fmt, clippy, test] — cora only runs after Rust checks pass (save API calls)
  • if: github.event_name == 'pull_request' — doesn't run on push to main
  • Block mode via SARIF + error-level check — set branch protection rule to require Cora Review check
  • Infisical OIDC — same pattern as release workflow, no manual secrets management

Setup required after merge

In GitHub repo settings → Branch protection rules (develop & main):

  • ✅ Require status checks: add Cora Review

Infisical secrets needed

Already configured:

  • CORA_API_KEY — LLM API key
  • CORA_PROVIDERopenai
  • CORA_BASE_URLhttps://llm.azfirazka.com/v1
  • CORA_MODELglm-5.1

- Runs after check/fmt/clippy/test pass
- Uses Infisical OIDC for LLM API key (CORA_API_KEY, CORA_PROVIDER, CORA_BASE_URL, CORA_MODEL)
- Reviews diff against origin/develop with --severity major --quiet
- Uploads SARIF to GitHub Code Scanning (block-capable)
- Posts PR comment with grouped issues (update existing comment on re-run)
- Checks for blocking issues (error-level) to fail the check
- Only runs on pull_request events (not push to main)
- Added permissions: security-events, pull-requests, id-token
@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

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

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ 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.

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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 43ee1b1f-1db6-4cec-96ba-bb3fc16dd3cc

📥 Commits

Reviewing files that changed from the base of the PR and between 0bfe809 and 1c59cd9.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • src/formatters/sarif.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ci-cora-review

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.

@github-actions

github-actions Bot commented May 30, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

Blocked — critical issues found.

🔴 Error (4)

  • .github/workflows/ci.yml:82 — The Infisical identity-id is hardcoded directly in the workflow file. While OIDC federation is used (good), the identity-id is a sensitive reference that should ideally be stored as a repository secret or variable rather than committed in plaintext. If this identity is ever rotated, every workflow file needs updating.
  • .github/workflows/ci.yml:93 — The || true on the cora review command means cora-results.sarif may be empty or contain stderr output (non-JSON). The SARIF upload step runs with if: always(), so it will attempt to upload a potentially invalid/empty file, which will cause the github/codeql-action/upload-sarif step to fail. While if: always() ensures it runs, the upload action itself will error on malformed SARIF.
  • .github/workflows/ci.yml:93 — The command uses > cora-results.sarif 2>&1 which redirects both stdout and stderr into the SARIF file. If cora outputs any warnings or errors to stderr, the file will contain non-JSON content prepended/appended to the SARIF JSON, making it completely invalid for both the SARIF upload and the PR comment parsing.
  • .github/workflows/ci.yml:93 — The || true means the cora command can fail without creating the output file. Subsequent steps that read cora-results.sarif (upload SARIF, post PR comment, check for blocking issues) will fail when the file doesn't exist. The PR comment step handles this with try/catch, but the SARIF upload and blocking check steps don't properly guard against a missing file.

Review powered by cora-cli · BYOK · MIT

- Remove 'invocation' from runs root (not allowed by GitHub validator)
- Remove 'helpUri: null' from rules (must be string or omitted)
- Add 'artifactChanges' to fixes (SARIF 2.1.0 required property)
- Deduplicate rules by id
- Remove unused chrono::Utc import
- Upgrade CodeQL upload action v3 → v4
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Comment thread .github/workflows/ci.yml
- uses: Swatinem/rust-cache@v2

- name: Fetch LLM secrets from Infisical
uses: Infisical/secrets-action@v1.0.9
Comment thread .github/workflows/ci.yml
- name: Run cora review
run: |
cargo build --release
echo "=== CORA REVIEW (SARIF) ===" >> $GITHUB_STEP_SUMMARY
Comment thread .github/workflows/ci.yml
- name: Run cora review
run: |
cargo build --release
echo "=== CORA REVIEW (SARIF) ===" >> $GITHUB_STEP_SUMMARY
Comment thread .github/workflows/ci.yml
- name: Run cora review
run: |
cargo build --release
echo "=== CORA REVIEW (SARIF) ===" >> $GITHUB_STEP_SUMMARY
@ajianaz ajianaz merged commit c6eeb2f into develop May 30, 2026
8 of 9 checks passed
@ajianaz ajianaz deleted the feat/ci-cora-review branch May 30, 2026 12:49
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.

2 participants