feat(migrate): X9 — devstack import (devdock → two-file schema, spec 14) - #76
Merged
Conversation
… 14)
Implements the spec-14 importer: reads a legacy devdock single-file project.yaml
and emits the clean-slate split — workspace.yaml (shared layer) + a per-repo
devstack.yaml — plus a lossless-or-loud conversion report.
`internal/migrate.Convert` is a TOLERANT converter (the exact devdock dialect
isn't pinned, so parse leniently and report rather than guess): services with a
`repo` become projects (git shorthand expanded via internal/git); recognized
stateful engines (postgres/redis/minio, by template or image) with no repo become
`shared:`; per-service params/uses/env carry into each devstack.yaml; `uses`
rewrites to `workspace.shared.<name>`; devdock `${svc.var}` interpolation rewrites
to the typed `${ref:workspace.shared.svc.var}` grammar. Every field it can't
confidently convert (non-shared uses/refs, image-only services, unplaceable
services) is recorded in the report — nothing is dropped silently (spec 14
§lossless-or-loud). Output is ordered (yaml.MapSlice) and carries an
apiVersion/v1 header pointing at docs/MIGRATION.md.
CLI `devstack import <project.yaml> [--dry-run] [--out <dir>] [--force]`:
no-clobber by default (refuses to overwrite workspace.yaml / a target
devstack.yaml), `--force` backs up originals first, `--dry-run` previews + writes
nothing, `--json` for scripted use. Replaces the M1 stub.
Tested: shared/project split + uses/env-ref rewrite + git expansion + report for
an unconvertible ref; every emitted file is valid Project/Workspace YAML;
no-services input is loud; CLI dry-run writes nothing, real run writes the split +
report, no-clobber refuses without --force and backs up with it. `make ci` +
`make determinism` green.
Note: the converter follows spec 14's described mapping; if a real devdock file
uses different field names, only the tolerant accessors in migrate.go need a
tweak, and the conversion report already surfaces anything unmapped.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements the spec-14
devstack import: converts a legacy devdock single-fileproject.yamlinto the clean-slate split —workspace.yaml(shared layer) + a per-repodevstack.yaml— plus a lossless-or-loud conversion report. Replaces the M1 stub; completes X9.Converter (
internal/migrate.Convert)Tolerant (the exact devdock dialect isn't pinned, so parse leniently + report rather than guess):
repo→ projects (git shorthand expanded viainternal/git)shared:params/uses/envcarry into eachdevstack.yamluses→workspace.shared.<name>; devdock${svc.var}→ typed${ref:workspace.shared.svc.var}Output is ordered (
yaml.MapSlice) with anapiVersion: devstack/v1header pointing atdocs/MIGRATION.md.CLI
devstack import <project.yaml> [--dry-run] [--out <dir>] [--force]— no-clobber by default (refuses to overwriteworkspace.yaml/a targetdevstack.yaml),--forcebacks up originals first,--dry-runpreviews + writes nothing,--jsonfor scripts.Tests
Converter: shared/project split, uses + env-ref rewrite, git expansion, report for an unconvertible ref, valid Project/Workspace YAML, no-services-is-loud. CLI: registration, dry-run writes nothing, real run writes split + report, no-clobber refuses without
--forceand backs up with it.make ci+make determinismgreen.Spec acceptance (spec 14 §import)
import --dry-runemits the workspace + per-repo split and a conversion report, writing nothing.workspace.yamlwithout--force; with--forcebacks up originals first.🤖 Generated with Claude Code