feat(cli): add mops deployed post-deploy hook + init bootstrap#562
Merged
Conversation
Implements specs/mops-deployed.md. `mops deployed [canisters...]` promotes the just-built `<outputDir>/<name>.most` into `<deployed-dir>/<name>.most` so `mops check-stable` always compares against the deployed version. `mops deployed init` writes an empty-actor baseline and wires `[canisters.<name>.check-stable].path` to it. New `[deployed].dir` config (default `deployed`); overridable per invocation with `--dir`. Source overridable with `--output`. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Cursor AI review👍 APPROVE — looks safe to merge
VerdictDecision: APPROVE Generated for commit 7d1271b |
…ests - `mops deployed --output` description disambiguated vs `mops build --output` - Drop dead `output: options.output` (already in `...options`) - Add tests for `init` preserving an existing baseline file and for the hook reading `[deployed].dir` from config Co-authored-by: Cursor <cursoragent@cursor.com>
- Extract `resolveBuildOutputDir` from `build.ts`; `mops deployed --output` now shares the same precedence (CLI override → [build].outputDir → default). - Collapse the duplicated canister-validation preamble in `deployed`/`deployedInit` into a single `selectCanisters` helper. - Unify the two `[check-stable].path`-divergence warnings (post-deploy hook and `init`) into one `warnIfStablePathDiverges` helper with a single message. - Hoist the `_tmp_<fixture>_<suffix>` + `afterEach` cleanup pattern out of `migrate.test.ts` and `deployed.test.ts` into a shared `useTempFixtures` helper in `tests/helpers.ts`. Co-authored-by: Cursor <cursoragent@cursor.com>
… spec `--output` named the directory `mops deployed` *reads* built `.most` files from, which read as the opposite of its role (and clashed with `mops build --output`, where the same dir is written). `--build-dir` names what the directory is, not its in/out role. Also remove specs/mops-deployed.md now that the command is implemented. Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve conflicts in cli/CHANGELOG.md and .agents/skills/mops-cli/SKILL.md (keep both `mops deployed` and `mops generate candid` entries; drop the unreleased bullets that main released under 2.14.0). Re-add the `Config` import to build.ts that main's moc-args refactor dropped. Remove specs/mops-candid.md, implemented by `mops generate candid` (#563). Co-authored-by: Cursor <cursoragent@cursor.com>
The merge of origin/main truncated the released ## 2.14.0 section: six bullets (toolchain --help, update/outdated --patch, install integrity message, vessel.dhall deprecation, install race fix, smol-toml) were git's common-context lines after the conflict marker and got removed along with the marker. Restore them verbatim from main; CHANGELOG now differs from main only by the new `mops deployed` entry under ## Next. Co-authored-by: Cursor <cursoragent@cursor.com>
State why check-stable matters (local pre-deploy version of ICP's upgrade-time compatibility check) and how to bootstrap the baseline `.most` for both new and already-deployed canisters. Co-authored-by: Cursor <cursoragent@cursor.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
mops deployedspec (thespecs/mops-deployed.mddraft is removed in this PR now that the command exists).After a successful deploy,
mops deployedpromotes the just-built.mostinto a committeddeployed/<name>.mostsomops check-stablecompares against the deployed version on the next build. Closes the manual gap that today silently rots the stable-check baseline whenever someone forgets to copy the file.CLI surface
[build].outputDir(default.mops/.build); override with--build-dir.[deployed].dirconfig (defaultdeployed); override with--dir.mops build/mops check.[check-stable].pathdoesn't point at<dir>/<name>.mostso silent baseline drift is visible.initis idempotent and only rewritesmops.tomlwhen something actually changes.Lifecycle
Skill docs (closes #558)
Updates the
mops-cliskill to cover the three gaps from #558: whycheck-stablematters (a local pre-deploy version of ICP's upgrade-time compatibility check), the per-deploy.mostmaintenance workflow (nowmops deployed), and how to bootstrap the baseline for both new and already-deployed canisters.Out of scope
.didhandling — interface-change-driven, lives inmops generate candid.Closes #558