-
Notifications
You must be signed in to change notification settings - Fork 168
feat: add manual approval for Devin PRs in trigger.dev workflow #2912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add manual approval for Devin PRs in trigger.dev workflow #2912
Conversation
- Add check-pr-author job to detect Devin-created PRs - Use trigger-dev-preview environment for manual approval on Devin PRs - Apply environment protection to both deployment and archival jobs - Preserve automatic deployment for human-created PRs Addresses: https://github.com/route06/liam-internal/issues/5289 Co-Authored-By: hirotaka.miyagi@route06.co.jp <h.miyagi.cnw@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Updates to Preview Branch (devin/1754379458-manual-approval-trigger-dev) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
The archive_preview job only cleans up resources when PRs are closed, so it doesn't need manual approval protection. This job actually helps free up resources rather than consuming them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a manual approval system for trigger.dev deployments on Devin-created PRs to manage concurrent branch deployment limits. The solution uses GitHub Environment protection rules to require manual approval for Devin PRs while preserving automatic deployment for human-created PRs.
- Adds PR author detection to identify Devin-created PRs based on username pattern matching
- Implements conditional environment protection using GitHub Environments for deployment control
- Maintains automatic deployment flow for human-authored PRs
- id: check | ||
run: | | ||
author="${{ github.event.pull_request.user.login }}" | ||
if [[ "$author" == *"devin"* ]] || [[ "$author" == *"Devin"* ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The case-sensitive pattern matching is redundant and could miss other case variations. Consider using a single case-insensitive comparison: if [[ "${author,,}" == *"devin"* ]]; then
where ${author,,}
converts to lowercase.
if [[ "$author" == *"devin"* ]] || [[ "$author" == *"Devin"* ]]; then | |
if [[ "${author,,}" == *"devin"* ]]; then |
Copilot uses AI. Check for mistakes.
Apply Copilot AI's suggestion to use Bash's built-in lowercase conversion syntax. This is more efficient and handles all case variations (DEVIN, DeVin, etc.) in a single check. Co-authored-by: copilot[bot] <58059919+copilot[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NoritakaIkeda Is there currently a way to manually deploy to the trigger.dev environment in Devin's PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
@MH4GF With this PR, preview environments for trigger_dev can be deployed manually when the PR is created by Devin. |
Draft to see how it works around CI approvals |
Issue
Why is this change needed?
trigger.dev has limits on the number of concurrent branch deployments. Since Devin can create many PRs rapidly, we need to prevent automatic trigger.dev deployment for Devin-created PRs to avoid hitting these limits. Human-created PRs should continue to deploy automatically for fast feedback.
What this PR does
This PR implements a manual approval system for trigger.dev deployments on Devin-created PRs using GitHub Environment protection rules:
check-pr-author
job detects if the PR author's username contains "devin" (case-insensitive)trigger_dev
andarchive_preview
jobs now conditionally use thetrigger-dev-preview
environment for Devin PRsImplementation details
Key changes to
.github/workflows/trigger_dev_preview.yml
:check-pr-author
job with username pattern matchingtrigger_dev
job to include conditionalenvironment
fieldarchive_preview
job to include same conditional environment protectioncheck-pr-author
job outputManual setup required
trigger-dev-preview
in GitHub repository settingsWithout this setup, Devin PRs will fail when trying to use the non-existent environment.
Human review checklist
*devin*
case-insensitive matching correctly identify all Devin accounts?${{ condition && 'value' || '' }}
works as expectedgithub.event.pull_request.user.login
is null/undefinedTesting notes
This change cannot be fully tested until:
Link to Devin run: https://app.devin.ai/sessions/b743693f3e684b3ab729dbc4d46b1ed2
Requested by: @MH4GF