Skip to content

ci(qodo): adopt reusable OSS pr-agent review lane - #24

Merged
yakimoto merged 2 commits into
mainfrom
qodo/oss-ci
Aug 14, 2026
Merged

ci(qodo): adopt reusable OSS pr-agent review lane#24
yakimoto merged 2 commits into
mainfrom
qodo/oss-ci

Conversation

@yakimoto

@yakimoto yakimoto commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Fleet rollout of the OSS Qodo Merge lane (wave-foundation reusable workflow, OPENAI_KEY secret, auto review+improve with committable suggestions). Reference impl + rationale: wave-gateway#923 + qodo-trial memo. Auto-approve labeled, auto-merge armed.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

Low Risk
CI-only addition with no application code changes; requires OPENAI_KEY to be configured in repo secrets for the job to succeed.

Overview
Adds .github/workflows/pr-agent.yml, a caller workflow that delegates PR review to the fleet wave-foundation reusable reusable-pr-agent.yml lane (pinned at commit 150ffae24f63e207ab81430fa64cb2b1e5c01546), using OSS Qodo Merge with the repo OPENAI_KEY secret.

Triggers on PR lifecycle events (opened, reopened, ready_for_review, synchronize) and new issue comments; grants issues and pull-requests write plus contents read, with per-PR/issue concurrency and cancel-in-progress so overlapping runs don’t stack.

Reviewed by Cursor Bugbot for commit 64315de. Bugbot is set up for automated code reviews on this repo. Configure here.


Open in Devin Review

Review in cubic

@yakimoto yakimoto added the auto-approve Opts a maintainer PR into the reviewbot auto-approve circuit breaker label Aug 14, 2026
@yakimoto
yakimoto enabled auto-merge August 14, 2026 16:30
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 49 minutes

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

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

How do review limits work?

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

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, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d246981e-bd21-4b0b-8626-ad3ad261d3fc

📥 Commits

Reviewing files that changed from the base of the PR and between 80d078b and 64315de.

📒 Files selected for processing (1)
  • .github/workflows/pr-agent.yml

Comment @coderabbitai help to get the list of available commands.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Public repo cannot call private workflow
    • Inlined the OSS Qodo pr-agent job so this public repo no longer calls the private wave-foundation reusable workflow (same 0-jobs failure mode as foundation-gate).

Create PR

Or push these changes by commenting:

@cursor push 4216f82dd6
Preview (4216f82dd6)
diff --git a/.github/workflows/pr-agent.yml b/.github/workflows/pr-agent.yml
--- a/.github/workflows/pr-agent.yml
+++ b/.github/workflows/pr-agent.yml
@@ -1,6 +1,10 @@
-# pr-agent (OSS) caller — adopts the wave-foundation reusable lane.
-# Engine: OSS Qodo Merge on our OPENAI_KEY (trial-independent). SSOT:
-# wave-foundation/.github/workflows/reusable-pr-agent.yml
+# pr-agent (OSS) — inlined Qodo Merge lane (OPENAI_KEY, trial-independent).
+#
+# WHY INLINED: this repo is PUBLIC; wave-av/wave-foundation is PRIVATE. GitHub Actions does
+# NOT permit a public repo to consume a private repo's reusable workflow — the call fails in
+# 0s with 0 jobs (workflow_run never starts). This mirrors the intent of
+# wave-foundation/.github/workflows/reusable-pr-agent.yml (auto review+improve with
+# committable suggestions). Keep in sync when the foundation lane changes.
 name: pr-agent (OSS)
 on:
   pull_request:
@@ -19,6 +23,21 @@
 
 jobs:
   pr_agent:
-    uses: wave-av/wave-foundation/.github/workflows/reusable-pr-agent.yml@main
-    secrets:
-      OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
+    if: ${{ github.event.sender.type != 'Bot' }}
+    runs-on: ubuntu-latest
+    permissions:
+      issues: write
+      pull-requests: write
+      contents: write
+    name: Run pr agent on every pull request, respond to user comments
+    steps:
+      - name: PR Agent action step
+        id: pragent
+        uses: qodo-ai/pr-agent@f6af7d77554ff8d26adffded077e6461329e92fa # v0.42.0
+        env:
+          OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          github_action_config.auto_review: "true"
+          github_action_config.auto_improve: "true"
+          github_action_config.handle_push_trigger: "true"
+          pr_code_suggestions.commitable_code_suggestions: "true"

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit f946618. Configure here.

Comment thread .github/workflows/pr-agent.yml Outdated

