Skip to content

Commit

Permalink
test: edit config for demo
Browse files Browse the repository at this point in the history
  • Loading branch information
aeddi committed Nov 6, 2024
1 parent 1db215c commit 0e21aa6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 9 deletions.
2 changes: 1 addition & 1 deletion comment.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The following requirements must be fulfilled before a pull request can be merged.
Some requirement checks are automated and can be verified by the CI, while others need manual verification by a staff member.

These requirements are defined in this [config file](./contribs/github-bot/config.go).
These requirements are defined in this [config file](https://github.com/GnoCheckBot/demo/blob/main/config.go).

## Automated Checks

Expand Down
44 changes: 36 additions & 8 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,21 @@ type manualCheck struct {
func config(gh *client.GitHub) ([]automaticCheck, []manualCheck) {
auto := []automaticCheck{
{
Description: "Changes on 'tm2' folder should be reviewed/authored by at least one member of both EU and US teams",
Description: "Changes on 'foo' file should be reviewed by at least one [Bot PR](https://github.com/GnoCheckBot/demo/pull/1) reviewer",
If: c.And(
c.FileChanged(gh, "tm2"),
c.BaseBranch("main"),
c.Or(
c.FileChanged(gh, "foo"),
c.FileChanged(gh, "bar"),
c.FileChanged(gh, "baz"),
),
),
Then: r.And(
r.Author("aeddi"),
r.Or(
r.ReviewByTeamMembers(gh, "eu", 1),
r.AuthorInTeam(gh, "eu"),
),
r.Or(
r.ReviewByTeamMembers(gh, "us", 1),
r.AuthorInTeam(gh, "us"),
r.ReviewByUser(gh, "thehowl"),
r.ReviewByUser(gh, "ltzmaxwell"),
r.ReviewByUser(gh, "zivkovicmilos"),
),
),
},
Expand All @@ -47,9 +49,35 @@ func config(gh *client.GitHub) ([]automaticCheck, []manualCheck) {
If: c.Always(), // Or only if c.BaseBranch("main") ?
Then: r.UpToDateWith(gh, r.PR_BASE),
},
{
Description: "Label bug is applied for no other reason than testing",
If: c.HeadBranch("demo-pr"),
Then: r.Label(gh, "bug"),
},
}

manual := []manualCheck{
{
Description: "Demo manual check",
If: c.Always(),
},
{
Description: "Demo manual check with lot of (useless) details",
If: c.Or(
c.Always(),
c.And(
c.Label("bug"),
c.BaseBranch("main"),
c.Or(
c.FileChanged(gh, "misc/deployments"),
c.FileChanged(gh, `misc/docker-\.*`),
c.FileChanged(gh, "tm2/pkg/p2p"),
c.FileChanged(gh, "contribs"),
),
),
),
Teams: []string{"foo", "bar", "baz"},
},
{
Description: "Determine if infra needs to be updated",
If: c.And(
Expand Down

0 comments on commit 0e21aa6

Please sign in to comment.