325 lines
8.4 KiB
YAML
325 lines
8.4 KiB
YAML
merge_protections:
|
|
- name: PR merge requirements
|
|
if:
|
|
- base = main
|
|
success_conditions:
|
|
- "title~=(?i)^\\[(feat|feature|bugfix|fix|refactor|perf|ci|doc|docs|misc|chore|kernel|new.?model|skill|skills|infra)\\]"
|
|
- "#approved-reviews-by>=1"
|
|
- check-success~=pre-commit
|
|
- check-success=fastcheck-passed
|
|
- check-success=full-suite-passed
|
|
|
|
pull_request_rules:
|
|
|
|
# ============================================================
|
|
# Type labels (from PR title prefix)
|
|
# ============================================================
|
|
|
|
- name: "label type: feat"
|
|
conditions:
|
|
- "title~=(?i)^\\[(feat|feature)\\]"
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["type: feat"]
|
|
|
|
- name: "label type: bugfix"
|
|
conditions:
|
|
- "title~=(?i)^\\[(bug)?fix\\]"
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["type: bugfix"]
|
|
|
|
- name: "label type: refactor"
|
|
conditions:
|
|
- "title~=(?i)^\\[refactor\\]"
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["type: refactor"]
|
|
|
|
- name: "label type: perf"
|
|
conditions:
|
|
- "title~=(?i)^\\[perf\\]"
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["type: perf"]
|
|
|
|
- name: "label type: ci"
|
|
conditions:
|
|
- "title~=(?i)^\\[ci\\]"
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["type: ci"]
|
|
|
|
- name: "label type: docs"
|
|
conditions:
|
|
- "title~=(?i)^\\[(doc|docs)\\]"
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["type: docs"]
|
|
|
|
- name: "label type: misc"
|
|
conditions:
|
|
- "title~=(?i)^\\[(misc|chore)\\]"
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["type: misc"]
|
|
|
|
- name: "label type: new-model"
|
|
conditions:
|
|
- "title~=(?i)^\\[new.?model\\]"
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["type: new-model"]
|
|
|
|
- name: "label type: infra"
|
|
conditions:
|
|
- "title~=(?i)^\\[infra\\]"
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["type: infra"]
|
|
|
|
- name: "label type: skill"
|
|
conditions:
|
|
- "title~=(?i)^\\[skills?\\]"
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["type: skill"]
|
|
|
|
# ============================================================
|
|
# Scope labels (from changed files)
|
|
# ============================================================
|
|
|
|
- name: "label scope: training"
|
|
conditions:
|
|
- or:
|
|
- files~=^fastvideo/train/
|
|
- files~=^fastvideo/training/
|
|
- files~=^fastvideo/distillation/
|
|
- files~=^examples/train/
|
|
- files~=^examples/training/
|
|
- files~=^examples/distill/
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["scope: training"]
|
|
|
|
- name: "label scope: inference"
|
|
conditions:
|
|
- or:
|
|
- files~=^fastvideo/pipelines/basic/
|
|
- files~=^fastvideo/pipelines/stages/
|
|
- files~=^fastvideo/pipelines/samplers/
|
|
- files~=^fastvideo/entrypoints/
|
|
- files~=^fastvideo/worker/
|
|
- files~=^fastvideo/api/sampling_param
|
|
- files~=^fastvideo/configs/pipelines/
|
|
- files~=^examples/inference/
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["scope: inference"]
|
|
|
|
- name: "label scope: attention"
|
|
conditions:
|
|
- files~=^fastvideo/attention/
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["scope: attention"]
|
|
|
|
- name: "label scope: kernel"
|
|
conditions:
|
|
- or:
|
|
- files~=^fastvideo-kernel/
|
|
- files~=^csrc/
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["scope: kernel"]
|
|
|
|
- name: "label scope: data"
|
|
conditions:
|
|
- or:
|
|
- files~=^fastvideo/dataset/
|
|
- files~=^fastvideo/pipelines/preprocess/
|
|
- files~=^examples/preprocessing/
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["scope: data"]
|
|
|
|
- name: "label scope: infra"
|
|
conditions:
|
|
- or:
|
|
- files~=^\.github/
|
|
- files~=^\.buildkite/
|
|
- files~=^fastvideo/tests/
|
|
- files~=^docker/
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["scope: infra"]
|
|
|
|
- name: "label scope: distributed"
|
|
conditions:
|
|
- files~=^fastvideo/distributed/
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["scope: distributed"]
|
|
|
|
- name: "label scope: docs"
|
|
conditions:
|
|
- files~=^docs/
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["scope: docs"]
|
|
|
|
- name: "label scope: studio"
|
|
conditions:
|
|
- files~=^apps/fastvideo_studio/
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["scope: studio"]
|
|
|
|
- name: "label scope: model"
|
|
conditions:
|
|
- or:
|
|
- files~=^fastvideo/models/
|
|
- files~=^fastvideo/layers/
|
|
- files~=^fastvideo/configs/models/
|
|
- -closed
|
|
actions:
|
|
label:
|
|
add: ["scope: model"]
|
|
|
|
# ============================================================
|
|
# Pre-commit failure help comment
|
|
# ============================================================
|
|
|
|
- name: comment on pre-commit failure
|
|
conditions:
|
|
- check-failure~=pre-commit
|
|
- -closed
|
|
actions:
|
|
comment:
|
|
message: |
|
|
## Pre-commit checks failed
|
|
|
|
Hi @{{author}}, the pre-commit checks have failed. To fix them locally:
|
|
|
|
```bash
|
|
# Install pre-commit if you haven't already
|
|
uv pip install pre-commit
|
|
pre-commit install
|
|
|
|
# Run all checks and auto-fix what's possible
|
|
pre-commit run --all-files
|
|
```
|
|
|
|
Common fixes:
|
|
- **yapf**: `yapf -i <file>` (formatting)
|
|
- **ruff**: `ruff check --fix <file>` (linting)
|
|
- **codespell**: `codespell --write-changes <file>` (spelling)
|
|
|
|
After fixing, commit and push the changes. The checks will re-run automatically.
|
|
|
|
For future commits, `pre-commit` will run automatically on changed files before each commit.
|
|
|
|
|
|
# ============================================================
|
|
# Merge conflict detection
|
|
# ============================================================
|
|
|
|
- name: label conflicting PRs
|
|
conditions:
|
|
- conflict
|
|
- -closed
|
|
- label!=stale
|
|
actions:
|
|
label:
|
|
add: [needs-rebase]
|
|
comment:
|
|
message: |
|
|
This PR has merge conflicts with the base branch. Please rebase:
|
|
|
|
```bash
|
|
git fetch origin main
|
|
git rebase origin/main
|
|
# Resolve any conflicts, then:
|
|
git push --force-with-lease
|
|
```
|
|
|
|
- name: remove conflict label when resolved
|
|
conditions:
|
|
- -conflict
|
|
- -closed
|
|
- label=needs-rebase
|
|
actions:
|
|
label:
|
|
remove: [needs-rebase]
|
|
|
|
# ============================================================
|
|
# Auto-merge
|
|
# ============================================================
|
|
|
|
- name: auto-merge when ready and all checks pass
|
|
conditions:
|
|
- label=ready
|
|
- "title~=(?i)^\\[(feat|feature|bugfix|fix|refactor|perf|ci|doc|docs|misc|chore|kernel|new.?model|skill|skills|infra)\\]"
|
|
- "#approved-reviews-by>=1"
|
|
- check-success~=pre-commit
|
|
- check-success=fastcheck-passed
|
|
- check-success=full-suite-passed
|
|
- -conflict
|
|
- -closed
|
|
- -draft
|
|
actions:
|
|
merge:
|
|
method: squash
|
|
|
|
# ============================================================
|
|
# PR title format help
|
|
# ============================================================
|
|
|
|
- name: comment on invalid PR title format
|
|
conditions:
|
|
- -closed
|
|
- -draft
|
|
- "-title~=(?i)^\\[(feat|feature|bugfix|fix|refactor|perf|ci|doc|docs|misc|chore|kernel|new.?model|skill|skills|infra)\\]"
|
|
actions:
|
|
comment:
|
|
message: |
|
|
## ⚠️ PR title format required
|
|
|
|
Your PR title must start with a type tag in brackets. Examples:
|
|
- `[feat] Add new model support`
|
|
- `[bugfix] Fix VAE tiling corruption`
|
|
- `[refactor] Restructure training pipeline`
|
|
- `[perf] Optimize attention kernel`
|
|
- `[ci] Update test infrastructure`
|
|
- `[infra] Add activation trace hooks`
|
|
- `[docs] Add inference guide`
|
|
- `[misc] Clean up configs`
|
|
- `[new-model] Port Flux2 to FastVideo`
|
|
- `[skill] Add add-model agent skill`
|
|
|
|
Valid tags: `feat`, `feature`, `bugfix`, `fix`, `refactor`, `perf`, `ci`, `infra`, `doc`, `docs`, `misc`, `chore`, `kernel`, `new-model`, `skill`, `skills`
|
|
|
|
Please update your PR title and the merge protection check will pass automatically.
|
|
|
|
merge_protections_settings:
|
|
reporting_method: check-runs
|