Branch Protection Configuration
This document describes the recommended branch protection rules for the Linuxy
repository.
Protected Branches
main (Primary Branch)
The main branch should have the following protections:
Required Settings
Require a pull request before merging
- Require approvals: 1
- Dismiss stale pull request approvals when new commits are pushed
- Require review from Code Owners: Yes
Require status checks to pass before merging
- Require branches to be up to date before merging
- Required status checks:
-
Frontend Lint & Build -
Rust Check & Test -
Security Audit -
Verify CSP Configuration -
Integration Tests
-
Require conversation resolution before merging
- All comments must be resolved before merging
Include administrators
- Apply all rules to repository administrators as well
Recommended Settings
- Do not allow bypassing the above settings
- Restrict who can push to matching branches
- Allow only users with write permission
- Allow force pushes: No
- Allow deletions: No
- Lock branch: No (allow PRs)
develop (Development Branch)
The develop branch should have similar protections:
Required Settings
Require a pull request before merging
- Require approvals: 1
Require status checks to pass before merging
- Required status checks:
-
Frontend Lint & Build -
Rust Check & Test
-
- Required status checks:
Recommended Settings
- Include administrators: Yes
- Allow force pushes: No (or limited to maintainers)
- Allow deletions: No
Branch Naming Conventions
Feature Branches
feature/<short-description>
feat/<short-description>
Examples:
feature/firejail-sandbox-improvementsfeat/dark-mode-toggle
Bug Fix Branches
fix/<issue-number>-<short-description>
bugfix/<issue-number>-<short-description>
Examples:
fix/123-appimage-launch-crashbugfix/456-icon-not-loading
Documentation Branches
docs/<short-description>
Examples:
docs/update-installation-guidedocs/add-api-reference
Release Branches
release/<version>
Examples:
release/v0.1.0release/v0.2.0-beta
Hotfix Branches
hotfix/<issue-number>-<short-description>
Examples:
hotfix/789-critical-security-fix
Code Owner Reviews
Required Reviewers
At least one approval is required from:
- Code Owners (for their respective areas)
- Repository Maintainers
Code Owners File
See .github/CODEOWNERS for the list of code owners.
Status Checks
Required Checks
All PRs must pass:
CI/CD Pipeline
- Frontend lint and build
- Rust check and test
- Security audit
- CSP configuration verification
- Integration tests
Code Quality
- No Clippy warnings
- TypeScript type checking passes
- Code formatting is correct
Optional Checks
- Code coverage (when implemented)
- Performance benchmarks
Merge Strategies
Allowed Merge Methods
- Create a merge commit
- Squash and merge
- Rebase and merge (use with caution)
Recommended Strategy
Squash and merge is recommended for feature branches to keep history clean.
Merge commit is acceptable for release branches.
Manual Intervention
Emergency Bypass
In case of emergency (e.g., critical security fix), repository administrators
can:
- Create a hotfix branch
- Submit PR with
[EMERGENCY]prefix - Request expedited review
- Merge after at least one approval
All emergency merges must be documented in the next team meeting.
Enforcement
Automated Enforcement
- GitHub Actions enforce status checks
- Branch protection rules prevent direct pushes
- CODEOWNERS ensures proper review
Manual Enforcement
Repository maintainers should:
- Regularly review branch protection settings
- Ensure all contributors understand the process
- Address any attempts to bypass protections
Setup Instructions
For Repository Administrators
- Go to Settings → Branches
- Click Add branch protection rule
- Enter branch name pattern:
main - Select the required settings above
- Click Create
For Contributors
No setup required. GitHub will enforce these rules automatically when you:
- Try to push directly to protected branches
- Create a pull request
- Merge a pull request
Last Updated: March 2024 Maintained by: Repository Administrators