Skip to content

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

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

ci(qodo): adopt reusable OSS pr-agent review lane#28
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 standard PR-bot permissions; no application or runtime code changes.

Overview
Adds a new GitHub Actions workflow that wires sdk-python into the fleet OSS Qodo Merge lane via the pinned wave-foundation reusable workflow (reusable-pr-agent.yml at SHA 150ffae…).

The caller runs on PR lifecycle events (opened, reopened, ready_for_review, synchronize) and new issue comments, grants issues / pull-requests write plus contents read, and uses per-PR concurrency with cancel-in-progress. It forwards OPENAI_KEY from repo secrets into the reusable job so review/improve runs on the org’s OpenAI key rather than a Qodo trial.

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

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: 50 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: b09886a6-0662-49f6-90af-a7048036f3c8

📥 Commits

Reviewing files that changed from the base of the PR and between 0e79241 and 40229a8.

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

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

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Adopt wave-foundation reusable pr-agent (OSS Qodo Merge) review lane

⚙️ Configuration changes ✨ Enhancement 🕐 Less than 10 minutes

Grey Divider

AI Description

• Add a PR/comment-triggered GitHub Actions workflow to run OSS pr-agent review lane.
• Delegate execution to wave-foundation reusable workflow and pass OPENAI_KEY secret.
• Enable safe concurrency cancellation to avoid overlapping agent runs per PR/issue.
Diagram

graph TD
  A["GitHub PR / comment events"] --> B["pr-agent.yml (caller)"] --> C["wave-foundation reusable workflow"] --> D{{"OpenAI API (via OPENAI_KEY)"}}
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Pin reusable workflow to a tag/SHA
  • ➕ Eliminates surprise behavior changes from upstream main branch updates
  • ➕ Improves auditability and incident rollback
  • ➖ Requires periodic bump process to pick up fixes/features
2. Vendor the reusable workflow into this repo
  • ➕ Full control over behavior and change cadence
  • ➕ No dependency on external repo availability/permissions
  • ➖ Forked maintenance burden; drift from upstream improvements
3. Use a GitHub App / bot integration instead of Actions reusable workflow
  • ➕ Centralized management across repos; less per-repo YAML
  • ➕ Potentially richer policy controls and observability
  • ➖ Higher setup/ops overhead; different security and permission model

Recommendation: Current reusable-workflow approach is good for fleet rollout and standardization. The main improvement to consider is pinning the reusable workflow reference to a tag or commit SHA (instead of @main) to reduce supply-chain and change-control risk while preserving the shared-lane benefits.

Files changed (1) +24 / -0

Other (1) +24 / -0
pr-agent.ymlAdd reusable pr-agent (OSS) workflow caller with concurrency + OPENAI_KEY +24/-0

Add reusable pr-agent (OSS) workflow caller with concurrency + OPENAI_KEY

• Introduces a new GitHub Actions workflow triggered by pull_request and issue_comment events. Configures required write permissions (issues/PRs) and per-PR/issue concurrency cancellation, then delegates execution to wave-foundation’s reusable pr-agent workflow while passing OPENAI_KEY from repository secrets.

.github/workflows/pr-agent.yml

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.

🔒 Agentic Security Review
Severity: HIGH
The workflow invokes a reusable workflow using a mutable ref (@main) while also granting write-scoped token permissions and passing OPENAI_KEY. This crosses a trust boundary without integrity pinning: any compromised or unintended upstream main change would execute here automatically under this repository’s credentials.
Impact: Upstream compromise or malicious change can lead to unauthorized PR/issue mutations and secret misuse from this repository’s CI context.

Fix in Cursor Fix in Web

Reviewed by Cursor Security Reviewer for commit 15a0a72. Configure here.

@qodo-code-review

qodo-code-review Bot commented Aug 14, 2026

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. Untrusted comment-triggered secret run 🐞 Bug ⛨ Security
Description
The workflow runs on issue_comment and forwards OPENAI_KEY with write-capable permissions, but
has no guard restricting execution to PR comments and trusted actor associations. This creates a
risky privilege boundary where untrusted commenters can invoke a privileged reusable workflow run
with a sensitive secret available in its environment.
Code

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

+on:
+  pull_request:
+    types: [opened, reopened, ready_for_review, synchronize]
+  issue_comment:
+    types: [created]
Evidence
The workflow is explicitly triggered by issue_comment and forwards a sensitive secret to an
externally-defined reusable workflow while granting write permissions; there is no conditional
gating in the caller workflow to limit this behavior to PR-only comments or trusted actors.

.github/workflows/pr-agent.yml[5-14]
.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
`.github/workflows/pr-agent.yml` triggers on `issue_comment` and passes `OPENAI_KEY` while granting write permissions. Without an explicit guard, any issue comment (including on non-PR issues) and potentially untrusted PR comment activity can invoke the privileged workflow run.

### Issue Context
This workflow is intended to act on PRs, but `issue_comment` is emitted for both Issues and PRs. The job should only run when the comment is on a PR **and** the commenter is trusted (e.g., MEMBER/OWNER/COLLABORATOR), or behind an explicit maintainer-only command pattern.

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

### Suggested change
Add a job-level `if:` that:
1) ensures `issue_comment` is only accepted when `github.event.issue.pull_request` is present, and
2) restricts the actor association to trusted roles.

Example (adjust policy as desired):
```yaml
jobs:
 pr_agent:
   if: >-
     github.event_name == 'pull_request' ||
     (github.event_name == 'issue_comment' &&
      github.event.issue.pull_request &&
      contains(fromJson('["MEMBER","OWNER","COLLABORATOR"]'), github.event.comment.author_association))
   uses: ...
```
Optionally also restrict by comment content (e.g., only run when comment starts with `/pr-agent`).

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


