Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub branch ruleset for Rust #320

Merged
merged 4 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
## Upgrading

- The `frequenz.repo.config.github.abort()` function now takes most arguments as keyword-only arguments.
- 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.

### Cookiecutter template

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

## New Features

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

### Cookiecutter template

Expand Down
14 changes: 11 additions & 3 deletions docs/user-guide/start-a-new-project/configure-github.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,18 @@ Import the following
gh-pages]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/Disallow removal and force-pushes of gh-pages.json)
* [Protect released
tags]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/Protect released tags.json)
* [Queue PRs for the default
branch]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/Queue PRs for the default branch.json)

##### Python specific rulesets

* [Protect version
branches]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/python/Protect version branches.json)

##### Rust specific rulesets

* [Protect version
branches]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/Protect version branches.json)
* [Queue PRs for
v0.x.x]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/Queue PRs for v0.x.x.json)
branches]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/rust/Protect version branches.json)

### Code security and analysis

Expand Down
46 changes: 46 additions & 0 deletions github-rulesets/Queue PRs for the default branch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "Queue PRs for the default branch",
"target": "branch",
"source_type": "Repository",
"source": "frequenz-floss/frequenz-repo-config-python",
"enforcement": "active",
"conditions": {
"ref_name": {
"exclude": [],
"include": [
"~DEFAULT_BRANCH"
]
}
},
"rules": [
{
"type": "merge_queue",
"parameters": {
"merge_method": "MERGE",
"max_entries_to_build": 5,
"min_entries_to_merge": 1,
"max_entries_to_merge": 5,
"min_entries_to_merge_wait_minutes": 5,
"grouping_strategy": "ALLGREEN",
"check_response_timeout_minutes": 60
}
}
],
"bypass_actors": [
{
"actor_id": 2,
"actor_type": "RepositoryRole",
"bypass_mode": "pull_request"
},
{
"actor_id": 5,
"actor_type": "RepositoryRole",
"bypass_mode": "always"
},
{
"actor_id": 1,
"actor_type": "OrganizationAdmin",
"bypass_mode": "always"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Queue PRs for v0.x.x",
"name": "Protect version branches",
"target": "branch",
"source_type": "Repository",
"source": "frequenz-floss/frequenz-repo-config-python",
Expand All @@ -8,7 +8,8 @@
"ref_name": {
"exclude": [],
"include": [
"refs/heads/v0.x.x"
"~DEFAULT_BRANCH",
"refs/heads/v[0-9]*.[0-9x]*.x"
]
}
},
Expand All @@ -22,58 +23,35 @@
{
"type": "pull_request",
"parameters": {
"required_approving_review_count": 1,
"dismiss_stale_reviews_on_push": true,
"require_code_owner_review": true,
"require_last_push_approval": true,
"dismiss_stale_reviews_on_push": true,
"required_approving_review_count": 1,
"required_review_thread_resolution": false
}
},
{
"type": "required_status_checks",
"parameters": {
"strict_required_status_checks_policy": false,
"do_not_enforce_on_create": false,
"required_status_checks": [
{
"context": "Test with nox",
"integration_id": 15368
},
{
"context": "Test documentation website generation",
"integration_id": 15368
},
{
"context": "Test package installation in different architectures",
"integration_id": 15368
},
{
"context": "Cross-arch tests with nox",
"integration_id": 15368
"context": "DCO"
},
{
"context": "Check release notes are updated",
"integration_id": 15368
},
{
"context": "DCO"
"context": "test",
"integration_id": 15368
}
]
}
},
{
"type": "deletion"
},
{
"type": "merge_queue",
"parameters": {
"merge_method": "Merge commit",
"max_entries_to_build": 5,
"min_entries_to_merge": 1,
"max_entries_to_merge": 5,
"min_entries_to_merge_wait_minutes": 5,
"grouping_strategy_all_green": true,
"check_response_timeout_minutes": 60
}
}
],
"bypass_actors": [
Expand Down
Loading