원클릭으로
원클릭으로
| name | stabilize-spec |
| description | Stabilize experimental Butane config spec versions |
Automates the complete stabilization workflow for Butane spec versions:
Phase 1: Stabilize Experimental → Stable
v1_7_exp → v1_7)config/config.go registration (for distro specs only)Phase 2: Create Next Experimental Version
6. Copying the newly stabilized version to create the next experimental version (e.g., v1_7 → v1_8_exp)
7. Updating package statements in the new experimental directory
8. Bumping base and Ignition dependencies to experimental versions
9. Registering the new experimental version in config/config.go
Phase 3: Validation & Documentation
10. Running tests to validate all changes
11. Running ./generate to update documentation
12. Reporting all changes and suggesting next steps
# Stabilize a base version (creates v0_7 stable + v0_8_exp experimental)
/stabilize-spec --type base --version v0_7_exp
# Stabilize a distro version (creates v1_7 stable + v1_8_exp experimental)
/stabilize-spec --type fcos --version v1_7_exp
# Stabilize a distro version with Ignition downgrade
/stabilize-spec --type openshift --version v4_21_exp --base-version v1_6 --ignition-version v3_5
# Skip creating the next experimental version (not recommended)
/stabilize-spec --type fcos --version v1_7_exp --skip-next-exp
If not provided via arguments, ask the user:
v1_7_exp, v4_21_exp)v1_6, v0_6)v3_5)Run these checks in parallel:
# Check git status
git status --porcelain
# Verify experimental directory exists
ls -la base/{version}/ || ls -la config/{distro}/{version}/
# Verify stable directory doesn't exist
ls -la base/{stable_version}/ || ls -la config/{distro}/{stable_version}/
# For distro specs: verify base version exists
ls -la base/{base_version}/ || ls -la config/fcos/{base_version}/
Validation criteria:
If any check fails, report the error and stop.
Use git mv to rename the experimental directory:
# For base specs:
git mv base/{version} base/{stable_version}
# For distro specs:
git mv config/{distro}/{version} config/{distro}/{stable_version}
Example:
git mv config/fcos/v1_7_exp config/fcos/v1_7
Find all .go files in the renamed directory and update package statements:
# Find all .go files
find {renamed_directory} -name "*.go"
# For each file, update the package statement
# OLD: package v1_7_exp
# NEW: package v1_7
Use the Edit tool to replace:
oldString: "package {version}"
newString: "package {stable_version}"
Files typically affected:
For distro specs, update base dependency imports:
Identify files that import base:
Update base import:
// OLD:
import (
base "github.com/coreos/butane/base/v0_7_exp"
)
// NEW:
import (
base "github.com/coreos/butane/base/v0_6"
)
// OLD:
import (
fcos "github.com/coreos/butane/config/fcos/v1_7_exp"
)
// NEW:
import (
fcos "github.com/coreos/butane/config/fcos/v1_6"
)
If the Ignition version is changing (common for OpenShift stabilizations):
Find files that import Ignition types:
Update Ignition imports:
// OLD:
import (
"github.com/coreos/ignition/v2/config/v3_6_experimental/types"
)
// NEW:
import (
"github.com/coreos/ignition/v2/config/v3_5/types"
)
Rename translation functions in translate.go:
ToIgn3_6Unvalidated → ToIgn3_5UnvalidatedToIgn3_6 → ToIgn3_5cutil.Translate and cutil.TranslateBytes callsUpdate test version strings in translate_test.go:
// OLD:
Version: "3.6.0-experimental",
// NEW:
Version: "3.5.0",
For distro specs, update the registration in config/config.go:
// OLD:
import (
fcos1_7_exp "github.com/coreos/butane/config/fcos/v1_7_exp"
)
// NEW:
import (
fcos1_7 "github.com/coreos/butane/config/fcos/v1_7"
)
// OLD:
RegisterTranslator("fcos", "1.7.0-experimental", fcos1_7_exp.ToIgn3_6Bytes)
// NEW:
RegisterTranslator("fcos", "1.7.0", fcos1_7.ToIgn3_6Bytes)
Pattern: Remove -experimental suffix from version string, update import alias
Note: This step implements lines 20-21 (base) and 28-30 (distro) from .github/ISSUE_TEMPLATE/stabilize-checklist.md.
If --skip-next-exp was NOT specified (default behavior):
Determine the next experimental version:
v0_7 → v0_8_expv1_7 → v1_8_expv4_21 → v4_22_expParse the stable version number and increment it.
Use cp -r or recursive copy to duplicate the newly stabilized directory:
# For base specs:
cp -r base/{stable_version} base/{next_exp_version}
# For distro specs:
cp -r config/{distro}/{stable_version} config/{distro}/{next_exp_version}
# Then add to git:
git add base/{next_exp_version} || git add config/{distro}/{next_exp_version}
Example:
cp -r config/fcos/v1_7 config/fcos/v1_8_exp
git add config/fcos/v1_8_exp
Find all .go files in the new experimental directory and update package statements:
# For each .go file in the new experimental directory:
# OLD: package v1_7
# NEW: package v1_8_exp
Use the Edit tool to replace in each file.
For distro specs, update the base import to use the new experimental base:
// In schema.go, translate_test.go, validate.go, validate_test.go:
// OLD:
import (
base "github.com/coreos/butane/base/v0_7"
)
// NEW:
import (
base "github.com/coreos/butane/base/v0_8_exp"
)
For OpenShift, also update fcos import in schema.go if fcos has a new experimental version.
If the Ignition version is increasing (e.g., v3_6 → v3_7_experimental):
// OLD:
import (
"github.com/coreos/ignition/v2/config/v3_6/types"
)
// NEW:
import (
"github.com/coreos/ignition/v2/config/v3_7_experimental/types"
)
Rename translation functions in translate.go:
ToIgn3_6Unvalidated → ToIgn3_7UnvalidatedToIgn3_6 → ToIgn3_7cutil.Translate and cutil.TranslateBytes callsUpdate test version strings in translate_test.go:
// OLD:
Version: "3.6.0",
// NEW:
Version: "3.7.0-experimental",
For distro specs, register the new experimental version in config/config.go:
// After the just-stabilized import:
import (
fcos1_7 "github.com/coreos/butane/config/fcos/v1_7"
fcos1_8_exp "github.com/coreos/butane/config/fcos/v1_8_exp" // ADD THIS
)
// After the just-stabilized registration:
RegisterTranslator("fcos", "1.7.0", fcos1_7.ToIgn3_6Bytes)
RegisterTranslator("fcos", "1.8.0-experimental", fcos1_8_exp.ToIgn3_7Bytes) // ADD THIS
Pattern: Add -experimental suffix, use experimental Ignition version
Execute the test suite to validate all changes:
./test
Expected outcome: All tests should pass.
If tests fail:
Run the documentation generator:
./generate
Expected outcome: Documentation files in docs/ are updated.
Check for uncommitted changes:
git status docs/
If ./generate fails or produces unexpected changes, report to the user.
Provide a comprehensive summary:
✅ Spec stabilization complete!
## Phase 1: Stabilization
### Directory Renamed:
- {old_path} → {new_path}
### Files Modified:
- {count} files with package statement updates
- {count} files with import updates
- config/config.go updated (distro specs only)
## Phase 2: Next Experimental Version Created
### Directory Created:
- {new_exp_path}
### Files Modified:
- {count} files with package statement updates
- {count} files with import updates (bumped to experimental versions)
- config/config.go updated with new experimental registration
## Validation:
✅ Tests passed (./test)
✅ Documentation regenerated (./generate)
## Git Status:
{output of git status}
## Next Steps (from stabilize-checklist.md):
1. Review the changes with `git diff`
2. Consider creating TWO commits:
- Commit 1: Stabilization (e.g., "fcos/v1_7_exp: stabilize to v1_7")
- Commit 2: New experimental (e.g., "fcos: add v1_8_exp")
3. Update docs/upgrading-*.md (requires manual content creation)
4. Note the stabilization in docs/release-notes.md
5. If this is a base stabilization, stabilize the distro versions that depend on it
## Suggested commit messages:
### Commit 1: Stabilization
{distro}/v{X}_exp: stabilize to v{X}
- Rename {distro}/v{X}_exp to {distro}/v{X}
- Update package statements and imports
- Drop -experimental from config registration
{additional details based on what changed}
### Commit 2: New Experimental
{distro}: add v{X+1}_exp
- Copy {distro}/v{X} to {distro}/v{X+1}_exp
- Update package statements to v{X+1}_exp
- Bump base dependency to {base}_exp
- Bump Ignition version to v{Y}_experimental
- Add experimental config registration
This skill automates the following items from .github/ISSUE_TEMPLATE/stabilize-checklist.md:
base/vB_exp to base/vB and update package statementsbase/vB to base/vB+1_exppackage statements in base/vB+1_expconfig/distro/vD_exp to config/distro/vD and update package statements-experimental from init() in config/config.goconfig/distro/vD to config/distro/vD+1_exppackage statements in config/distro/vD+1_expbase/vB+1_expconfig/vD+1_exp in config/config.go and add experimental registrationToIgnI functions in new experimental version./generate to regenerate spec docsThis skill does NOT automate:
internal/doc/main.go - requires manual editing (line 39)These steps require human judgment and should be done manually following the stabilization.
/stabilize-spec --type fcos --version v1_7_exp
═══════════════════════════════════════════════
PHASE 1: Stabilize v1_7_exp → v1_7
═══════════════════════════════════════════════
Validating prerequisites...
✅ Git working directory is clean
✅ Experimental version exists: config/fcos/v1_7_exp
✅ Stable version doesn't exist: config/fcos/v1_7
✅ Base dependency exists: base/v0_7
Renaming directory...
✅ Renamed: config/fcos/v1_7_exp → config/fcos/v1_7
Updating package statements (5 files)...
✅ config/fcos/v1_7/schema.go
✅ config/fcos/v1_7/translate.go
✅ config/fcos/v1_7/translate_test.go
✅ config/fcos/v1_7/validate.go
✅ config/fcos/v1_7/validate_test.go
Updating imports...
✅ Updated base import in 4 files
Updating config/config.go...
✅ Import statement updated: fcos1_7_exp → fcos1_7
✅ Registration updated: removed -experimental suffix
═══════════════════════════════════════════════
PHASE 2: Create Next Experimental v1_8_exp
═══════════════════════════════════════════════
Calculating next version...
✅ Next version: v1_8_exp
✅ Next experimental base: v0_8_exp
✅ Next Ignition version: v3_7_experimental
Copying stable to experimental...
✅ Copied: config/fcos/v1_7 → config/fcos/v1_8_exp
Updating package statements (5 files)...
✅ config/fcos/v1_8_exp/schema.go
✅ config/fcos/v1_8_exp/translate.go
✅ config/fcos/v1_8_exp/translate_test.go
✅ config/fcos/v1_8_exp/validate.go
✅ config/fcos/v1_8_exp/validate_test.go
Updating imports to experimental versions...
✅ Updated base import: v0_7 → v0_8_exp (4 files)
✅ Updated Ignition import: v3_6 → v3_7_experimental (2 files)
Updating translation functions...
✅ Renamed: ToIgn3_6Unvalidated → ToIgn3_7Unvalidated
✅ Renamed: ToIgn3_6 → ToIgn3_7
✅ Updated: ToIgn3_6Bytes → ToIgn3_7Bytes
Updating config/config.go...
✅ Added import: fcos1_8_exp
✅ Added registration: 1.8.0-experimental
═══════════════════════════════════════════════
PHASE 3: Validation
═══════════════════════════════════════════════
Running tests...
✅ All tests passed (./test)
Regenerating documentation...
✅ Documentation updated (./generate)
═══════════════════════════════════════════════
SUMMARY
═══════════════════════════════════════════════
📊 Phase 1 (Stabilization):
- 1 directory renamed
- 5 files updated in config/fcos/v1_7/
- config/config.go updated
📊 Phase 2 (New Experimental):
- 1 directory created (2874 lines)
- 5 files updated in config/fcos/v1_8_exp/
- config/config.go updated
✅ Tests: PASSED
✅ Docs: REGENERATED
🎯 Ready for review and commit!
.opencode/skills/stabilize-spec/DESIGN.md.opencode/skills/stabilize-spec/examples/.github/ISSUE_TEMPLATE/stabilize-checklist.mddocs/development.md