feat: add cascade init command to scaffold a project#170
Merged
Conversation
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.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.
Problem
cascade had a
scaffoldpackage but no command to drive it. New adopters had to hand-write the manifest and callback stubs before they could generate anything.Fix
Adds
cascade init, the command that drivesinternal/scaffold.Flags:
--topology(preset:no-env/two-env/three-env/four-env, defaulttwo-env),--envs(custom ordered list, overrides--topology, last name is the release stage),--name(default: target dir base name),--dir(default.),--cli-version,--force,--dry-run.Behavior:
scaffold.Scaffold, which self-checks (parse + validate + generate) before returning. A scaffold that cannot survive the real generator is never written, so validate-failure rollback is inherent.--forceis unset, aborts and lists the conflicts, writing nothing.--forceoverwrites.--dry-run: prints the file list and exits without writing.generate-workflow), noting the manifest already carries the$schemadirective.Docs
cli-reference: newinitentry with the full flag table.getting-started: a "Fast path: scaffold with cascade init" section.adoption: points atcascade initas the fast path for building a pipeline from scratch.Housekeeping
go mod tidyflipssanthosh-tekuri/jsonschema/v6from indirect to direct (it is a direct test dependency) and records its transitivego.sumentries. One-line marker fix; nothing else pulled in.Verification
go build ./...,go test ./...(1345 pass),golangci-lint run ./...(clean).--envs, refuse-on-existing (with and without--force),--dry-runwrites nothing, a successful init whose written manifest re-passes self-check, and the scaffold-failure path.generate-workflow --config .github/manifest.yaml --forcethengit diff --exit-code -- .github/workflows .github/actionsis clean.cascade init --topology two-env --name demoproduces a valid scaffold thatgenerate-workflow --validate-onlyaccepts.