Skip to content

Commit dc2a32c

Browse files
committed
Update AI Instructions and Design Principles for git-flow model (refs #20)
- Add mandatory branch validation requirements for git-flow - Update release checklist with branch-specific procedures - Add git-flow release process requirements and sequencing - Update release testing requirements for different branches - Add git-flow release automation requirements with branch validation - Add comprehensive Git-Flow Release Management principle to Design Principles - Include git-flow workflow standards and validation requirements - Document branch structure, release process validation, and automation integration - Add examples and benefits of git-flow implementation - Ensure all release procedures align with git-flow branching model
1 parent 7ae6c4f commit dc2a32c

File tree

2 files changed

+121
-3
lines changed

2 files changed

+121
-3
lines changed

AI_INSTRUCTIONS.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,23 @@ This document establishes the foundational architectural decisions and design pa
5050
- Use bullet points for all lists
5151
- Group firmware by model and type (Official vs Labs)
5252

53-
2. **Check for Uncommitted Changes**
53+
2. **Branch Validation** (MANDATORY FOR GIT-FLOW)
54+
- **Real Releases**: Must be performed from `main` branch only
55+
- **Dry Runs**: Can be performed from `develop`, `release/*`, or `hotfix/*` branches
56+
- **Release Preparation**: Summary file must be created/updated on the preparation branch (typically `release/*`)
57+
- **Pre-Release Validation**: Successful dry run required on preparation branch before merging to `main`
58+
59+
3. **Check for Uncommitted Changes**
5460
- Ensure `scripts/release/` directory is clean (no uncommitted changes)
5561
- Ensure `.github/workflows/` directory is clean (no uncommitted changes)
62+
- Ensure summary file is committed and pushed to the preparation branch
5663
- Commit and push all changes before proceeding
5764

58-
3. **Use Full Release Script**
65+
4. **Use Full Release Script**
5966
- Always use `scripts/release/full-release.zsh` for releases
6067
- Never run individual scripts unless specifically instructed
6168

62-
4. **Output File Requirements** (CRITICAL)
69+
5. **Output File Requirements** (CRITICAL)
6370
- ALL transient output files MUST be placed in the `output/` directory
6471
- NEVER create test files, logs, or any output in the repo root
6572
- This includes release notes, test files, debug output, etc.
@@ -107,6 +114,14 @@ This document establishes the foundational architectural decisions and design pa
107114
- By default, all test runs should be performed as dry runs (using `--dry-run`), unless a real release is explicitly requested.
108115
- Do not run the bump-version, release, or monitor scripts individually unless specifically instructed.
109116

117+
**Git-Flow Release Process Requirements:**
118+
- **Development Phase**: All development work happens on `develop` branch
119+
- **Release Preparation**: Create `release/*` branch from `develop` for release preparation
120+
- **Dry Run Validation**: Perform dry run on `release/*` branch to validate release process
121+
- **Merge to Main**: Only merge to `main` after successful dry run validation
122+
- **Real Release**: Perform real release only from `main` branch
123+
- **Hotfix Process**: Use `hotfix/*` branches for urgent fixes, following same validation process
124+
110125
## Issue Creation Automation
111126

112127
- Whenever the user requests an issue to be created, always create it as a GitHub tracker issue.
@@ -118,6 +133,11 @@ This document establishes the foundational architectural decisions and design pa
118133
## Release Testing
119134

120135
- Always perform test runs for releases as dry runs by default (using the dry-run option), unless a real release is explicitly requested by the user.
136+
- **Git-Flow Testing Requirements:**
137+
- **Development Testing**: Run tests on `develop` branch during development
138+
- **Release Testing**: Perform dry run on `release/*` branch before merging to `main`
139+
- **Production Testing**: Real releases only from `main` branch after successful dry run validation
140+
- **Hotfix Testing**: Perform dry run on `hotfix/*` branch before merging to `main`
121141

122142
## Script Language Requirements
123143

@@ -142,6 +162,15 @@ This document establishes the foundational architectural decisions and design pa
142162
- If a full release (without `--dry-run`) is requested and there are changes in `scripts/release/`, first commit and push those changes, then perform a dry run. Only proceed with the real release if the dry run completes successfully.
143163
- Whenever a release is requested (dry-run or real), always create or update a file in `docs/release` with a summary of major changes since the requested previous release. The filename must match the convention used by the release process: `docs/release/latest-major-changes-since-<BASE>.md` (where `<BASE>` is the previous version, no leading 'v'). This file must be created every time a release is requested, before the release process starts.
144164

165+
**Git-Flow Release Automation Requirements:**
166+
- **Branch Validation**: Script must validate current branch before proceeding
167+
- Real releases: Must be on `main` branch
168+
- Dry runs: Can be on `develop`, `release/*`, or `hotfix/*` branches
169+
- **Release Preparation**: Summary file must be created/updated on preparation branch
170+
- **Pre-Release Validation**: Successful dry run required before real release
171+
- **Merge Requirements**: Real releases only after successful merge to `main`
172+
- **Hotfix Handling**: Support for urgent fixes via `hotfix/*` branches with same validation
173+
145174
## GitHub Issue Management
146175
- Whenever a new GitHub issue is created, immediately run `scripts/maintenance/generate-issues-markdown.zsh` to update the local Markdown issue list.
147176
- After generating the issue list, read the output file (`output/github_issues.md`) to ensure you are memorizing and referencing the latest issues in all future work and communication.

docs/architecture/DESIGN_PRINCIPLES.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,95 @@ mountoptions=(--archive --import --clean --firmware)
398398
- If a dependency is not available via Homebrew, document the alternative installation method and rationale
399399
- Ensure CI/CD and local environments use the same dependency installation approach for consistency
400400

401+
### 11. Git-Flow Release Management
402+
403+
**Principle:** Implement and maintain a strict git-flow branching model for all releases, ensuring proper separation between development, release preparation, and production deployment.
404+
405+
**Rationale:** Git-flow provides a structured approach to managing releases, hotfixes, and feature development. It ensures that production releases are always stable, that release preparation is properly validated, and that urgent fixes can be deployed without disrupting ongoing development.
406+
407+
**Implementation Requirements:**
408+
- **Branch Structure**: Maintain strict adherence to git-flow branch naming and purpose
409+
- `main`: Production-ready code only
410+
- `develop`: Integration branch for development features
411+
- `release/*`: Release preparation branches (e.g., `release/v01.02.00`)
412+
- `hotfix/*`: Urgent production fixes (e.g., `hotfix/v01.02.01`)
413+
- `feature/*`: Individual feature development (optional)
414+
415+
- **Release Process Validation**:
416+
- All releases must be prepared on `release/*` branches
417+
- Dry runs must be performed on preparation branches before merging to `main`
418+
- Real releases must only be executed from `main` branch
419+
- Summary files must be created/updated on preparation branches
420+
- Successful dry run validation required before merge to `main`
421+
422+
- **Branch Validation in Scripts**:
423+
- Release scripts must validate current branch before proceeding
424+
- Real releases: Must be on `main` branch
425+
- Dry runs: Can be on `develop`, `release/*`, or `hotfix/*` branches
426+
- Clear error messages for invalid branch operations
427+
428+
- **Release Automation Integration**:
429+
- GitHub Actions workflows must respect git-flow branch structure
430+
- Automatic triggers for dry runs on `develop` and `release/*` branches
431+
- Real release workflows only triggered from `main` branch
432+
- Proper artifact handling and workflow dependencies
433+
434+
**Git-Flow Workflow Standards:**
435+
```zsh
436+
# Development workflow
437+
git checkout develop
438+
# ... develop features ...
439+
git checkout -b feature/new-feature
440+
# ... implement feature ...
441+
git checkout develop
442+
git merge feature/new-feature
443+
444+
# Release preparation
445+
git checkout -b release/v01.02.00 develop
446+
# ... prepare release (update version, summary file, etc.) ...
447+
./scripts/release/full-release.zsh --dry-run
448+
# ... validate dry run results ...
449+
git checkout main
450+
git merge release/v01.02.00
451+
git tag v01.02.00
452+
./scripts/release/full-release.zsh # Real release
453+
454+
# Hotfix workflow
455+
git checkout -b hotfix/v01.02.01 main
456+
# ... implement urgent fix ...
457+
./scripts/release/full-release.zsh --dry-run
458+
git checkout main
459+
git merge hotfix/v01.02.01
460+
git tag v01.02.01
461+
./scripts/release/full-release.zsh # Real release
462+
```
463+
464+
**Validation Requirements:**
465+
- All release scripts must include branch validation
466+
- Pre-commit hooks should validate branch naming conventions
467+
- CI/CD pipelines must respect git-flow branch purposes
468+
- Release automation must prevent invalid branch operations
469+
470+
**Documentation Requirements:**
471+
- All git-flow procedures must be documented in project documentation
472+
- Release process must include branch-specific instructions
473+
- Hotfix procedures must be clearly documented
474+
- Branch naming conventions must be standardized
475+
476+
**Benefits:**
477+
- **Stable Production**: `main` branch always contains production-ready code
478+
- **Controlled Releases**: Release preparation happens in isolated branches
479+
- **Emergency Fixes**: Hotfixes can be deployed without disrupting development
480+
- **Clear History**: Git history clearly shows release preparation and deployment
481+
- **Automated Validation**: CI/CD ensures proper branch usage and validation
482+
483+
**Examples in GoProX:**
484+
- Release automation workflow validates branch before proceeding
485+
- Dry runs performed on `release/*` branches before merge to `main`
486+
- Summary files created on preparation branches and validated during dry runs
487+
- Real releases only executed from `main` after successful validation
488+
- Hotfix branches follow same validation process as release branches
489+
401490
## Decision Recording Process
402491

403492
When making significant design or architectural decisions:

0 commit comments

Comments
 (0)