feat: support Cubic feedback workflow for external forked PRs#26910
feat: support Cubic feedback workflow for external forked PRs#26910keithwillcode merged 2 commits intomainfrom
Conversation
Use workflow_run pattern to enable the Cubic AI to Devin review workflow for PRs from external forks. The pull_request_review event doesn't have access to secrets when triggered from forks, so we split into two workflows: 1. cubic-devin-review-trigger.yml - Lightweight workflow that triggers on pull_request_review and saves the review context as an artifact 2. cubic-devin-review.yml - Main workflow that triggers on workflow_run, downloads the artifact, and processes it with full permissions/secrets This follows the same pattern used by on-changes-requested.yml and re-draft.yml. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active. |
| - name: Upload review context | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: cubic-review-context |
There was a problem hiding this comment.
DevinAI do we need to add something specific to the name here to avoid collisions across multiple reviews happening across various PRs?
There was a problem hiding this comment.
You're correct - it will be fine as-is. The artifact is scoped to the specific workflow run ID. When the main workflow downloads the artifact, it uses context.payload.workflow_run.id to fetch artifacts from only that specific trigger run:
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
run_id: context.payload.workflow_run.id, // Specific to this trigger run
});Even if multiple Cubic reviews happen simultaneously on different PRs, each trigger workflow has its own unique run ID, so there's no collision risk. This is the same pattern used by on-changes-requested.yml which also uses a static artifact name (context.json) without any PR-specific suffix.
|
@pumfleet Force merging because the atoms build failing is unrelated and being urgently looked into by engineering to unblock CI. |
Pull request was closed
E2E results are ready! |
What does this PR do?
Updates the "Cubic feedback addressed by Devin" workflow to run for external forked PRs by using the
workflow_runpattern.The
pull_request_reviewevent doesn't have access to secrets when triggered from forks (GitHub security feature). This PR splits the workflow into two parts:pull_request_reviewand saves the review context (PR number, review body) as an artifactworkflow_runof the first workflow, downloads the artifact, and processes it with full permissions/secrets accessThis follows the same pattern used by
on-changes-requested.ymlandre-draft.ymlin this repo.Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
This workflow change can only be fully tested in production:
Checklist
Human Review Checklist
actions: readpermission is sufficient for downloading artifactsLink to Devin run: https://app.devin.ai/sessions/dcf40a7b8f6444db8542540e4b93b9b8
Requested by: @keithwillcode