jobs:
pr_agent:
uses: wave-av/wave-foundation/.github/workflows/reusable-pr-agent.yml@main

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Public repo cannot call private workflow

High Severity

This public repo calls wave-av/wave-foundation/.github/workflows/reusable-pr-agent.yml, but GitHub Actions cannot consume a private reusable workflow from a public repository. The job fails immediately with zero jobs, so the Qodo review lane never runs.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f946618. Configure here.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Adopt wave-foundation reusable OSS pr-agent review workflow

⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Add a GitHub Actions workflow that triggers OSS pr-agent on PR and comment events
• Reuse the wave-foundation pr-agent lane to standardize auto review/improve behavior
• Wire the OPENAI_KEY secret and set concurrency/permissions for safe execution
Diagram

graph TD
  evt["PR / comment event"] --> caller[".github/workflows/pr-agent.yml"] --> reusable["wave-foundation reusable-pr-agent.yml"] --> openai["OpenAI (via OPENAI_KEY)"]
  caller --> secret["GitHub secret: OPENAI_KEY"] --> reusable
  reusable --> gh["GitHub PR/Issues APIs (comments, reviews)"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Pin reusable workflow to a tag/SHA (instead of @main)
  • ➕ Reduces supply-chain risk from upstream changes
  • ➕ Improves reproducibility and auditability of CI behavior
  • ➖ Requires periodic manual bumping to receive updates/fixes
2. Vendor the reusable workflow into this repo
  • ➕ Full control over behavior and change cadence
  • ➕ No dependency on external repo availability
  • ➖ Higher maintenance burden; forks the SSOT lane
  • ➖ Harder to keep consistent across fleet
3. Use a GitHub App / marketplace integration for PR reviews
  • ➕ Centralized policy and credential handling outside CI
  • ➕ Potentially better permissions/least-privilege model
  • ➖ Operational overhead (app management, installations)
  • ➖ Less transparent execution compared to Actions logs

Recommendation: Keep the reusable workflow approach (good standardization and low maintenance), but strongly consider pinning uses: ...@main to a version tag or commit SHA for security and determinism. Also re-validate least-privilege permissions for the reusable lane and ensure OPENAI_KEY scope/rotation aligns with org policy.

Files changed (1) +24 / -0

Other (1) +24 / -0
pr-agent.ymlAdd pr-agent OSS caller workflow using wave-foundation reusable lane +24/-0

Add pr-agent OSS caller workflow using wave-foundation reusable lane

• Introduces a new GitHub Actions workflow that triggers on PR lifecycle events and issue comments, then delegates execution to 'wave-av/wave-foundation'’s reusable pr-agent workflow. Configures write permissions for issues/PRs, sets concurrency to avoid duplicate runs, and passes 'OPENAI_KEY' from repo secrets.

.github/workflows/pr-agent.yml

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 6 potential issues.

Open in Devin Review

Comment on lines +21 to +24
pr_agent:
uses: wave-av/wave-foundation/.github/workflows/reusable-pr-agent.yml@main
secrets:
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}

@devin-ai-integration devin-ai-integration Bot Aug 14, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 New review automation workflow can never run in this public repository

The new automation is wired to a helper workflow that lives in a private repository (uses: wave-av/wave-foundation/...@main at .github/workflows/pr-agent.yml:22), which this public repository is not permitted to load, so the automation silently does nothing on every pull request.
Impact: The PR review bot never comments; runs finish instantly with no jobs and no error visible to authors.

Why the cross-repo call fails: public repo consuming a private reusable workflow

.github/workflows/foundation-gate.yml:1-10 documents this exact constraint for this repo: "this repo is PUBLIC; wave-av/wave-foundation is PRIVATE. GitHub Actions does NOT permit a public repo to consume a private repo's reusable workflow — the call fails in 0s with 0 jobs". That is why checks.yml was inlined as .github/workflows/_checks.yml. The new pr-agent.yml reintroduces the private cross-repo uses: pattern, so it will hit the same failure mode. Options: inline the lane locally (as done for the gate), or make the reusable workflow's repo public/internal.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread .github/workflows/pr-agent.yml Outdated
Comment on lines +8 to +9
issue_comment:
types: [created]

@devin-ai-integration devin-ai-integration Bot Aug 14, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 issue_comment trigger fires on plain issues too, with no guard

