Comments (3)
As you discovered, Policy Bot was designed for overall/merge approval workflows and doesn't support the phased approval (approved for testing vs approved for merge) that your workflow requires. Given the limitations of GitHub Actions and Policy Bot, I don't think you can achieve what you want using only features that are available today.
That said, here's an idea that might work with one new Policy Bot feature:
- Implement the feature requested in #387, which is a way for Policy Bot to leave GitHub reviews instead of only posting status checks. Since this is a feature we don't have a use for internally, I'm not sure my team will have time to implement it, but I think it should be relatively straightforward to add and I'm happy to review a contribution or discuss the implementation.
- For your organization, run two instances of Policy Bot, the "Test" instance and the "Merge" instance
- The "Test" instance looks at a test-specific policy file and leaves an approving review when it is satisfied. You configure the GitHub branch protection and the "Merge" policy to ignore approvals from this app instance. Instead, this approval is the trigger condition for the GitHub Actions workflow.
- The "Merge" instance looks at a merge-specific policy file and approves the PR (either by leaving a review or via status check) when code review is complete and the PR is ready to merge
Running two instances of Policy Bot is awkward, but they can be configured to not conflict and it avoids adding more complicated features.
To achieve what you want with only a single instance, I think we'd have to add significant new features. We don't really have a concept of sub-policies or policies for different actions (the disapproval
policy is an explicit special case) and I don't immediately see a place to hook in logic to leave comments or add labels when certain conditions are met.
from policy-bot.
Another alternative we considered was Mergify, which is free for open-source, but limited on features. I believe the features we needed are not available in the open-source offering.
from policy-bot.
Thanks @bluekeyes for the phenomenally prompt response. That's very helpful! Will discuss with the team what we should do, but the suggestion makes sense. Also, thanks for confirming our suspicion that we would need to deploy two bots for the reasons you mentioned.
from policy-bot.
Related Issues (20)
- If no rule matches can policy-bot not set a failed status on the PR? HOT 1
- Unable to run policy-bot behind a reverse-prxoy HOT 3
- `common.IsActor()` does not actually use `ctx` and can be simplified.
- Condition for not having specific label(s) HOT 6
- has_successful_status causes review requests while PR has draft status HOT 5
- Status check clarification HOT 2
- Feature Request: Predicate to skip rule if a file was changed HOT 6
- Feature Request: Option to count skipped jobs in has_successful_status HOT 5
- Clarify why users are "disqualified" when approval is ignored
- Create new production Release 🚀 HOT 1
- Connecting lines broken when hiding skipped rules with errors
- requires.conditions not working correctly in rule HOT 2
- behavior when using `invalidate_on_push` and `ignore_commits_by`? HOT 2
- Rebase invalidates approval HOT 1
- Concurrent deployments can overwrite statuses unintentionally HOT 1
- Status checks not re-run when used with merge queue HOT 2
- Paths in public_url are removed from OAuth routes
- Re-evaluate policy when PR base branch changes
- has_successful_status may use incorrect check-run HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from policy-bot.