fix: Drop unknown-section/key/requirement guards from mops publish#513
Merged
fix: Drop unknown-section/key/requirement guards from mops publish#513
mops publish#513Conversation
These sections are documented in mops.toml reference and used for local development workflows (check/build/test/lint). They were incorrectly rejected by `mops publish` with "Unknown config section", forcing publishers to strip them before each publish. Fixes #512 Made-with: Cursor
These three publish-only allowlists drifted from the docs/types and were the only place in the CLI that complained about unknown keys. Backend validateConfig.mo still enforces the real schema (unknown requirements, length caps, dependency rules, "not supported yet" fields), so removing the CLI guards loses no real protection. The [requirements] guard was also already broken — it used `return` inside a forEach, which neither stops iteration nor exits the process, so it only printed a red message and continued. Made-with: Cursor
mops publish rejecting documented config sectionsmops publish
mops publishmops publish
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.
Fixes #512.
mops publishrejected[moc],[canisters],[build], and[lint]sections inmops.tomleven though all four are documented and used by other mops commands.The check was one of three publish-only typo guards (top-level sections,
[package].*keys,[requirements].*keys) — all dropped, because:mops publishrejects[moc]section even though it is documented in mops.toml #512 was the result).[requirements]guard was already broken —returninsideforEachonly printed a red message and continued.Backend
validateConfig.mostill enforces the real schema (unknown requirements, length caps, "not supported yet" fields, dependency rules), so no real protection is lost. All other publish validations are untouched.Test plan
mops publishsucceeds with[moc],[canisters],[build],[lint]sections[requirements]entriespackage.*fields) still fire