Skip to content

Migrates 'spe' commands to Zod. Closes #7317#7426

Open
MartinM85 wants to merge 2 commits into
pnp:mainfrom
MartinM85:feature/7317-migrate-spe-commands-to-zod
Open

Migrates 'spe' commands to Zod. Closes #7317#7426
MartinM85 wants to merge 2 commits into
pnp:mainfrom
MartinM85:feature/7317-migrate-spe-commands-to-zod

Conversation

@MartinM85

Copy link
Copy Markdown
Contributor

Closes #7317

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 continues the migration of SPE commands to the CLI’s Zod-based option/schema validation, updating both command implementations (exported options + schema getters) and their Mocha specs to validate options via commandInfo.command.getSchemaToParse().

Changes:

  • Migrated spe containertype list to Zod using globalOptionsZod.strict().
  • Migrated spe container activate and spe container list to Zod with exported options schemas and updated command classes.
  • Updated specs to use commandOptionsSchema.parse(...)/safeParse(...) rather than legacy command.validate(...).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/m365/spe/commands/containertype/containertype-list.ts Adds Zod schema integration for global-only options.
src/m365/spe/commands/containertype/containertype-list.spec.ts Updates tests to parse options through the command’s schema.
src/m365/spe/commands/container/container-list.ts Replaces legacy option/validator/optionSet logic with Zod schema + refinement.
src/m365/spe/commands/container/container-list.spec.ts Updates validation/action tests to use the refined Zod schema.
src/m365/spe/commands/container/container-get.spec.ts Adjusts action tests to pass schema-parsed options.
src/m365/spe/commands/container/container-activate.ts Adds Zod schema (with alias) and removes legacy option init.
src/m365/spe/commands/container/container-activate.spec.ts Updates tests to pass schema-parsed options.

Comment thread src/m365/spe/commands/container/container-list.ts Outdated
Comment thread src/m365/spe/commands/container/container-list.ts
Comment thread src/m365/spe/commands/container/container-list.spec.ts
Comment thread src/m365/spe/commands/container/container-activate.spec.ts
Comment thread src/m365/spe/commands/containertype/containertype-list.spec.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 spe commands to Zod

2 participants