PR #19 was correctly merged to the next branch, but there was confusion about the branching strategy and a need to prevent future direct PRs to main.
Modified .github/workflows/ci.yaml to include:
- New
check-source-branchjob that runs first on all PRs - Validates that PRs to
maincome only fromnextbranch - Posts helpful comment explaining the violation
- Blocks all other CI jobs if the check fails
All CI jobs now depend on check-source-branch:
check-source-branch (validates branch policy)
↓
lint-dockerfile, test, test-e2e, security
↓
release
↓
generate-sbom, deploy-docs, publish-pypi, publish-testpypi
This ensures:
- Invalid PRs fail immediately
- No resources wasted on tests/builds for invalid PRs
- Clear feedback to contributors
Updated ci.yaml to accept PRs to both main and next:
pull_request:
branches: [ main, next ]Created BRANCHING_STRATEGY.md with:
- Complete workflow guide
- Branch purposes and protection rules
- Troubleshooting section
- Benefits of the strategy
Feature Branch → next ✅
- check-source-branch: ✅ skipped (not targeting main)
- All other jobs: ✅ run normally
next → main ✅
- check-source-branch: ✅ passed (next to main is allowed)
- All other jobs: ✅ run normally
Feature Branch → main ❌
- check-source-branch: ❌ FAILED
- All other jobs: ⏭️ SKIPPED (blocked by failed check)
- Comment posted: Explains how to fix
- Automated Enforcement: No manual oversight needed
- Fast Feedback: Fails immediately, no wasted CI time
- Helpful Guidance: Automatic comment explains the issue
- Blocking: All downstream jobs depend on the check
- Flexible: Works for both main and next branches
The YAML syntax has been validated. The logic will be tested when:
- A PR is created from a feature branch to main (should fail)
- A PR is created from a feature branch to next (should pass)
- A PR is created from next to main (should pass)
- Merge this PR to establish the branching strategy
- Test by creating a test PR from a feature branch to main
- Configure GitHub branch protection rules (optional, but recommended)
- Update team documentation about the workflow
.github/workflows/ci.yaml- Added check-source-branch job, updated dependenciesBRANCHING_STRATEGY.md- New comprehensive guideRECONCILIATION_SUMMARY.md- This file
- Prevents mistakes: Automatic enforcement before any human sees the PR
- Saves time: Invalid PRs fail fast without running expensive tests
- Clear guidance: Contributors know exactly what to do
- No maintenance: No separate workflow file to maintain