Pre-Mode Workflow Consolidation Plan
๐ฏ Goalโ
Have ONE clear way to manage pre-release mode (beta, rc, next channels).
๐ Current State (Confusing)โ
Workflow 1: pre-mode.yml โ GOODโ
- Purpose: Enter or exit pre-mode
- How it works: Creates a PR, waits for review, then merges
- File:
.github/workflows/pre-mode.yml - Script:
.github/scripts/pre-mode-toggle.sh - Pros:
- Safe (follows branch protection)
- Creates reviewable PRs
- Uses standard git workflow
- Cons: None
Workflow 2: channel-release.yml โ ๏ธ DOES TOO MUCHโ
- Purpose: Enter/exit pre-mode + version + publish
- How it works: Direct push to main (BAD)
- File:
.github/workflows/channel-release.yml - Pros:
- All-in-one convenience
- Cons:
- Bypasses branch protection (lines 57, 64, 79 do
git push) - Bypasses PR review for enter/exit
- Confusing overlap with pre-mode.yml
- Inconsistent with documented PR-based workflow
- Bypasses branch protection (lines 57, 64, 79 do
๐ Analysis Detailsโ
What pre-mode.yml Does:โ
- Creates branch:
pre/{action}-{channel}-{run_id} - Runs:
pnpm changeset pre enter {channel}ORpnpm changeset pre exit - Commits changes to branch
- Opens PR with label
release:pre-toggle - Waits for PR approval and merge
What channel-release.yml Does (enter/exit):โ
- Runs on main branch directly
- For "enter": Runs
pnpm pre:enter:{channel}, versions, commits, pushes to main - For "exit": Runs
pnpm pre:exit, versions, commits, pushes to main - Problem: No PR, no review, bypasses protection
What channel-release.yml Does (version/publish/snapshot):โ
- For "version": Bumps versions, commits, pushes
- For "publish": Publishes to npm with prerelease tag
- For "snapshot": Publishes canary snapshot
- These are fine - they should happen AFTER pre-mode is active
โ Recommended Solutionโ
Keep: pre-mode.yml (for enter/exit only)โ
- Use this to enter or exit pre-release mode
- Creates a PR for review
- Safe and follows best practices
- Consistent with branch protection policy
Modify: channel-release.yml (remove enter/exit)โ
- Remove: "enter" and "exit" intents (lines 50-57, 72-79)
- Keep: "version", "publish", "snapshot" intents
- These operations should happen AFTER pre-mode is active via PR
New Workflow Becomes:โ
Want to start beta testing?
โ
1. Run pre-mode.yml with "enter" + "beta"
โ
2. Review and merge the PR
โ
3. Make changes, merge PRs with changesets
โ
4. Run channel-release.yml with "version" (updates versions)
โ
5. Run channel-release.yml with "publish" (publishes to npm@beta)
โ
6. Repeat steps 3-5 as needed
โ
7. Ready for stable? Run pre-mode.yml with "exit"
โ
8. Merge PR, then normal release workflow takes over
๐ Implementation Stepsโ
- โ Document the plan (this file)
- โณ Remove "enter" and "exit" from channel-release.yml inputs
- โณ Remove enter/exit steps from channel-release.yml (lines 50-57, 72-79)
- โณ Update channel-release.yml description to clarify scope
- โณ Create simple visual flowchart
- โณ Update docs/release-channels.md with new workflow
- โณ Update docs/releases/changesets-canonical.md quickstart section
- โณ Add troubleshooting section
๐ Files to Modifyโ
1. .github/workflows/channel-release.ymlโ
Remove:
- Input option "enter" from intent choices (line 12)
- Input option "exit" from intent choices (line 12)
- Step "Enter prerelease mode" (lines 50-57)
- Step "Exit prerelease mode" (lines 72-79)
Update:
- Description to: "Version and publish pre-release packages. Use pre-mode.yml to enter/exit pre-mode first."
- Intent description to: "Action: version | publish | snapshot"
2. docs/release-channels.mdโ
Update sections:
- Workflow Overview: Clarify that channel-release.yml is for version/publish/snapshot only
- Typical Sequence: Reference pre-mode.yml for enter/exit steps
- Add clear section: "Which Workflow Do I Use?"
3. docs/releases/changesets-canonical.mdโ
Update:
- Quickstart section to reference pre-mode.yml for enter/exit
- Remove any references to channel-release.yml for enter/exit
- Update "What the automation does" section
4. docs/diagrams/pre-mode-workflow-simple.md (NEW)โ
Create: Visual flowchart showing workflow progression
โ ๏ธ Breaking Changesโ
None. The old workflow commands will simply not be available anymore.
Migration path:
- Old way: Run channel-release.yml with intent=enter
- New way: Run pre-mode.yml with action=enter
- Impact: Users see clear error (invalid intent option)
- Communication: Update docs before removing options
๐งช Testing Planโ
After implementation, test this sequence:
- โ
Run pre-mode.yml with action=enter, channel=beta
- Verify PR is created
- Verify PR has correct changesets pre-mode changes
- โ
Merge the PR
- Verify main branch is in pre-mode
- โ
Run channel-release.yml with intent=version
- Verify versions are bumped correctly
- โ
Run channel-release.yml with intent=publish
- Verify packages publish to beta tag
- โ
Run channel-release.yml with intent=snapshot
- Verify canary snapshot publishes
- โ
Run pre-mode.yml with action=exit
- Verify PR is created
- Verify PR exits pre-mode correctly
- โ
Merge exit PR
- Verify main branch is out of pre-mode
- โ Try channel-release.yml with intent=enter
- Verify clear error message (option not available)
๐ Documentation Updates Neededโ
- Update all references to "use channel-release for enter/exit"
- Create simple flowchart diagram
- Add "Which workflow should I use?" decision tree
- Update troubleshooting section
- Add common mistakes section
- Update workflow dispatch descriptions
๐ Why This Matters (ADHD Context)โ
Problem: Two ways to do the same thing = confusion and mistakes
Solution: One workflow for enter/exit (safe), another for version/publish (operational)
Benefit:
- Clear mental model: "pre-mode.yml = mode changes, channel-release.yml = package operations"
- Consistent with branch protection
- Easier to remember
- Fewer decisions to make
๐ Next Stepsโ
- Review this plan
- Get approval to proceed
- Implement workflow changes
- Update documentation
- Test the new workflow
- Communicate changes to users
๐ Notesโ
- Keep pre-mode-toggle.sh as-is (already works correctly)
- No changes needed to package.json scripts
- No changes needed to other workflows
- This is a simplification, not a feature addition
Created: 2025-11-14 Status: Proposed Author: Consolidation analysis