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 repository rulesets and a docs section to configure the GitHub repository #192

Merged
merged 4 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
18 changes: 9 additions & 9 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This command will prompt you for the project type, name, and other
configuration options, and it will generate the entire project for you in a new
subdirectory.

!!! warning
!!! Warning

This command needs to be typed literally!

Expand Down Expand Up @@ -100,7 +100,7 @@ This will only install your package in *editable* mode and the minimum
dependencies required to run `nox`. It will then run all `nox` default
sessions, which include running linters and tests.

!!! note
!!! Tip

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!!! Note

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that was changed on purpose, is more a tip than a note, forgot to mention it in the commit


It's much faster to use `nox` with `--install-only` once (each time you
change or update dependencies, you need to run it again) and then use `nox
Expand Down Expand Up @@ -167,7 +167,7 @@ worked, now there is a local web server serving the documentation. You can
point your browser to [http://127.0.0.1:8000](http://127.0.0.1:8000) to have
a look.

!!! info
!!! Info

For API projects, `docker` is needed to generate and serve documentation,
as the easiest way to use the [tool to generate the documentation from
Expand Down Expand Up @@ -250,15 +250,15 @@ git diff
git commit -a
```

!!! warning
!!! Warning

The trailing slash in `new-project/` and the lack of it in
`/path/to/existing/project` are meaningful to `rsync`.

Also, make sure to **exclude** the `.git/` directory to avoid messing up
with your local Git repository.

!!! tip
!!! Tip

Please have a look at the follow-up steps listed in the [Start a new
project](#create-the-local-development-environment) section to finish the
Expand All @@ -272,7 +272,7 @@ was saved during the project generation. The file is saved as
`.cookiecutter-replay.json`. Using this file, you can re-run [Cookiecutter]
without having to enter all the inputs again.

!!! warning
!!! Warning

* Don't forget to commit all changes in your repository before doing this!
Files will be overwritten!
Expand Down Expand Up @@ -301,19 +301,19 @@ updates, or create a new commit with the fixes. You can also use `git citool`
or `git gui` to easily add, remove, or even discard (revert) changes in the
templates update commit.

!!! note
!!! Note

The `project-directory` is the directory of your previously generated
project. If you renamed it, then the files will be generated in a new
directory with the original name. You can update the target directory in
the replay file.

!!! note
!!! Note

Please remember to keep your replay file up to date if you change any
metadata in the project.

!!! tip
!!! Tip

Please have a look at the follow-up steps listed in the [Start a new
project](#create-the-local-development-environment) section to finish the
Expand Down
27 changes: 27 additions & 0 deletions github-rulesets/Disable creation of non-release tags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "Disable creation of non-release tags",
"target": "tag",
"source_type": "Repository",
"source": "frequenz-floss/frequenz-repo-config-python",
"enforcement": "active",
"conditions": {
"ref_name": {
"exclude": [
"refs/tags/v[0-9]*.[0-9]*.[0-9]**"
],
"include": []
}
},
"rules": [
{
"type": "non_fast_forward"
},
{
"type": "creation"
},
{
"type": "update"
}
],
"bypass_actors": []
}
29 changes: 29 additions & 0 deletions github-rulesets/Disable creation of other branches.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "Disable creation of other branches",
"target": "branch",
"source_type": "Repository",
"source": "frequenz-floss/frequenz-repo-config-python",
"enforcement": "active",
"conditions": {
"ref_name": {
"exclude": [
"refs/heads/dependabot/**/*",
"refs/heads/v[0-9]*.[0-9x]*.x",
"refs/heads/gh-pages",
"refs/heads/gh-readonly-queue/**/*"
],
"include": [
"~ALL"
]
}
},
"rules": [
{
"type": "non_fast_forward"
},
{
"type": "creation"
}
],
"bypass_actors": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "Disallow removal and force-pushes of gh-pages",
"target": "branch",
"source_type": "Repository",
"source": "frequenz-floss/frequenz-repo-config-python",
"enforcement": "active",
"conditions": {
"ref_name": {
"exclude": [],
"include": [
"refs/heads/gh-pages"
]
}
},
"rules": [
{
"type": "deletion"
},
{
"type": "non_fast_forward"
}
],
"bypass_actors": []
}
30 changes: 30 additions & 0 deletions github-rulesets/Protect released tags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "Protect released tags",
"target": "tag",
"source_type": "Repository",
"source": "frequenz-floss/frequenz-repo-config-python",
"enforcement": "active",
"conditions": {
"ref_name": {
"exclude": [],
"include": [
"refs/tags/v[0-9]*.[0-9]*.[0-9]**"
]
}
},
"rules": [
{
"type": "deletion"
},
{
"type": "non_fast_forward"
},
{
"type": "update"
},
{
"type": "required_signatures"
}
],
"bypass_actors": []
}
84 changes: 84 additions & 0 deletions github-rulesets/Protect version branches.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"name": "Protect version branches",
"target": "branch",
"source_type": "Repository",
"source": "frequenz-floss/frequenz-repo-config-python",
"enforcement": "active",
"conditions": {
"ref_name": {
"exclude": [],
"include": [
"~DEFAULT_BRANCH",
"refs/heads/v[0-9]*.[0-9x]*.x"
]
}
},
"rules": [
{
"type": "non_fast_forward"
},
{
"type": "required_signatures"
},
{
"type": "pull_request",
"parameters": {
"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": {
"required_status_checks": [
{
"context": "Test with nox",
"integration_id": 15368
},
{
"context": "DCO"
},
{
"context": "Build distribution packages",
"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": "Check release notes are updated",
"integration_id": 15368
}
],
"strict_required_status_checks_policy": false
}
},
{
"type": "deletion"
}
],
"bypass_actors": [
{
"actor_id": 5,
"actor_type": "RepositoryRole",
"bypass_mode": "always"
},
{
"actor_id": 1,
"actor_type": "OrganizationAdmin",
"bypass_mode": "always"
}
]
}