Skip to content

Commit e293621

Browse files
committed
Implemented tree closing and opening
1 parent dd83a79 commit e293621

25 files changed

+480
-739
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
target/
2+
.env

.sqlx/query-36b571f54091ac1caaf1a5fa85081621bd93fdb2edf55689ce0232d48e8c51cd.json

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

.sqlx/query-4ba899ceb5200a74b944f26b4df293d6eaeb7c10e4a9d594b003f04a7f493dc1.json

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

.sqlx/query-87cc4d406832a9957d4f4b7599e1a3aa67b0bcf3dc0438c568031bd93c511876.json

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

.sqlx/query-a7498731ebc2ae95a48c52046eb9377656acd7bb2907000abcbee1c7ce90ad43.json

-15
This file was deleted.

.sqlx/query-7efe43b9bd54cc798a81cfe8c4a1ef396044c382b6f5172fb389175d8ce1346e.json .sqlx/query-ad1e4676b67caa18bd10c4d9e727950e437d538a747b18ecbf1206ef6b148dc9.json

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

.sqlx/query-aaceccc739564492d8424e6951f9c272c88dd4d34199c7ee4346462867029823.json .sqlx/query-c4b0d4ed216c6b8efceb1b65ae0ad9d830e8870cfdf37542a408b99c961318f7.json

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

.sqlx/query-bf90bc08fff5e3cb3c75342b097c60947a857b74ecc21320c94a816090ef04df.json .sqlx/query-f223617621c400f216ecfe415f0bf54a0f8cfb8aecace69b5d53cb888e5c9fa4.json

+4-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- Add down migration script here
2+
DROP TABLE IF EXISTS repository;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-- Add up migration script here
2+
CREATE TABLE repository (
3+
id SERIAL PRIMARY KEY,
4+
name TEXT NOT NULL UNIQUE,
5+
treeclosed INT NULL,
6+
treeclosed_src TEXT,
7+
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
8+
);

migrations/20250307150834_add_rollup_to_pr.down.sql

-2
This file was deleted.

migrations/20250307150834_add_rollup_to_pr.up.sql

-2
This file was deleted.

src/bors/command/mod.rs

+4-43
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
mod parser;
2-
use std::fmt;
3-
use std::str::FromStr;
4-
52
use crate::github::CommitSha;
63
pub use parser::{CommandParseError, CommandParser};
74

@@ -25,42 +22,6 @@ pub enum Approver {
2522
Specified(String),
2623
}
2724

28-
const ROLLUP_VALUES: [&str; 4] = ["always", "iffy", "maybe", "never"];
29-
30-
#[derive(Copy, Clone, Debug, PartialEq)]
31-
pub enum RollupMode {
32-
Always,
33-
Iffy,
34-
Maybe,
35-
Never,
36-
}
37-
38-
impl fmt::Display for RollupMode {
39-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
40-
let s = match self {
41-
RollupMode::Always => "always",
42-
RollupMode::Iffy => "iffy",
43-
RollupMode::Never => "never",
44-
RollupMode::Maybe => "maybe",
45-
};
46-
write!(f, "{}", s)
47-
}
48-
}
49-
50-
impl FromStr for RollupMode {
51-
type Err = ();
52-
53-
fn from_str(s: &str) -> Result<Self, Self::Err> {
54-
match s {
55-
"always" => Ok(RollupMode::Always),
56-
"iffy" => Ok(RollupMode::Iffy),
57-
"never" => Ok(RollupMode::Never),
58-
"maybe" => Ok(RollupMode::Maybe),
59-
_ => Err(()),
60-
}
61-
}
62-
}
63-
6425
/// Bors command specified by a user.
6526
#[derive(Debug, PartialEq)]
6627
pub enum BorsCommand {
@@ -70,8 +31,6 @@ pub enum BorsCommand {
7031
approver: Approver,
7132
/// Priority of the commit.
7233
priority: Option<Priority>,
73-
// Rollup status of the commit.
74-
rollup: Option<RollupMode>,
7534
},
7635
/// Unapprove a commit.
7736
Unapprove,
@@ -94,6 +53,8 @@ pub enum BorsCommand {
9453
Delegate,
9554
/// Revoke any previously granted delegation.
9655
Undelegate,
97-
/// Rollup status.
98-
Rollup(RollupMode),
56+
/// Open the repository tree for merging.
57+
TreeOpen,
58+
/// Set the tree closed with a priority level.
59+
TreeClosed(Priority),
9960
}

0 commit comments

Comments
 (0)