feat: apply per-canister moc args in check and check-stable#487
Merged
feat: apply per-canister moc args in check and check-stable#487
Conversation
[canisters.<name>].args from mops.toml were only passed to moc during build but silently ignored by check and check-stable. This caused flags like --enhanced-migration=<path> to work in build but fail in check, forcing users to set global [moc].args that don't make sense for multi-canister projects where each canister needs different paths. - check and check-stable now accept canister names as arguments (e.g. mops check backend, mops check-stable backend) - check-stable supports a no-args mode that checks all canisters with [check-stable] configured - per-canister args are applied alongside global [moc].args in all three commands (build, check, check-stable) - shared helpers extracted: filterCanisters, validateCanisterArgs, looksLikeFile, resolveStablePath Made-with: Cursor
Made-with: Cursor
- hoist sources in checkStable canister loop (avoid repeated sourcesArgs) - rename logAllLibsSupport → checkAllLibsSupport (name matches behavior) - pass fileArgs to checkFiles (clearer intent) - bind args[0] once in check-stable file mode (remove ! assertions) - docs: fix "file paths" wording, clarify [build].args scope in [moc] section Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
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
[canisters.<name>].argsfrommops.tomlwere only passed tomocduringmops build. Thecheckandcheck-stablecommands silently ignored per-canister args, using only global[moc].args.This meant flags like
--enhanced-migration=migrations/backendworked inmops buildbut were missing duringmops check, causing check failures. The only workaround was setting the flag in global[moc].args, which doesn't work for multi-canister projects where each canister needs a different migration path.Fix
Per-canister
[canisters.<name>].argsare now applied in all three commands (build,check,check-stable) with consistent ordering:[moc].args→[canisters.<name>].args→ CLI-- flags.New CLI capabilities
mops checknow accepts canister names:mops check-stablenow supports a no-args mode:Both commands apply
[canisters.<name>].argswhen checking canisters, matchingmops buildbehavior.Docs updated
mops check— updated arguments, examples, and description for canister-name supportmops check-stable— documented canister mode and file mode as separate usage patternsmops.toml— clarified that[canisters.<name>].argsapplies tocheck,check-stable, andbuild; added multi-canister exampleTest plan
mops checkwith no args checks all canisters with per-canister argsmops check backendfilters to a specific canistermops check nonexistenterrors with available canister names[canisters.X].argswith-Werrorcorrectly applied in checkmops check-stablewith no args checks all canisters with[check-stable]configmops check-stable backendfilters to a specific canister[canisters.X].argswith--enhanced-migrationcorrectly applied in check-stable