Skip to content

fix(ui): bump @apidevtools/json-schema-ref-parser to 15.3.6 - #37982

Merged
harsh-vador merged 7 commits into
mainfrom
fix/ui-json-schema-ref-parser-15
Nov 18, 2026
Merged

harsh-vador merged 7 commits into
mainfrom
fix/ui-json-schema-ref-parser-15

Conversation

@harsh-vador

@harsh-vador harsh-vador commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Bumps @apidevtools/json-schema-ref-parser in openmetadata-ui from ^14.1.1 to 15.3.6. No linked issue: this is a dependency/CVE bump.

Why:

  • CVE-2026-15195 (Snyk SNYK-JS-APIDEVTOOLSJSONSCHEMAREFPARSER-17937352, prototype pollution in Pointer.set, CVSS 5.3) affects every version below 15.3.6, including the 14.1.1 the UI resolves.
  • Alignment with Collate. collate-ui compiles this UI's sources and already pins 15.3.6 (open-metadata/openmetadata-collate#5682). This was the last package the two UIs declare on different majors; the Collate side of that cleanup is open-metadata/openmetadata-collate#8652.

The package is build-time only: parseSchemas.js (yarn parse-schema) is its sole importer.

What changed:

  1. package.json. 15.3.6 is pinned exactly, like Collate, plus a scoped resolution "@apidevtools/json-schema-ref-parser/js-yaml": "4.3.2". 15.x does import yaml from "js-yaml", and the global js-yaml resolution forces 5.5.0, which has no default export. The scoped entry sits above the bare js-yaml entry because yarn 1 applies the first matching resolution; js-yaml stays on 5.5.0 everywhere else. The ordering rule, and when the pin can go (ref-parser 16.x depends on js-yaml ^5), is recorded in ADR:2026-11-17-ref-parser-js-yaml-resolution-precedes-bare-js-yaml; parseSchemas.js cites it next to the import.
  2. parseSchemas.js. Two fixes:
    • Options were never applied. The script passed them to new $RefParser(options), but neither 14.x nor 15.x has a constructor that reads them, so continueOnError and circular were dead. Options now go on each parse / dereference / bundle call. They hold only what is needed below. circular: true is the library default, and continueOnError stays off, as it effectively always was.
    • $id breaks ref resolution on 15.x. For $schema 2019-09 / 2020-12 documents, 15.x resolves relative $refs against $id, which is spec-correct. 122 spec schemas declare an $id that does not match their file path (e.g. configuration/authConfig.json → …/schema/entity/configuration/authConfig.json), so refs resolved to https://open-metadata.org/schema/... and parsed the website's HTML. A JSON parse plugin now drops $id on read, so refs resolve against the file, as they did on 14.x. The output already strips $id.
  3. Regenerated output. 283 of the 288 generated files are byte-identical. The other five ingestion schemas (application, applicationPipeline, reverseIngestionPipeline, testSuitePipeline, workflow) change only bundle-internal $ref pointers. 14.1.1 wrote 22 $refs that point through another $ref and so resolve to nothing under JSON Pointer, e.g. …/gcpConfig/oneOf/0/definitions/singleProjectId. 15.3.6 points every one of them at a real location: 0 unresolvable, down from 22.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • yarn parse-schema regenerates every connection, ingestion, governance, application and configuration schema with no failures and no network reads.

Unit tests

  • Added src/utils/GeneratedSchemaRefs.test.ts. It walks every generated schema under src/jsons and public/jsons and asserts that each local $ref resolves with strict JSON Pointer, the way RJSF resolves it. On this branch: 290/290 passed. With main's five ingestion schemas restored: 5 failed, one per file with dangling refs.

