Repository navigation
Migrates spp commands to Zod. Closes #7346 - #7623
Merged
milanholemans merged 5 commits intoOct 20, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Model get and remove need negative regression tests for their newly command-local selector constraints.
2 open issues
What changed in this PR
Migrates the four spp commands in #7346 to the CLI’s Zod validation pattern.
Changes:
- Replaces legacy option registration and validation with strict schemas.
- Moves model selector constraints into schema refinements.
- Updates tests to parse schemas and reject unknown options.
| File | Description |
|---|---|
| src/m365/spp/commands/model/model-remove.ts | Adds removal options schema and selector constraint. |
| src/m365/spp/commands/model/model-remove.spec.ts | Migrates removal tests to schema parsing. |
| src/m365/spp/commands/model/model-list.ts | Adds site URL validation schema. |
| src/m365/spp/commands/model/model-list.spec.ts | Migrates listing tests to schema parsing. |
| src/m365/spp/commands/model/model-get.ts | Adds retrieval options schema and selector constraint. |
| src/m365/spp/commands/model/model-get.spec.ts | Migrates retrieval tests to schema parsing. |
| src/m365/spp/commands/contentcenter/contentcenter-list.ts | Adds strict global-options schema. |
| src/m365/spp/commands/contentcenter/contentcenter-list.spec.ts | Adds schema validation and updates action tests. |
Review effort: Balanced
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
milanholemans
force-pushed
the
feature/7346-migrate-spp-commands-to-zod
branch
from
October 20, 2026 19:19
53e99a3 to
e4307cf
Compare
milanholemans
approved these changes
Oct 20, 2026
milanholemans
left a comment
Contributor
There was a problem hiding this comment.
With a few minor fixes, good to go.
Comment on lines
+18
to
+21
| id: z.string() | ||
| .refine(val => validation.isValidGuid(val), { | ||
| message: `The value specified for option 'id' is not a valid GUID.` | ||
| }) |
Comment on lines
+20
to
+23
| id: z.string() | ||
| .refine(val => validation.isValidGuid(val), { | ||
| message: `The value specified for option 'id' is not a valid GUID.` | ||
| }) |
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 #7346