Skip to content

Migrates 'spo commandset' commands to Zod. Closes #7322 - #7479

Open
MartinM85 wants to merge 2 commits into
pnp:mainfrom
MartinM85:feature/7322-migrate-spo-commandset-to-zod
Open

Migrates 'spo commandset' commands to Zod. Closes #7322#7479
MartinM85 wants to merge 2 commits into
pnp:mainfrom
MartinM85:feature/7322-migrate-spo-commandset-to-zod

Conversation

@MartinM85

Copy link
Copy Markdown
Contributor

Closes #7322

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/m365/spo/commands/commandset/commandset-add.ts
Comment thread src/m365/spo/commands/commandset/commandset-get.ts
Comment thread src/m365/spo/commands/commandset/commandset-list.ts
Comment thread src/m365/spo/commands/commandset/commandset-remove.ts
Comment thread src/m365/spo/commands/commandset/commandset-set.ts
Comment thread src/m365/spo/commands/commandset/commandset-set.ts
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.

Migrate spo commandset commands to Zod

2 participants