Skip to content

Commit a984cfe

Browse files
authored
Add GitHub branch ruleset for Rust (#320)
This is actually starting to mix up thing s bit, as this repository is supposed to only target Python projects, but since it is already a mess mixing up **a lot** of things, we might as well keep using it as a catch-all until we properly split it up.
2 parents 0adfc17 + bcd8412 commit a984cfe

File tree

5 files changed

+68
-35
lines changed

5 files changed

+68
-35
lines changed

RELEASE_NOTES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
## Upgrading
88

99
- The `frequenz.repo.config.github.abort()` function now takes most arguments as keyword-only arguments.
10+
- The *Queue PRs for v0.x.x* GitHub ruleset was renamed to *Queue PRs for the default branch* and now targets the default branch. It also only have the merge queue restriction, all other restrictions were removed as they are already present in the *Protect version branches* ruleset. You might want to re-import this ruleset to your repositories.
1011

1112
### Cookiecutter template
1213

1314
<!-- Here upgrade steps for cookiecutter specifically -->
1415

1516
## New Features
1617

17-
<!-- Here goes the main new features and examples or instructions on how to use them -->
18+
* Added a new GitHub branch ruleset for Rust projects.
1819

1920
### Cookiecutter template
2021

docs/user-guide/start-a-new-project/configure-github.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,18 @@ Import the following
9898
gh-pages]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/Disallow removal and force-pushes of gh-pages.json)
9999
* [Protect released
100100
tags]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/Protect released tags.json)
101+
* [Queue PRs for the default
102+
branch]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/Queue PRs for the default branch.json)
103+
104+
##### Python specific rulesets
105+
106+
* [Protect version
107+
branches]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/python/Protect version branches.json)
108+
109+
##### Rust specific rulesets
110+
101111
* [Protect version
102-
branches]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/Protect version branches.json)
103-
* [Queue PRs for
104-
v0.x.x]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/Queue PRs for v0.x.x.json)
112+
branches]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/rust/Protect version branches.json)
105113

106114
### Code security and analysis
107115

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "Queue PRs for the default branch",
3+
"target": "branch",
4+
"source_type": "Repository",
5+
"source": "frequenz-floss/frequenz-repo-config-python",
6+
"enforcement": "active",
7+
"conditions": {
8+
"ref_name": {
9+
"exclude": [],
10+
"include": [
11+
"~DEFAULT_BRANCH"
12+
]
13+
}
14+
},
15+
"rules": [
16+
{
17+
"type": "merge_queue",
18+
"parameters": {
19+
"merge_method": "MERGE",
20+
"max_entries_to_build": 5,
21+
"min_entries_to_merge": 1,
22+
"max_entries_to_merge": 5,
23+
"min_entries_to_merge_wait_minutes": 5,
24+
"grouping_strategy": "ALLGREEN",
25+
"check_response_timeout_minutes": 60
26+
}
27+
}
28+
],
29+
"bypass_actors": [
30+
{
31+
"actor_id": 2,
32+
"actor_type": "RepositoryRole",
33+
"bypass_mode": "pull_request"
34+
},
35+
{
36+
"actor_id": 5,
37+
"actor_type": "RepositoryRole",
38+
"bypass_mode": "always"
39+
},
40+
{
41+
"actor_id": 1,
42+
"actor_type": "OrganizationAdmin",
43+
"bypass_mode": "always"
44+
}
45+
]
46+
}
File renamed without changes.

github-rulesets/Queue PRs for v0.x.x.json renamed to github-rulesets/rust/Protect version branches.json

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "Queue PRs for v0.x.x",
2+
"name": "Protect version branches",
33
"target": "branch",
44
"source_type": "Repository",
55
"source": "frequenz-floss/frequenz-repo-config-python",
@@ -8,7 +8,8 @@
88
"ref_name": {
99
"exclude": [],
1010
"include": [
11-
"refs/heads/v0.x.x"
11+
"~DEFAULT_BRANCH",
12+
"refs/heads/v[0-9]*.[0-9x]*.x"
1213
]
1314
}
1415
},
@@ -22,58 +23,35 @@
2223
{
2324
"type": "pull_request",
2425
"parameters": {
25-
"required_approving_review_count": 1,
26-
"dismiss_stale_reviews_on_push": true,
2726
"require_code_owner_review": true,
2827
"require_last_push_approval": true,
28+
"dismiss_stale_reviews_on_push": true,
29+
"required_approving_review_count": 1,
2930
"required_review_thread_resolution": false
3031
}
3132
},
3233
{
3334
"type": "required_status_checks",
3435
"parameters": {
3536
"strict_required_status_checks_policy": false,
37+
"do_not_enforce_on_create": false,
3638
"required_status_checks": [
3739
{
38-
"context": "Test with nox",
39-
"integration_id": 15368
40-
},
41-
{
42-
"context": "Test documentation website generation",
43-
"integration_id": 15368
44-
},
45-
{
46-
"context": "Test package installation in different architectures",
47-
"integration_id": 15368
48-
},
49-
{
50-
"context": "Cross-arch tests with nox",
51-
"integration_id": 15368
40+
"context": "DCO"
5241
},
5342
{
5443
"context": "Check release notes are updated",
5544
"integration_id": 15368
5645
},
5746
{
58-
"context": "DCO"
47+
"context": "test",
48+
"integration_id": 15368
5949
}
6050
]
6151
}
6252
},
6353
{
6454
"type": "deletion"
65-
},
66-
{
67-
"type": "merge_queue",
68-
"parameters": {
69-
"merge_method": "Merge commit",
70-
"max_entries_to_build": 5,
71-
"min_entries_to_merge": 1,
72-
"max_entries_to_merge": 5,
73-
"min_entries_to_merge_wait_minutes": 5,
74-
"grouping_strategy_all_green": true,
75-
"check_response_timeout_minutes": 60
76-
}
7755
}
7856
],
7957
"bypass_actors": [

0 commit comments

Comments
 (0)