Skip to content

Commit af8114d

Browse files
committed
feat: add priority option
add priority alias remove priority=null in unapprove use coalesce for priority on approval use slice instead of full array for parts add more tests add priority as standalone command remove newtype comment no point making Priority newtype add .sqlx files back something wrong with zed rename Priority to SetPriority in BorsCommand add custom error message for negative integers rename command_priority to command_set_priority change permission for setting priority from try to review add helper method for getting default repo add helper for priority validation logic change default priority error message
1 parent c84d981 commit af8114d

19 files changed

+602
-105
lines changed

.sqlx/query-6410d5ac20c9b301fc7b9e639eabc7b82a2a1d01cde48ba01fdc5cd8ce2ce128.json .sqlx/query-491dd6278535e1015a8071f416a56112a153713a71af8d62917e2ff9873ecec1.json

+9-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-667daf4042d6129c923d1f8f6b1b19d263ad3a242cbf60841d1284da702b78ff.json

+15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-9531efa35aabadfb04c06f23375eafe1c8f10444e706940fa0f20a50b824044d.json .sqlx/query-67511f5f15c07537d3d4f2d011abedd2173ab301e8a06c740b587738b140795a.json

+9-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-7a9718cb973d09f68a6854a4fb08871f29d60b8617caf94dfa439f9ef8453caa.json

-15
This file was deleted.

.sqlx/query-ad1e4676b67caa18bd10c4d9e727950e437d538a747b18ecbf1206ef6b148dc9.json

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/commands.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ which is by default set to `@bors`.
88
| `try` | `try` | Start a try build based on the most recent commit from the main branch. |
99
| `try parent=<sha>` | `try` | Start a try build based on the specified parent commit `sha`. |
1010
| `try cancel` | `try` | Cancel a running try build. |
11+
| `p=<priority>` | `try` | Set the priority of a PR. |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- Add down migration script here
2+
ALTER TABLE pull_request DROP COLUMN priority;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- Add up migration script here
2+
ALTER TABLE pull_request ADD COLUMN priority INT;

src/bors/command/mod.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ mod parser;
22
use crate::github::CommitSha;
33
pub use parser::{CommandParseError, CommandParser};
44

5+
/// Priority of a commit.
6+
pub type Priority = u32;
7+
58
/// Type of parent allowed in a try build
69
#[derive(Clone, Debug, PartialEq)]
710
pub enum Parent {
@@ -23,10 +26,15 @@ pub enum Approver {
2326
#[derive(Debug, PartialEq)]
2427
pub enum BorsCommand {
2528
/// Approve a commit.
26-
Approve(Approver),
29+
Approve {
30+
/// Who is approving the commit.
31+
approver: Approver,
32+
/// Priority of the commit.
33+
priority: Option<Priority>,
34+
},
2735
/// Unapprove a commit.
2836
Unapprove,
29-
/// Print help
37+
/// Print help.
3038
Help,
3139
/// Ping the bot.
3240
Ping,
@@ -39,4 +47,6 @@ pub enum BorsCommand {
3947
},
4048
/// Cancel a try build.
4149
TryCancel,
50+
/// Set the priority of a commit.
51+
SetPriority(Priority),
4252
}

0 commit comments

Comments
 (0)