Verification (run locally, node 22.23.4)

  • node parseSchemas on 14.1.1 reproduced the committed output exactly (clean tree). On 15.3.6 without the $id plugin it failed on 227 files (Error parsing https://open-metadata.org/schema/...). With it: exit 0, and only the 5 files above change.
  • Pointer audit: a script resolved every internal $ref in all 288 generated files with strict JSON Pointer. Unresolvable refs: 22 on main, 0 on this branch.
  • RJSF check on a repaired ref: I ran @rjsf/utils findSchemaDefinition, the lookup RJSF uses when it renders a $ref, on testSuitePipeline.json at serviceConnection → PubSubConnection → gcpConfig → projectId.
    • On main: Could not find a definition for #/…/credentials/properties/gcpConfig/oneOf/0/definitions/singleProjectId.
    • On this branch: it resolves to Single Project ID.
    • No current screen renders that branch: test-suite pipelines use the Data Quality form, and the edit route redirects there too. The 22 dangling refs were a latent break, so a UI screenshot would show no before/after difference.
  • Lockfile: yarn install --ignore-scripts is stable on the committed lock. Its only change is a link-entry churn from the local core build, which is not committed.
  • Jest: jest --findRelatedTests src/utils/IngestionWorkflowUtils.ts (the consumer of the regenerated ingestion schemas) → 1006/1006 suites, 13830/13830 tests passed.
  • Lint: prettier --check and eslint on the changed files are clean. ui-checkstyle-changed.sh has no src files to process, and its yarn i18n and yarn generate:app-docs steps leave the tree clean.
  • Self-review: a fresh-context reviewer read bc05e9c7325 against REVIEW.md and found no 🔴. Its two 🟡 are fixed in 1718339fdca: the missing guard test (above), and the redundant post-bundle $id strip and default plugin keys, now dropped. The regenerated output is unchanged by that cleanup.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.
  • Decision check: docs/decisions/2026-11-17-ref-parser-js-yaml-resolution-precedes-bare-js-yaml.md records the resolutions ordering rule (review feedback); check_decision_records.py is clean.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge based on this follow-up review.

Summary

Updates the UI's schema parser to 15.3.6, adjusts schema generation, and repairs generated references.

  • Schema generation keeps relative references working with parser 15.3.6.
  • Ingestion schemas now point local references at real schema fields.
  • Playwright impact maps select fewer specs for some source files.

No new actionable issues found in the changes since the previous review. The earlier reference-guard finding is fixed: resolves now decodes URI escapes, preserves empty keys, and checks only own properties.

Reviews (10) · Last reviewed commit: "chore(playwright): regenerate the impact..." · Reviewed by Greptile

CVE-2026-15195 (prototype pollution in Pointer.set) affects every
version below 15.3.6, including the 14.1.1 the UI resolved. Collate
already pins 15.3.6, so this also aligns the two UIs on one major.

15.x ships an ESM `import yaml from "js-yaml"`, and js-yaml 5 has no
default export, so a scoped resolution keeps js-yaml 4.3.2 under the
parser only; it must stay above the bare js-yaml entry.

parseSchemas.js passed its options to the $RefParser constructor,
which never read them. They now go on every call, with a JSON parse
plugin that drops `$id`: under 2020-12 15.x resolves $refs against
`$id`, and 122 spec schemas declare an `$id` that does not match their
file path, so refs fetched open-metadata.org instead of the local file.

The regenerated output differs only in five ingestion schemas, where
22 bundle-internal $refs pointed through another $ref and resolved
nowhere; all 22 now resolve.
Fails on main's output with 22 dangling pointers in five ingestion
schemas; also drop the now-redundant post-bundle $id strip, since the
parse plugin removes $id when each file is read.
@harsh-vador
harsh-vador requested a review from a team as a code owner November 17, 2026 12:46
@harsh-vador harsh-vador added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Nov 17, 2026
@harsh-vador
harsh-vador requested a review from karanh37 November 17, 2026 12:46
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

harsh-vador and others added 5 commits November 17, 2026 18:20
…js-yaml

Yarn 1 applies the first matching resolution, so the scoped js-yaml 4.3.2
entry must stay above the bare js-yaml entry; package.json cannot carry
that comment. The record also says when the pin can go: ref-parser 16.x
depends on js-yaml ^5.
URI-decode the fragment and keep empty pointer tokens, so
'#/definitions//x' no longer passes against a missing empty key; cover
empty, escaped and URI-encoded keys.
main went stale after #37953 and #37904 changed imports without
regenerating it, which fails the impact-map drift check on every PR.
@harsh-vador
harsh-vador enabled auto-merge (squash) November 17, 2026 13:18
@gitar-bot

gitar-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findings

The build-time parser upgrade changes $id-based reference resolution and generated schema pointers; mistakes could disrupt schema-driven UI forms.

Bumps @apidevtools/json-schema-ref-parser to 15.3.6 with a scoped js-yaml resolution, and fixes parseSchemas.js so options apply and $id no longer breaks ref resolution. The js-yaml resolution-order rule, previously only in the PR body, is now also recorded in the decision record. No open issues found.

✅ 1 closed
✅ Quality: js-yaml resolution order rule is only stated in the PR body

📄 openmetadata-ui/src/main/resources/ui/package.json:344-345
The new "@apidevtools/json-schema-ref-parser/js-yaml": "4.3.2" resolution has to stay above the bare "js-yaml": "^5.5.0" entry. If someone reorders or alphabetises resolutions, the build-time schema generator breaks. package.json can't hold a comment, and the repo squash-merges, so the only place this rule is written down is the PR description. The repo's decisions-in-the-tree record says such a rule belongs in the tree.

The rule, quoted from the description: "The js-yaml 4.3.2 scoped resolution must stay above the bare js-yaml resolution, because yarn 1 applies the first matching resolution and js-yaml 5.5.0 has no default export." A record in docs/decisions/ should state it. That record should also say when the pin can be dropped, which is once ref-parser works with js-yaml 5.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@harsh-vador
harsh-vador merged commit 0f219da into main Nov 18, 2026
55 of 63 checks passed
@harsh-vador
harsh-vador deleted the fix/ui-json-schema-ref-parser-15 branch November 18, 2026 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants