Documentation Versioning Workflow
Overview
The cosmos/docs repository uses a versioning system to maintain documentation snapshots for different releases while continuing development on the main branch. This document describes the complete workflow and automation.Directory Structure
Key Concepts
1. Version Types
- Development Version: Lives in
docs/directory, actively edited - Frozen Versions: Immutable snapshots in version-named directories (e.g.,
v0.4.x/) - Main Branch Only: All versions exist as directories on the main branch (no version branches)
2. Version Naming Convention
- Release versions:
v0.4.x,v0.5.x(using.xfor minor version series) - Development version: Specified in
versions.json - Special version:
mainrepresents current development
Core Scripts
1. version-manager.sh
Purpose: Primary script for freezing documentation versions Process:- Prompts for version to freeze and new development version
- Updates release notes from cosmos/evm changelog
- Copies
docs/to versioned directory - Snapshots dynamic data (EIP compatibility)
- Converts dynamic components to static
- Updates navigation and version registry
2. check-and-freeze-release.sh
Purpose: Automated version freezing triggered by cosmos/evm releases Features:- Monitors cosmos/evm for new releases
- Automatically triggers freeze for major/minor releases
- Creates branch and pull request
- Fully automated workflow
- Checks latest cosmos/evm release via GitHub API
- Compares with frozen versions
- If new major/minor release found:
- Fetches changelog from release tag
- Generates release notes
- Freezes documentation
- Creates PR
3. Supporting Scripts
parse-evm-changelog.js
- Converts cosmos/evm CHANGELOG.md to Mintlify format
- Generates release notes pages
- Extracts version-specific changes
snapshot-eip-data.js
- Fetches EIP compatibility data from Google Sheets
- Creates JSON snapshot for frozen versions
- Ensures data persistence
update-navigation.js
- Updates docs.json navigation structure
- Adds versioned navigation entries
- Maintains version dropdown
Workflow Steps
Manual Version Freeze
-
Preparation
-
Create Branch
-
Run Version Manager
-
Commit and Push
-
Create PR
- PR is created automatically when branch is pushed
- Or manually via GitHub UI/CLI
Automated Release-Driven Freeze
-
Setup (one-time)
-
Automatic Process
- Script detects new cosmos/evm release
- Downloads changelog from release tag
- Freezes matching documentation version
- Creates branch and PR automatically
Component Conversion
Dynamic to Static Components
When freezing a version, dynamic components are converted to static:EIP Compatibility Table
Development (Dynamic):File Modifications During Freeze
1. versions.json
2. docs.json
- Adds new version section with complete navigation
- Updates path prefixes for frozen version
- Maintains version dropdown order
3. Internal Links
- All
/docs/links in frozen version updated to/v0.4.x/ - Ensures frozen version is self-contained
4. Metadata Files
.version-frozen: Marker file with freeze date.version-metadata.json: Detailed version information
Important Considerations
1. Immutability
- Frozen versions should not be edited
- Changes only in
docs/directory - Historical accuracy preserved
2. Branch Strategy
- All versions live on main branch
- Feature branches for changes
- Version freeze branches for PR review
3. Release Coordination
- Align documentation freezes with cosmos/evm releases
- Use release notes from actual releases
- Maintain version number consistency
4. Data Persistence
- Dynamic data sources snapshotted at freeze time
- External dependencies captured
- Self-contained frozen versions
Troubleshooting
Common Issues
-
Script Permissions
-
Missing versions.json
-
EIP Snapshot Fails
- Check Google Sheets API access
- Verify network connectivity
- Manual snapshot:
node scripts/snapshot-eip-data.js v0.4.x
-
Navigation Not Updated
- Run:
node scripts/update-navigation.js v0.4.x - Manually check docs.json structure
- Run:
Best Practices
-
Before Freezing
- Ensure all documentation is up-to-date
- Review and merge pending PRs
- Test all code examples
-
Version Naming
- Use
.xsuffix for minor version series - Match cosmos/evm version numbers
- Clear progression (v0.4.x → v0.5.0)
- Use
-
PR Process
- Always create PR for version freezes
- Review frozen content before merging
- Tag PR with “documentation” and “release”
-
Post-Freeze
- Announce version freeze in Discord/Slack
- Update any external documentation links
- Continue development in
docs/
Automation Opportunities
GitHub Actions Workflow
Pre-commit Hooks
Version Lifecycle
- Development → Active work in
docs/ - Pre-release → Final reviews and updates
- Freeze → Create immutable snapshot
- Archived → Frozen version maintained indefinitely
- Next Cycle → New development version begins
Summary
The versioning workflow ensures:- Documentation matches specific cosmos/evm releases
- Historical versions remain accessible
- Development continues uninterrupted
- Automated processes reduce manual work
- Clear separation between versions