Skip to content

[migrate] Add independent conditional parameter inputs; document 3.0.0b7 - #10487

Open
mahakjain314 wants to merge 4 commits into
Azure:mainfrom
mahakjain314:mahja/json-schema
Open

mahakjain314 wants to merge 4 commits into
Azure:mainfrom
mahakjain314:mahja/json-schema

Conversation

@mahakjain314

@mahakjain314 mahakjain314 commented Oct 19, 2026 •

Copy link
Copy Markdown

🤖 PR Validation — ⚠️ Review suggested

Breaking Changes Suppressions
️✔️ None ⚠️ 1 added

This PR adds warning or check suppressions. Fix the underlying warning where possible and justify each remaining suppression in a code comment or the PR description.

1 added suppression
File Line Kind Code
src/migrate/azext_migrate/tests/latest/runbook/test_runbook_unit.py 1812 skipped test self.skipTest('Node.js is required for client-side runtime tests')

This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

az migrate runbook parameter configure
az migrate runbook execution parameter configure

Summary

Add offline conditional input handling to the shared runbook/execution parameter
editor and consolidate the change history under 3.0.0b7.

Root cause: schema metadata could appear as editable inputs, and aggregating
workload conditions into the shared step form coupled otherwise independent
contexts and repeated shared validation messages.

  • Use a small custom evaluator for legacy inline allOf rules:
    if.properties.<field>.const, optional if.required, then.required, and
    boolean then.properties. This is intentionally not full JSON Schema
    Draft-07 support. Unsupported or malformed clauses fail visibly.
  • Keep original required/optional field definitions when no condition matches.
    Evaluate the left pane against step inputs only; evaluate each workload against
    its own overrides plus inherited step inputs. Workload edits and selection do
    not change the left pane's values, requiredness, visibility, or errors, or
    another workload's overrides.
  • Apply matching required flags and exclude fields marked false from controls,
    validation, and saved parameters. Preserve hidden editor values when toggling
    conditions. Where export must remove a shared value to prevent excluded
    workloads inheriting it, retain it in allowed inheriting workloads without
    replacing explicit overrides.
  • Validate shared fields once, removing duplicate Required messages at the root.
    Continue validating effective workload values for upload-command readiness;
    valid workload overrides can satisfy a missing shared default.
  • Block upload-command preparation/copying for conditional errors while allowing
    incomplete drafts to be saved. The HTML never uploads directly, and separately
    executed CLI uploads are not intercepted.
  • Preserve the original schema on export, existing inheritance, strict CSP,
    offline behavior, and legacy partial-update behavior.
  • Keep setup.py identical to main (3.0.0b6) and merge the two prior release
    notes into one HISTORY.rst section for 3.0.0b7.
  • Do not change src/index.json.

The branch is rebased onto upstream/main at 63afad024.

Validation

Working directory Command Result
src\migrate python -m pytest azext_migrate\tests\latest\runbook\test_runbook_unit.py -q Passed: 291 tests.
Repository root python src\migrate\scripts\runbook_coverage.py Passed: 294 tests; 97% coverage, above the 95% gate.
Repository root python -m azdev style migrate Passed: pylint and flake8.
Repository root python -m azdev linter migrate Passed: no rule or custom pylint violations.
Repository root python scripts\ci\test_index.py -q Passed: 7 tests; 2 CI-only checks skipped (9 discovered).
Repository root git diff --check upstream/main...HEAD Passed.
Repository root git diff --quiet upstream/main...HEAD -- src\migrate\setup.py Passed: setup.py is unchanged from main.
TOTAL  1911  58  97%

Engineering review

# Review point Decision
1 Selected design One narrow evaluator applied independently to step and workload contexts matches the actual inline schema contract.
2 Alternatives Rejected a full Draft-07 SDK as unnecessary; rejected cross-workload aggregation because it changes unrelated contexts.
3 Existing code reused Existing renderer, field rules, effective-value inheritance, controls, issue navigation, save/export, and command presentation.
4 Consolidation Shared conditional evaluation for each context and one export pass over cloned input data.
5 Duplicate logic removed Removed aggregate shared validation, cross-workload shared-rule aggregation, and repeated per-field export cloning.
6 New abstractions Narrow schema preparation and context-state helpers support the current contract; no SDK or framework was added.
7 Net growth Versus latest upstream/main: 522 lines added / 52 removed across four files. setup.py has no delta.
8 Remaining debt Full Draft-07 and external references are intentionally unsupported and fail visibly. No unverified behavior was introduced.
9 Maintenance score 9/10: one evaluator, independent contexts, existing helpers, and focused runtime regressions.
10 Simplest correct solution Evaluate only the current context instead of synchronizing or aggregating independent workload state.

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install azdev required)
  • My extension version conforms to the Extension version schema

For new extensions:

Not applicable: this updates the existing migrate extension.

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copilot AI balanced review requested due to automatic review settings October 19, 2026 09:21
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Oct 19, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for your contribution mahakjain314! We will review the pull request and get back to you soon.

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

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.

🟡 Changes recommended

Unresolved references can bypass readiness blocking, and missing-property diagnostics can target the wrong input.

2 open issues
1 file not reviewed
  • src/migrate/scripts/schema-validator/package-lock.json: Generated file
What changed in this PR

Adds offline Draft-07 validation to the shared runbook and execution parameter editor.

Changes:

  • Bundles the validator and meta-schema with reproducible build tooling.
  • Integrates schema errors into editor feedback, upload-command gating, and draft saving.
  • Adds runtime coverage and updates release packaging.
File Description
src/​migrate/​setup.py Bumps version and packages vendor assets.
src/​migrate/​scripts/​schema-validator/​package.json Pins build dependencies.
src/​migrate/​scripts/​schema-validator/​package-lock.json Locks dependency resolution.
src/​migrate/​scripts/​schema-validator/​draft07.json Adds the Draft-07 meta-schema.
src/​migrate/​scripts/​schema-validator/​build.mjs Builds the offline validator bundle.
src/​migrate/​scripts/​schema-validator/​.gitignore Excludes installed dependencies.
src/​migrate/​HISTORY.rst Documents the release.
src/​migrate/​azext_migrate/​tests/​latest/​runbook/​test_runbook_unit.py Invokes JavaScript runtime checks.
src/​migrate/​azext_migrate/​tests/​latest/​runbook/​test_configure_schema.js Tests validation and editor behavior.
src/​migrate/​azext_migrate/​runbook/​configure/​vendor/​LICENSE Includes the validator license.
src/​migrate/​azext_migrate/​runbook/​configure/​vendor/​json-schema.js Supplies the bundled validator.
src/​migrate/​azext_migrate/​runbook/​configure/​templates/​configure.html.tmpl Integrates validation and readiness controls.
src/​migrate/​azext_migrate/​runbook/​configure/​renderer.py Embeds the validator in generated HTML.

Review effort: Balanced

@mahakjain314 mahakjain314 changed the title [migrate] Add offline Draft-07 validation to parameter editors Added support for draft07 format conditional clauses with existing schema Oct 19, 2026
@mahakjain314 mahakjain314 changed the title Added support for draft07 format conditional clauses with existing schema [migrate] Add independent conditional parameter inputs; release 3.0.0b8 Oct 28, 2026
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

Mahak Jain and others added 3 commits November 4, 2026 13:18
Bundle an offline validator, separate schema keywords from editable fields, validate effective workload inputs, and gate upload-command preparation on schema errors. Preserve legacy behavior and draft saving.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d53ebcbc-f948-464f-8d13-d12fbed0619f
Replace the bundled Draft-07 SDK with scoped inline conditional rules. Keep step and workload contexts independent, exclude false properties from applicable controls and exports, and validate shared fields once.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d53ebcbc-f948-464f-8d13-d12fbed0619f
Restore setup.py to the main-branch version and merge the conditional-input release notes into a single 3.0.0b7 section.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mahakjain314 mahakjain314 changed the title [migrate] Add independent conditional parameter inputs; release 3.0.0b8 [migrate] Add independent conditional parameter inputs; document 3.0.0b7 Nov 4, 2026
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

Removed details about evaluating conditional inputs and error handling for required fields in HISTORY.rst.
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@krdhruva krdhruva removed the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Nov 4, 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.

5 participants