2. Unpinned reusable workflow ✓ Resolved 🐞 Bug ⛨ Security
Description
The workflow calls wave-av/wave-foundation/.github/workflows/reusable-pr-agent.yml@main, which is
a mutable reference that can change out-of-band and alter CI behavior unexpectedly. Because
OPENAI_KEY is forwarded into that workflow, this also increases supply-chain exposure if the
referenced branch ever changes in an unsafe way.
Code

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

+  pr_agent:
+    uses: wave-av/wave-foundation/.github/workflows/reusable-pr-agent.yml@main
+    secrets:
+      OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
Evidence
pr-agent.yml uses a mutable @main reference while passing OPENAI_KEY. Another workflow in this
repo (issue-ops-triage) demonstrates the expected pattern of pinning wave-foundation reusable
workflows to a specific commit SHA.

.github/workflows/pr-agent.yml[20-24]
.github/workflows/issue-ops-triage.yml[12-20]

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 via `@main` which is mutable. This makes runs non-reproducible and allows behavior to change without a PR in this repo.

### Issue Context
This repo already demonstrates pinning external reusable workflows to an immutable commit SHA.

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

### Suggested change
Replace:
```yaml
uses: wave-av/wave-foundation/.github/workflows/reusable-pr-agent.yml@main
```
with a commit SHA (preferred) or immutable tag, e.g.:
```yaml
uses: wave-av/wave-foundation/.github/workflows/reusable-pr-agent.yml@<full_commit_sha>
```
Then update the SHA through reviewed PRs when you intentionally upgrade the lane.

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


Grey Divider

Context
Review mode: ⚖️ Balanced: This adds a runtime CI workflow with write permissions, reusable workflow execution, secret forwarding, and auto-review/merge behavior; the change is localized but security- and automation-sensitive.

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 on lines +5 to +9
on:
pull_request:
types: [opened, reopened, ready_for_review, synchronize]
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.

Action required

1. Untrusted comment-triggered secret run 🐞 Bug ⛨ Security

The workflow runs on issue_comment and forwards OPENAI_KEY with write-capable permissions, but
has no guard restricting execution to PR comments and trusted actor associations. This creates a
risky privilege boundary where untrusted commenters can invoke a privileged reusable workflow run
with a sensitive secret available in its environment.
Agent Prompt
### Issue description
`.github/workflows/pr-agent.yml` triggers on `issue_comment` and passes `OPENAI_KEY` while granting write permissions. Without an explicit guard, any issue comment (including on non-PR issues) and potentially untrusted PR comment activity can invoke the privileged workflow run.

### Issue Context
This workflow is intended to act on PRs, but `issue_comment` is emitted for both Issues and PRs. The job should only run when the comment is on a PR **and** the commenter is trusted (e.g., MEMBER/OWNER/COLLABORATOR), or behind an explicit maintainer-only command pattern.

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

### Suggested change
Add a job-level `if:` that:
1) ensures `issue_comment` is only accepted when `github.event.issue.pull_request` is present, and
2) restricts the actor association to trusted roles.

Example (adjust policy as desired):
```yaml
jobs:
  pr_agent:
    if: >-
      github.event_name == 'pull_request' ||
      (github.event_name == 'issue_comment' &&
       github.event.issue.pull_request &&
       contains(fromJson('["MEMBER","OWNER","COLLABORATOR"]'), github.event.comment.author_association))
    uses: ...
```
Optionally also restrict by comment content (e.g., only run when comment starts with `/pr-agent`).

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

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

Copy link
Copy Markdown

Qodo Fixer

✅ Merged (0) · ☑ Fixed (0)

Process

  • ⏭ Skipped (1)

@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: Private reusable workflow cannot run
    • Replaced the private wave-foundation reusable workflow call with an inlined qodo-ai/pr-agent job so the public repo can run review/improve.

Create PR

Or push these changes by commenting:

@cursor push 460f413399
Preview (460f413399)
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,9 @@
-# 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 lane (cannot consume private wave-foundation reusable).
+# Engine: OSS Qodo Merge on our OPENAI_KEY (trial-independent).
+#
+# WHY INLINED: sdk-python 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 (same constraint documented in foundation-gate.yml).
 name: pr-agent (OSS)
 on:
   pull_request:
@@ -19,6 +22,15 @@
 
 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
+    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"
+          pr_code_suggestions.commitable_code_suggestions: "true"

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

Reviewed by Cursor Bugbot for commit 15a0a72. 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.

Private reusable workflow cannot run

High Severity

The pr_agent job calls reusable-pr-agent.yml in private wave-av/wave-foundation. This repository is public, and GitHub Actions cannot resolve a private reusable workflow from a public caller, so the job never starts and review plus improve comments will not run.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 15a0a72. Configure here.

@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: high. Left a non-blocking comment; Bugbot and Security Agent both reported unresolved high-severity findings on this CI workflow, which is above the medium approval threshold. Human review is needed; no reviewers were assigned.

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

Unresolved review comments raise legitimate security concerns about the issue_comment trigger lacking guards to restrict execution to trusted actors, potentially allowing untrusted commenters to invoke a privileged workflow with access to OPENAI_KEY.

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

@yakimoto
yakimoto merged commit d90796c into main Aug 14, 2026
18 checks passed
@yakimoto
yakimoto deleted the qodo/oss-ci branch August 14, 2026 17:18
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