The issue_comment: [created] trigger fires for comments on regular issues, not just pull requests. There is no if: condition (e.g. github.event.issue.pull_request) to limit the job to PR comments, so every comment on any issue in this repo starts a run of the reusable lane. Whether that is harmless depends entirely on guards inside wave-av/wave-foundation/.github/workflows/reusable-pr-agent.yml@150ffae, which is not visible in this repo — worth confirming that the reusable workflow itself short-circuits non-PR comments (and bot-authored comments), otherwise consider adding the guard here.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +11 to +14
permissions:
issues: write
pull-requests: write
contents: read

@devin-ai-integration devin-ai-integration Bot Aug 14, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Caller permissions rely on the reusable workflow's needs matching

Top-level permissions (issues/pull-requests write, contents read) are the effective ceiling for the called workflow; unlike .github/workflows/issue-ops-triage.yml:13-15 no job-level permissions block is declared here. This works only if the reusable lane needs no additional scopes (e.g. contents: write for suggested-commit features). Worth verifying against wave-foundation/.github/workflows/reusable-pr-agent.yml.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread .github/workflows/pr-agent.yml
Comment thread .github/workflows/pr-agent.yml
@qodo-code-review

qodo-code-review Bot commented Aug 14, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Ungated secret-backed comment runs 🐞 Bug ⛨ Security
Description
Any issue_comment creation triggers this workflow and supplies OPENAI_KEY to the called job,
with no caller-side gating on comment content or author trust. This enables unauthorized triggering
of secret-backed runs (cost/abuse risk) and increases the blast radius if the called workflow
mishandles untrusted inputs.
Code

.github/workflows/pr-agent.yml[R23-24]

+    secrets:
+      OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
Evidence
The workflow is explicitly configured to run on any created issue comment and to pass OPENAI_KEY
into the job, with no additional conditional logic shown.

.github/workflows/pr-agent.yml[8-9]
.github/workflows/pr-agent.yml[23-24]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The workflow triggers on every `issue_comment` and passes `OPENAI_KEY` into the reusable workflow without any restrictions. This allows untrusted users (anyone who can comment) to trigger secret-backed runs.

### Issue Context
Even if the reusable workflow has internal checks, caller-side gating is a key defense-in-depth control because the secret is being provided by the caller.

### Fix Focus Areas
- .github/workflows/pr-agent.yml[8-9]
- .github/workflows/pr-agent.yml[20-24]

### Suggested change
Add a job-level `if:` (or split workflows) to restrict execution to intended, trusted invocations, e.g.:
- Only run on PR comments: `github.event.issue.pull_request != null`
- Only run on an explicit command prefix in the comment body (e.g. `/pr-agent`)
- Only allow trusted actors: `github.event.comment.author_association` in `OWNER|MEMBER|COLLABORATOR`
Optionally, avoid providing `OPENAI_KEY` on comment-triggered runs unless the above checks pass.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Unpinned workflow reference ✓ Resolved 🐞 Bug ⛨ Security
Description
The workflow calls an external reusable workflow pinned to the mutable @main ref, so upstream
changes can silently change CI behavior and how OPENAI_KEY is handled. This is a
supply-chain/reproducibility risk and can become a secret-handling risk because a secret is
explicitly passed to the called workflow.
Code

.github/workflows/pr-agent.yml[R22-24]

+    uses: wave-av/wave-foundation/.github/workflows/reusable-pr-agent.yml@main
+    secrets:
+      OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
Evidence
The new workflow uses a mutable branch ref for an external reusable workflow and passes a secret
into it, which directly creates the supply-chain and reproducibility risk described.

.github/workflows/pr-agent.yml[22-24]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The reusable workflow is referenced as `...@main`, which is mutable. This makes runs non-reproducible and introduces supply-chain risk, especially since `OPENAI_KEY` is passed into the reusable workflow.

### Issue Context
GitHub Actions `uses: owner/repo/path@ref` should be pinned to an immutable ref (commit SHA, or a tag that is managed carefully) to prevent unexpected behavior changes.

### Fix Focus Areas
- .github/workflows/pr-agent.yml[22-24]

### Suggested change
- Replace `@main` with a full commit SHA (preferred), or a stable, versioned tag.
- Establish a reviewed process to bump the SHA/tag when you want updates.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Triggers on issue comments 🐞 Bug ➹ Performance
Description
issue_comment events fire for both PRs and regular issues, and this workflow has no filter to
ensure it only runs for pull request comments. As a result, ordinary issue comments will also invoke
the PR-agent lane, creating unnecessary runs and noise.
Code

.github/workflows/pr-agent.yml[R8-9]

