Repository navigation
Added support for draft07 format conditional clauses with existing schema - #10487
Open
mahakjain314 wants to merge 1 commit into
Open
mahakjain314 wants to merge 1 commit into
mahakjain314 wants to merge 1 commit into
Conversation
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
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Thank you for your contribution mahakjain314! We will review the pull request and get back to you soon. |
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
Contributor
There was a problem hiding this comment.
🟡 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
Comment on lines
+511
to
+513
| result.validator = new RunbookSchema.Validator(schema, '7', false); | ||
| result.validator.addSchema(RunbookSchema.metaSchema); | ||
| result.schema = schema; |
Comment on lines
+640
to
+641
| const required = e.keywordLocation.slice(2).split('/').reduce((s, k) => s && s[k.replace(/~1/g, '/').replace(/~0/g, '~')], prepared.schema); | ||
| if (Array.isArray(required)) f = required.find(k => !has(data, k)) || null; |
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.

🤖 PR Validation — ️✔️ All clear
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
Summary
Add offline, client-side validation of optional JSON Schema Draft-07 clauses in
the shared runbook/execution parameter editor.
Root cause: the editor treated every entry in a step's mixed schema/parameter
map as an editable parameter and checked fields independently. Consequently,
schema keywords such as
allOfcould appear as parameters and cross-fieldconditions were not evaluated.
@cfworker/json-schema4.1.1 and the Draft-07 meta-schema, with the MITlicense and pinned, reproducible npm/esbuild tooling. No browser network calls,
runtime
eval, new Python runtime dependency, or end-user Node.js requirement.legacy parameter descriptors whose names match keywords.
rules, and reuse the results for field errors, step/workload badges, the
issue list, and upload-command readiness.
Validate authored schemas before adding parameter-property placeholders so an
invalid
propertiesclause cannot be normalized into a valid one.incomplete work to be saved explicitly as a draft. The HTML does not upload
directly, and independently executed CLI uploads are not intercepted.
when no optional schema clauses are supplied.
migrateto3.0.0b7and update release history. Do not modifysrc/index.json.Local generated JSON/HTML, wheel files, and temporary source-path debug logging
are intentionally excluded.
Validation
Commands use the repository's development Python environment. Unit and coverage
commands were also run against an archive of the exact committed PR source,
without unrelated local logging changes or generated build artifacts.
src\migratepython -m pytest .\azext_migrate\tests\latest\runbook\test_runbook_unit.py -qsrc\migratepython .\scripts\runbook_coverage.pypython -m azdev style migratepython -m azdev linter migratepython .\scripts\ci\test_index.py -qsrc\migrate\scripts\schema-validatornpm run buildgit diff origin/main...HEAD --checkThe JavaScript harness executes the generated inline script with string/WASM
code generation disabled. Its 11 runtime tests cover legacy behavior,
conditional requirements, entity overrides/inheritance,
allOf/anyOf/oneOf/not/if/then/else/dependencies, arrays, local references, malformed schemas,prototype-property names, exports, draft saving, and upload-command gating.
Additional local headless Microsoft Edge verification passed: no script/CSP
errors or HTTP(S) requests, no
allOfcontrol, inline conditional errors andrecovery on editing, preserved exported schema, and legacy no-
allOfbehavior.Engineering review
$refplus sibling$idcombination is explicitly rejected.TODO(confirm): broader optional format/content conformance before claiming coverage beyond the SDK's documented support.General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install azdevrequired)For new extensions:
Not applicable: this updates the existing
migrateextension.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.jsonautomatically.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.