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

Move from branch protections to rule sets #13165

Merged
merged 2 commits into from
Feb 3, 2025
Merged
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
101 changes: 62 additions & 39 deletions .github/repository-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,45 +23,66 @@ settings](https://github.com/open-telemetry/community/blob/main/docs/how-to-conf
Read repository contents and packages permissions
- Allow GitHub Actions to create and approve pull requests: UNCHECKED

## Branch protections

The order of branch protection rules
[can be important](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/managing-a-branch-protection-rule#about-branch-protection-rules).
The branch protection rules below should be added before the `**/**` branch protection rule
(this may require deleting the `**/**` rule and recreating it at the end).

### `main`

- Require branches to be up to date before merging: UNCHECKED

(PR jobs take too long, and leaving this unchecked has not been a significant problem)

- Status checks that are required:

- EasyCLA
- required-status-check

### `release/*`

Same settings as above for [`main`](#main).

### `cloudfoundry`

Same settings as above for [`main`](#main),
except for the `required-status-check` required status check.

### `renovate/**/**` and `opentelemetrybot/**/**`

Same settings as
for [`dependabot/**/**`](https://github.com/open-telemetry/community/blob/main/docs/how-to-configure-new-repository.md#branch-protection-rule-dependabot)

### `gh-pages`

- Everything UNCHECKED

(This branch is currently only used for directly pushing benchmarking results from the
[Nightly overhead benchmark](https://github.com/open-telemetry/opentelemetry-java-instrumentation/actions/workflows/nightly-benchmark-overhead.yml)
job)
## Rules > Rulesets

### `main` and release branches

- Targeted branches:
- `main`
- `release/*`
- `v0.*`
- `v1.*`
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we also want v2.* here for patch branches and v3.* here for future-proofing?

Copy link
Member Author

Choose a reason for hiding this comment

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

we use release/v* now, v* was an old convention we used up until 1.12.0

- Branch rules
- Restrict deletions: CHECKED
- Require linear history: CHECKED
- Require a pull request before merging: CHECKED
- Required approvals: 1
- Require review from Code Owners: CHECKED
- Allowed merge methods: Squash
- Require status checks to pass
- EasyCLA
- `required-status-check`
- Block force pushes: CHECKED

### `cloudfoundry` branch

- Targeted branches:
- `cloudfoundry`
- Branch rules
- Restrict deletions: CHECKED
- Require linear history: CHECKED
- Require a pull request before merging: CHECKED
- Required approvals: 1
- Require review from Code Owners: CHECKED
- Allowed merge methods: Squash
- Require status checks to pass
- EasyCLA
- Block force pushes: CHECKED

### `gh-pages` branch

- Targeted branches:
- `gh-pages`
- Branch rules
- Restrict deletions: CHECKED
- Require linear history: CHECKED
- Block force pushes: CHECKED

### Restrict branch creation

- Targeted branches
- Exclude:
- `release/*`
- `renovate/**/**`
- `opentelemetrybot/**/**`
- Restrict creations: CHECKED

### Restrict updating tags

- Targeted tags
- All tags
- Restrict updates: CHECKED
- Restrict deletions: CHECKED

## Code security and analysis

Expand All @@ -85,3 +106,5 @@ for [`dependabot/**/**`](https://github.com/open-telemetry/community/blob/main/d
### Organization secrets

- `OPENTELEMETRYBOT_GITHUB_TOKEN`
- `OTELBOT_CLIENT_ID`
- `OTELBOT_PRIVATE_KEY`