+  issue_comment:
+    types: [created]
Evidence
The workflow subscribes to issue_comment: created with no PR-only filter, so GitHub will trigger
it for comments on regular issues too.

.github/workflows/pr-agent.yml[8-9]
.github/workflows/pr-agent.yml[20-24]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The workflow runs for comments on non-PR issues as well as PRs.

### Issue Context
`on: issue_comment` includes both issue and PR comments; PR comments are those where `github.event.issue.pull_request` is non-null.

### Fix Focus Areas
- .github/workflows/pr-agent.yml[8-9]
- .github/workflows/pr-agent.yml[20-24]

### Suggested change
Add a job-level condition such as:
- `if: github.event_name != 'issue_comment' || github.event.issue.pull_request != null`
Or split into separate workflows so only PR comments trigger the agent.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context
✅ Compliance rules (platform): 2 rules
✅ REVIEW.md
Review mode: ⚖️ Balanced: This CI workflow changes permissions, exposes an OPENAI_KEY to an external reusable workflow, and enables PR automation/merge behavior, so it warrants a careful single-pass review despite being a small localized diff.

Grey Divider

Tip of the day
💡 Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread .github/workflows/pr-agent.yml Outdated
Comment on lines +23 to +24
secrets:
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Ungated secret-backed comment runs 🐞 Bug ⛨ Security

Any issue_comment creation triggers this workflow and supplies OPENAI_KEY to the called job,
with no caller-side gating on comment content or author trust. This enables unauthorized triggering
of secret-backed runs (cost/abuse risk) and increases the blast radius if the called workflow
mishandles untrusted inputs.
Agent Prompt
### Issue description
The workflow triggers on every `issue_comment` and passes `OPENAI_KEY` into the reusable workflow without any restrictions. This allows untrusted users (anyone who can comment) to trigger secret-backed runs.

### Issue Context
Even if the reusable workflow has internal checks, caller-side gating is a key defense-in-depth control because the secret is being provided by the caller.

### Fix Focus Areas
- .github/workflows/pr-agent.yml[8-9]
- .github/workflows/pr-agent.yml[20-24]

### Suggested change
Add a job-level `if:` (or split workflows) to restrict execution to intended, trusted invocations, e.g.:
- Only run on PR comments: `github.event.issue.pull_request != null`
- Only run on an explicit command prefix in the comment body (e.g. `/pr-agent`)
- Only allow trusted actors: `github.event.comment.author_association` in `OWNER|MEMBER|COLLABORATOR`
Optionally, avoid providing `OPENAI_KEY` on comment-triggered runs unless the above checks pass.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +8 to +9
issue_comment:
types: [created]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

3. Triggers on issue comments 🐞 Bug ➹ Performance

issue_comment events fire for both PRs and regular issues, and this workflow has no filter to
ensure it only runs for pull request comments. As a result, ordinary issue comments will also invoke
the PR-agent lane, creating unnecessary runs and noise.
Agent Prompt
### Issue description
The workflow runs for comments on non-PR issues as well as PRs.

### Issue Context
`on: issue_comment` includes both issue and PR comments; PR comments are those where `github.event.issue.pull_request` is non-null.

### Fix Focus Areas
- .github/workflows/pr-agent.yml[8-9]
- .github/workflows/pr-agent.yml[20-24]

### Suggested change
Add a job-level condition such as:
- `if: github.event_name != 'issue_comment' || github.event.issue.pull_request != null`
Or split into separate workflows so only PR comments trigger the agent.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@qodo-code-review

Copy link
Copy Markdown

Qodo Fixer

✅ Merged (0) · ☑ Fixed (0)

Process

  • No fixes were applied (no_fixes_applied)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Left a non-blocking comment and did not approve; no reviewers were assigned. Cursor Bugbot reported an unresolved high-severity finding (this public repo cannot call the private reusable workflow), so human review is needed.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@macroscopeapp

macroscopeapp Bot commented Aug 14, 2026

Copy link
Copy Markdown

Approvability

Verdict: Needs human review

Multiple reviewers have identified that this workflow cannot run (public repo calling private reusable workflow) and raised security concerns about ungated secret access on issue_comment triggers. These substantive issues warrant human review before merging.

You can customize Macroscope's approvability policy. Learn more.

@yakimoto
yakimoto merged commit 48a14b5 into main Aug 14, 2026
15 checks passed
@yakimoto
yakimoto deleted the qodo/oss-ci branch August 14, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-approve Opts a maintainer PR into the reviewbot auto-approve circuit breaker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant