diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 1b81fd7b..0d5a2e91 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -7,6 +7,7 @@ ## 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 @@ -14,7 +15,7 @@ ## New Features - +* Added a new GitHub branch ruleset for Rust projects. ### Cookiecutter template diff --git a/docs/user-guide/start-a-new-project/configure-github.md b/docs/user-guide/start-a-new-project/configure-github.md index fa948cd2..b0d2c84c 100644 --- a/docs/user-guide/start-a-new-project/configure-github.md +++ b/docs/user-guide/start-a-new-project/configure-github.md @@ -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 diff --git a/github-rulesets/Queue PRs for the default branch.json b/github-rulesets/Queue PRs for the default branch.json new file mode 100644 index 00000000..cfa5efa9 --- /dev/null +++ b/github-rulesets/Queue PRs for the default branch.json @@ -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" + } + ] +} diff --git a/github-rulesets/Protect version branches.json b/github-rulesets/python/Protect version branches.json similarity index 100% rename from github-rulesets/Protect version branches.json rename to github-rulesets/python/Protect version branches.json diff --git a/github-rulesets/Queue PRs for v0.x.x.json b/github-rulesets/rust/Protect version branches.json similarity index 63% rename from github-rulesets/Queue PRs for v0.x.x.json rename to github-rulesets/rust/Protect version branches.json index 64f46661..75d6dc04 100644 --- a/github-rulesets/Queue PRs for v0.x.x.json +++ b/github-rulesets/rust/Protect version branches.json @@ -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", @@ -8,7 +8,8 @@ "ref_name": { "exclude": [], "include": [ - "refs/heads/v0.x.x" + "~DEFAULT_BRANCH", + "refs/heads/v[0-9]*.[0-9x]*.x" ] } }, @@ -22,10 +23,10 @@ { "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 } }, @@ -33,47 +34,24 @@ "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": [