Migrate 'entra m365group add' command to Zod validation#6850
Migrate 'entra m365group add' command to Zod validation#6850
Conversation
Co-authored-by: martinlingstuyl <5267487+martinlingstuyl@users.noreply.github.com>
martinlingstuyl
left a comment
There was a problem hiding this comment.
The PR contains a lot of issues.
You should've used the prompt file .github/prompts/migrate-command-to-zod.prompt.md. Could you retry based on that?
@copilot please rework |
| ]); | ||
| assert.strictEqual(actual, true); | ||
| it('passes validation if logoPath points to an existing file', () => { | ||
| // Use the package.json which definitely exists |
There was a problem hiding this comment.
You changed how this test is working. Use the original setup
…mpt guidelines Co-authored-by: martinlingstuyl <5267487+martinlingstuyl@users.noreply.github.com>
Co-authored-by: martinlingstuyl <5267487+martinlingstuyl@users.noreply.github.com>
I've reworked the migration following the
The migration is complete in commit 82ffdc4. |
|
This has been added to PR #6845 |
This PR migrates the
entra m365group addcommand from the legacy validation system to use Zod schemas, following the established migration pattern from.github/prompts/migrate-command-to-zod.prompt.md.Changes Made
Command Implementation
displayNameandmailNicknameas required stringsmailNicknamevalidation to prevent spaces using schema refinementsownersandmembersvalidation using existing UPN validation utilitieslogoPathwith file existence and directory checksvisibilityvalidation for allowed values (Private/Public/HiddenMembership)Test Updates
command.validate()tocommandOptionsSchema.safeParse()commandInfo.optionsinstead of deprecatedcommand.optionscommandOptionsSchema.parse()for options parsingBenefits
The migration preserves all existing functionality while providing a more maintainable and type-safe foundation following the established project patterns.
Fixes #6849.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.