Skip to content

Migrate planner bucket, plan, and tenant settings set commands to Zod#7412

Draft
waldekmastykarz wants to merge 2 commits into
pnp:mainfrom
waldekmastykarz:waldekmastykarz-migrate-planner-to-zod
Draft

Migrate planner bucket, plan, and tenant settings set commands to Zod#7412
waldekmastykarz wants to merge 2 commits into
pnp:mainfrom
waldekmastykarz:waldekmastykarz-migrate-planner-to-zod

Conversation

@waldekmastykarz

Copy link
Copy Markdown
Member

What's in this PR?

Migrates the following commands from the legacy initOptions/initValidators/initTelemetry pattern to Zod schema validation:

  • planner bucket add
  • planner bucket get
  • planner bucket list
  • planner bucket remove
  • planner bucket set
  • planner plan add
  • planner plan get
  • planner plan list
  • planner plan remove
  • planner plan set
  • planner tenant settings set

Closes #7311

Changes

  • Replaced legacy #initOptions(), #initValidators(), #initTelemetry(), #initTypes(), #initOptionSets() with exported Zod options schemas
  • Added schema getter and getRefinedSchema() for cross-field validation (option sets, conditional requirements)
  • Updated all test files to use safeParse() for validation tests and parse() for action tests
  • Added unknown-options validation tests where applicable
  • Net reduction of ~650 lines of boilerplate code

waldekmastykarz and others added 2 commits June 19, 2026 08:49
Migrates the following commands from legacy initOptions/initValidators/
initTelemetry pattern to Zod schema validation:

- planner bucket add
- planner bucket get
- planner bucket list
- planner bucket remove
- planner bucket set
- planner plan add
- planner plan get
- planner plan list
- planner plan remove
- planner plan set
- planner tenant settings set

Closes pnp#7311

Co-authored-by: Copilot <[email protected]>

@MartinM85 MartinM85 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.

I have two small comments, nothing major. Great work @waldekmastykarz 🚀

}
}, commandInfo);
assert.notStrictEqual(actual, true);
it('fails validation id when id and plan details are specified', () => {

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.

Suggested change
it('fails validation id when id and plan details are specified', () => {
it('fails validation when id and plan details are specified', () => {

}
}, commandInfo);
assert.notStrictEqual(actual, true);
it('fails validation id when id and plan details are specified', () => {

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.

Suggested change
it('fails validation id when id and plan details are specified', () => {
it('fails validation when id and plan details are specified', () => {

@MartinM85 MartinM85 marked this pull request as draft June 19, 2026 12:58
@MartinM85 MartinM85 self-assigned this Jun 19, 2026
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 planner bucket and planner plan commands to Zod

2 participants