Migrates 'spo commandset' commands to Zod. Closes #7322 - #7479
Open
MartinM85 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the SharePoint Online spo commandset command group from the legacy options/validators model to the Zod-based schema model, aligning these commands with the newer CLI validation and option-parsing pipeline (per issue #7322).
Changes:
- Introduces Zod schemas (including option aliases and enum constraints) for
spo commandset add|get|list|remove|set. - Removes legacy option/validator/optionSet initialization code from the migrated commands in favor of
schema/getRefinedSchema. - Updates Mocha specs to validate via the command’s Zod schema (
safeParse/parse) and adds strict unknown-option validation tests.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/m365/spo/commands/commandset/commandset-add.ts | Replaces legacy option/validator setup with a Zod schema for spo commandset add. |
| src/m365/spo/commands/commandset/commandset-add.spec.ts | Updates tests to validate/parse options via the Zod schema; adds unknown-option coverage. |
| src/m365/spo/commands/commandset/commandset-get.ts | Replaces legacy option/validator setup with a Zod schema and refined option-set validation for get. |
| src/m365/spo/commands/commandset/commandset-get.spec.ts | Updates tests to use schema parsing/validation; adds unknown-option coverage. |
| src/m365/spo/commands/commandset/commandset-list.ts | Replaces legacy option/validator setup with a Zod schema for list. |
| src/m365/spo/commands/commandset/commandset-list.spec.ts | Updates tests to use schema parsing/validation. |
| src/m365/spo/commands/commandset/commandset-remove.ts | Replaces legacy option/validator setup with a Zod schema and refined option-set validation for remove. |
| src/m365/spo/commands/commandset/commandset-remove.spec.ts | Updates tests to use schema parsing/validation; adds unknown-option coverage. |
| src/m365/spo/commands/commandset/commandset-set.ts | Replaces legacy option/validator setup with a Zod schema and refined validations for set. |
| src/m365/spo/commands/commandset/commandset-set.spec.ts | Updates tests to validate/parse options via the Zod schema; adds unknown-option coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Closes #7322