Skip to content

fix: Drop unknown-section/key/requirement guards from mops publish#513

Merged
Kamirus merged 2 commits intomainfrom
fix/publish-allow-moc-section
Apr 23, 2026
Merged

fix: Drop unknown-section/key/requirement guards from mops publish#513
Kamirus merged 2 commits intomainfrom
fix/publish-allow-moc-section

Conversation

@Kamirus
Copy link
Copy Markdown
Collaborator

@Kamirus Kamirus commented Apr 22, 2026

Fixes #512.

mops publish rejected [moc], [canisters], [build], and [lint] sections in mops.toml even 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:

Backend validateConfig.mo still 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 publish succeeds with [moc], [canisters], [build], [lint] sections
  • Backend still rejects unknown [requirements] entries
  • Other publish validations (local/GitHub deps, disabled package.* fields) still fire

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
@Kamirus Kamirus requested a review from a team as a code owner April 22, 2026 16:05
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
@Kamirus Kamirus changed the title Fix mops publish rejecting documented config sections Drop unknown-section/key/requirement guards from mops publish Apr 22, 2026
@Kamirus Kamirus changed the title Drop unknown-section/key/requirement guards from mops publish fix: Drop unknown-section/key/requirement guards from mops publish Apr 23, 2026
@Kamirus Kamirus merged commit c58458f into main Apr 23, 2026
31 checks passed
@Kamirus Kamirus deleted the fix/publish-allow-moc-section branch April 23, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mops publish rejects [moc] section even though it is documented in mops.toml

1 participant