# Git Workflow and Branching Strategy **Last Updated:** October 10, 2025 **Status:** Active **Current Phase:** Pre-1.0 (Relaxed Rules) ## Warning: Pre-1.0 Workflow (Current) **TLDR for now:** Since yaze is pre-1.0 and actively evolving, we use a **simplified workflow**: - **Documentation changes**: Commit directly to `master` or `develop` - **Small bug fixes**: Can go direct to `develop`, no PR required - **Solo work**: Push directly when you're the only one working - Warning: **Breaking changes**: Use feature branches and document in changelog - Warning: **Major refactors**: Use feature branches for safety (can always revert) - **Always keep local backups**: copy ROMs/assets before editing; never risk the only copy. - **Before rebasing/rewriting history**, stash or copy work elsewhere to prevent accidental loss. **Why relaxed?** - Small team / solo development - Pre-1.0 means breaking changes are expected - Documentation needs to be public quickly - Overhead of PRs/reviews slows down experimentation **When to transition to strict workflow:** - Multiple active contributors - Stable API (post-1.0) - Large user base depending on stability - Critical bugs need rapid hotfixes --- ## Pre-1.0 Release Strategy: Best Effort Releases For all versions prior to 1.0.0, yaze follows a **"best effort"** release strategy. This prioritizes getting working builds to users quickly, even if not all platforms build successfully on the first try. ### Core Principles 1. **Release Can Proceed with Failed Platforms**: The `release` CI/CD workflow will create a GitHub Release even if one or more platform-specific build jobs (e.g., Windows, Linux, macOS) fail. 2. **Missing Platforms Can Be Added Later**: A failed job for a specific platform can be re-run from the GitHub Actions UI. If it succeeds, the binary artifact will be **automatically added to the existing GitHub Release**. 3. **Transparency is Key**: The release notes will automatically generate a "Platform Availability" report, clearly indicating which platforms succeeded () and which failed (❌), so users know the current status. ### How It Works in Practice - The `build-and-package` jobs in the `release.yml` workflow have `continue-on-error: true`. - The final `create-github-release` job has `if: always()` and uses `softprops/action-gh-release@v2`, which intelligently updates an existing release if the tag already exists. - If a platform build fails, a developer can investigate the issue and simply re-run the failed job. Upon success, the new binary is uploaded and attached to the release that was already created. This strategy provides flexibility and avoids blocking a release for all users due to a transient issue on a single platform. Once the project reaches v1.0.0, this policy will be retired in favor of a stricter approach where all platforms must pass for a release to proceed. --- ## 📚 Full Workflow Reference (Future/Formal) The sections below document the **formal Git Flow model** that yaze will adopt post-1.0 or when the team grows. For now, treat this as aspirational best practices. ## Branch Structure ### Main Branches #### `master` - **Purpose**: Production-ready release branch - **Protection**: Protected, requires PR approval - **Versioning**: Tagged with semantic versions (e.g., `v0.3.2`, `v0.4.0`) - **Updates**: Only via approved PRs from `develop` or hotfix branches #### `develop` - **Purpose**: Main development branch, integration point for all features - **Protection**: Protected, requires PR approval - **State**: Should always build and pass tests - **Updates**: Merges from feature branches, releases merge back after tagging ### Supporting Branches #### Feature Branches **Naming Convention:** `feature/` **Examples:** - `feature/overworld-editor-improvements` - `feature/dungeon-room-painter` - `feature/add-sprite-animations` **Rules:** - Branch from: `develop` - Merge back to: `develop` - Lifetime: Delete after merge - Naming: Use kebab-case, be descriptive but concise **Workflow:** ```bash # Create feature branch git checkout develop git pull origin develop git checkout -b feature/my-feature # Work on feature git add . git commit -m "feat: add new feature" # Keep up to date with develop git fetch origin git rebase origin/develop # Push and create PR git push -u origin feature/my-feature ``` #### Bugfix Branches **Naming Convention:** `bugfix/-` **Examples:** - `bugfix/234-canvas-scroll-regression` - `bugfix/fix-dungeon-crash` **Rules:** - Branch from: `develop` - Merge back to: `develop` - Lifetime: Delete after merge - Reference issue number when applicable #### Hotfix Branches **Naming Convention:** `hotfix/-` **Examples:** - `hotfix/v0.3.3-memory-leak` - `hotfix/v0.3.2-crash-on-startup` **Rules:** - Branch from: `master` - Merge to: BOTH `master` AND `develop` - Creates new patch version - Used for critical production bugs only **Workflow:** ```bash # Create hotfix from master git checkout master git pull origin master git checkout -b hotfix/v0.3.3-critical-fix # Fix the issue git add . git commit -m "fix: critical production bug" # Merge to master git checkout master git merge --no-ff hotfix/v0.3.3-critical-fix git tag -a v0.3.3 -m "Hotfix: critical bug" git push origin master --tags # Merge to develop git checkout develop git merge --no-ff hotfix/v0.3.3-critical-fix git push origin develop # Delete hotfix branch git branch -d hotfix/v0.3.3-critical-fix ``` #### Release Branches **Naming Convention:** `release/` **Examples:** - `release/v0.4.0` - `release/v0.3.2` **Rules:** - Branch from: `develop` - Merge to: `master` AND `develop` - Used for release preparation (docs, version bumps, final testing) - Only bugfixes allowed, no new features **Workflow:** ```bash # Create release branch git checkout develop git pull origin develop git checkout -b release/v0.4.0 # Prepare release (update version, docs, changelog) # ... make changes ... git commit -m "chore: prepare v0.4.0 release" # Merge to master and tag git checkout master git merge --no-ff release/v0.4.0 git tag -a v0.4.0 -m "Release v0.4.0" git push origin master --tags # Merge back to develop git checkout develop git merge --no-ff release/v0.4.0 git push origin develop # Delete release branch git branch -d release/v0.4.0 ``` #### Experimental Branches **Naming Convention:** `experiment/` **Examples:** - `experiment/vulkan-renderer` - `experiment/wasm-build` ## Git Safety Crash Course - Run `git status` often and avoid staging ROMs or build artifacts; add ignore rules when necessary. - Never force-push shared branches (`develop`, `master`). PRs and feature branches are safer places for rewrites. - Keep backups of any tools that mutate large files (scripts, automation) so you can revert quickly. - Before deleting branches that touched ROMs/assets, confirm those files were merged and backed up. **Rules:** - Branch from: `develop` or `master` - May never merge (prototypes, research) - Document findings in docs/experiments/ - Delete when concluded or merge insights into features ## Commit Message Conventions Follow **Conventional Commits** specification: ### Format ``` ():