Skip to content

Fixes 32149: Track generated UI JSON schemas instead of regenerating on install - #32150

Merged
harsh-vador merged 3 commits into
mainfrom
fix/track-generated-ui-jsons
Aug 27, 2026
Merged

harsh-vador merged 3 commits into
mainfrom
fix/track-generated-ui-jsons

Conversation

@harsh-vador

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #32149

openmetadata-ui/src/main/resources/ui/src/jsons/** (279 dereferenced JSON schemas produced by parseSchemas.js) was gitignored and regenerated on every yarn install, via postinstall -> build-check -> parse-schema. Three files had been force-added past that ignore rule (#29964, #32122).

Once such a file is tracked, every CI run regenerates it, and because the committed bytes did not match generator output the working tree came up dirty before any linting ran. ui-checkstyle gates on git status --porcelain, so it failed on main for every PR regardless of what that PR changed — and reported the failure under "ESLint + Prettier" and "Licence Header", neither of which had actually touched the file. #32138 hotfixed the symptom by untracking natsConnection.json; this PR removes the class of failure.

Approach follows what src/generated/ TypeScript types already do: commit the generated output, stop regenerating it during install, and keep it in sync with the existing auto-update workflow.

Type of change:

  • Improvement

High-level design:

Track the output — dropped the src/jsons/* rule from .gitignore and committed all 279 files as emitted by parseSchemas.js.

Stop regenerating during install — build-check is now yarn run js-antlr only, so neither yarn install (postinstall) nor the Maven yarn run build-check execution rewrites tracked files. yarn parse-schema remains for manual regeneration. The ANTLR parser output stays gitignored and still generated, so the openmetadata-ui/pom.xml comment explaining why that execution exists was narrowed accordingly.

Keep formatters off the generated tree — src/jsons/ added to .prettierignore and .licenseheaderignore; the ESLint ignore widened from src/jsons/connectionSchemas/** to src/jsons/**; src/jsons/ excluded from the changed-file list in both scripts/ui-checkstyle-changed.sh and ui-checkstyle.yml's files_ignore. Without this, a formatter run could rewrite a committed file into something parse-schema would immediately undo — reintroducing exactly the drift this PR removes.

Auto-update — typescript-type-generation.yml now runs yarn parse-schema next to json2ts-generate-all.sh, stages src/jsons/ with src/generated/, and triggers on src/jsons/** and parseSchemas.js. Behaviour is otherwise unchanged: auto-commit on same-repo PRs, fail with manual instructions on fork PRs.

Alternative considered — keep src/jsons/ ignored and only harden the checkstyle exclusion so a future git add -f cannot break CI. Smaller diff, but leaves the per-install regeneration in place and leaves the two files force-added by #29964 tracked. Rejected in favour of matching the src/generated/ model.

Trade-off — dereferenced schemas are large (workflow.json ~21k lines, testSuitePipeline.json ~16k), so spec changes will produce proportionally large bot-authored diffs. Same trade-off already accepted for src/generated/.

Tests:

Use cases covered

  • A contributor running yarn install no longer ends up with a dirty working tree
  • A spec change under openmetadata-spec/ gets its dereferenced schemas auto-committed by the type-generation workflow, the same way TS types already are
  • A generated schema file can no longer fail ui-checkstyle for an unrelated PR

Unit tests

Not applicable — no application code changed. The change is build configuration plus committed generator output.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no runtime UI behaviour changed — the committed schemas are byte-identical to what yarn install previously produced at build time).

Manual testing performed

  1. yarn parse-schema on the final tree -> git status --porcelain empty. Regeneration is idempotent against the committed output, which is the property that was broken before.
  2. prettier --ignore-path .prettierignore -l 'src/jsons/**/*.json' -> 0 files. Same for eslint src/jsons/... (reports "File ignored") and license-check-and-add check (no src/jsons entries).
  3. prettier -l on every changed non-generated file -> clean; bash -n scripts/ui-checkstyle-changed.sh -> ok; both workflow YAMLs and openmetadata-ui/pom.xml parse.
  4. Rebasing onto current main surfaced schema drift from Fixes 25991: Enable https scheme support for Druid connector #32120 (Druid https scheme) in 4 files, regenerated and folded in — a live demonstration of the drift the auto-update job is there to catch.

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed — no schema content changed, only whether generated output is tracked.
  • For UI changes: not applicable, no runtime UI change.
  • I have added tests — not applicable, see above.
  • For connector/ingestion changes: not applicable.

Note for reviewers: this PR edits .github/workflows/. typescript-type-generation.yml gains the parse-schema step and stages src/jsons/; ui-checkstyle.yml gains one files_ignore entry. Both are in a separate commit (ci(ui): auto-update dereferenced JSON schemas alongside generated types) so they can be reviewed or split out independently.

🤖 Generated with Claude Code

@harsh-vador harsh-vador added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Aug 27, 2026
@greptile-apps

greptile-apps Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Too many files changed for review (287 files, 100 file limit).

Bypass the limit by tagging @greptile-apps to review.

@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

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

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 harsh-vador self-assigned this Aug 27, 2026
… install

`src/jsons/**` was gitignored and regenerated by `parse-schema` on every
`yarn install` (via `postinstall` -> `build-check`). Three files had been
force-added past that ignore rule (#29964, #32122). Once tracked, every CI
run regenerated them, and because the committed content did not match the
generator's output byte-for-byte the working tree came up dirty before any
linting ran. ui-checkstyle gates on `git status --porcelain`, so it failed
on main for every PR regardless of what that PR changed.

Commit the generated output instead, the same way `src/generated/` TypeScript
types are handled:

- drop the `src/jsons/*` ignore rule and track all 279 generated files
- remove `parse-schema` from `build-check`, so `yarn install` and the Maven
  build no longer rewrite tracked files; `yarn parse-schema` stays available
  for manual regeneration
- exclude `src/jsons/` from Prettier, the licence-header check, and ESLint
  (the ESLint ignore is widened from `src/jsons/connectionSchemas/**`), and
  from the changed-file list in `ui-checkstyle-changed.sh`, so no formatter
  can reintroduce drift between the committed files and generator output

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@harsh-vador

Copy link
Copy Markdown
Contributor Author

Test run results

@chirag-madlani — ran this locally before asking for review. Live CI verification of the auto-update job is in #32152 (throwaway PR, will close).

Worth flagging first: ui-checkstyle on this PR shows pass 7s. That is a skip, not a green light — the PR excludes src/jsons/ from the changed-file list, so it found nothing to check. Don't read it as evidence.

1. Contributor install leaves the tree clean

The headline claim. Full yarn install --frozen-lockfile including preinstall (root install + core-components build) and postinstall:

exit=0
git status --porcelain | wc -l  ->  0

2. Maven build path

openmetadata-ui/pom.xml runs yarn install --frozen-lockfile --ignore-scripts then yarn run build-check, and this PR changes what build-check does. Ran both in sequence:

install exit=0
build-check exit=0
dirty: 0

js-antlr still runs and still writes src/generated/antlr, which remains gitignored and required by the vite build.

3. Regeneration is idempotent

yarn parse-schema && git status --porcelain   ->  empty

This is the property that was false before and is the whole basis for committing the output.

4. The formatter exclusions are load-bearing

Not cosmetic — this is the part that would have quietly recreated the original bug. With src/jsons/ removed from .prettierignore, Prettier wants to rewrite 277 of the 279 committed files:

$ prettier --ignore-path <without-src/jsons> -l 'src/jsons/**/*.json' | wc -l
277

Each rewrite is a file yarn parse-schema would immediately revert. Any checkstyle run would have reformatted all 277, committed them, and reinstated the exact ping-pong from #32122 at 277x the scale. With the ignore in place: 0 files, and ESLint + the licence-header check likewise report nothing under src/jsons/.

While confirming this I also collapsed five now-redundant narrower src/jsons/* entries in .prettierignore into the single rule, and corrected the neighbouring comment, which still claimed the files are "rebuilt on postinstall".

5. Auto-update logic

Added a probe property to natsConnection.json in the spec, then ran the workflow's own steps:

git add src/generated/ src/jsons/ && git diff --cached --quiet   ->  exit 1  (changes staged, job would commit)

 .../jsons/connectionSchemas/connections/messaging/natsConnection.json |  5 +
 .../jsons/connectionSchemas/connections/serviceConnection.json        | 10 +
 .../ui/src/jsons/ingestionSchemas/testSuitePipeline.json              |  5 +
 .../ui/src/jsons/ingestionSchemas/workflow.json                       |  5 +

One spec edit fans out to four dereferenced files — the NATS schema is inlined into serviceConnection, workflow, and testSuitePipeline. That is why the job regenerates the whole tree instead of the edited file, and why a contributor could not reasonably be expected to keep these in sync by hand. Probe reverted; tree clean.

Not covered locally

Whether the workflow's push actually lands on a PR branch — that needs real GitHub credentials and a real event. #32152 exercises it end-to-end.

Still blocked

Validate PR Metadata fails because #32149 is not on the Shipping project. My token lacks read:project, so that needs someone with project access, or the skip-pr-checks label.

playwright-summary fails with gate did not succeed (result=, should_run=) — the gate job itself passed but reported empty outputs downstream. Looks like flake unrelated to this PR; worth a second opinion before treating it as ours.

chirag-madlani
chirag-madlani previously approved these changes Aug 27, 2026
`src/jsons/**` is now tracked, so it needs the same drift protection
`src/generated/**` already has.

typescript-type-generation.yml: run `yarn parse-schema` next to
`json2ts-generate-all.sh`, stage `src/jsons/` with `src/generated/`, and
trigger on changes to `src/jsons/**` and `parseSchemas.js`. Same behaviour as
before for both cases: auto-commit on same-repo PRs, fail with instructions on
fork PRs.

ui-checkstyle.yml: add `src/jsons/**` to `files_ignore` so generated schemas
are never passed to ESLint/Prettier/organise-imports.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 67%
67.16% (80197/119395) 51.65% (48803/94478) 52.68% (14721/27943)

parseSchemas.js caught every error and only logged it, so the process exited
0 no matter how many schemas failed to generate. That was harmless while
src/jsons was gitignored and rebuilt on every install, but the previous commit
tracks that output — and main() clears each destination directory before
regenerating it. A transient failure (an unresolvable $ref, a read error) now
leaves the schema *missing*, the auto-update workflow reads that as a deletion,
and on a same-repo PR the bot force-pushes a commit removing a tracked file,
with no CI signal.

Collect failures instead of swallowing them and set a non-zero exit code, so
the workflow stops before its "Check for changes" step. Errors are still
collected rather than thrown, so one bad schema does not mask the others: the
run reports every failure at once.

Verified by injecting an unresolvable $ref into kafkaConnection.json — exit 1,
six schemas reported, and `git status` confirmed those six would otherwise have
been staged as deletions. Restoring the schema returns the run to exit 0 with
byte-identical output.
@gitar-bot

gitar-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Tracks generated UI JSON schemas to prevent regeneration on install and updates the type-generation workflow. Addressed the parse-schema swallows errors; bot may commit deleted schemas finding.

✅ 1 resolved
✅ Edge Case: parse-schema swallows errors; bot may commit deleted schemas

📄 .github/workflows/typescript-type-generation.yml:150-163 📄 .github/workflows/typescript-type-generation.yml:165-179
The new step wires yarn parse-schema into the auto-commit workflow, but parseSchemas.js catches and only logs per-file errors (continueOnError + try/catch) and never sets a non-zero exit code, while main() first deletes the whole destination dir (fs.rmSync(destDir)) before regenerating. If regeneration of a file fails transiently (e.g. a $ref resolution or network hiccup), the step still exits 0, the 'Check for changes' step sees the missing file as a deletion, and on a same-repo PR the bot force-pushes a commit that removes a tracked schema — the opposite of keeping the tree in sync, with no CI signal. Consider making parse-schema propagate a non-zero exit on any caught error so this step fails loudly instead of committing partial output.

Options

Display: compact → Showing less information.

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

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit fa5610f85913e06776fccbc8b41bc98ab7d45d91 in Playwright run 33053628363, attempt 1.

✅ 553 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 54m 0s

⏱️ Max setup 5m 0s · max shard execution 16m 53s · max shard-job elapsed before upload 20m 21s · reporting 4s

🌐 217.56 requests/attempt · 2.83 app boots/UI scenario · 26.26% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 26.26% (convergence target: at most 15%).
  • Browser traffic was 217.56 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.83 per UI scenario (1622 boots / 574 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 133 0 0 0 0 0
✅ Shard chromium-02 140 0 0 0 0 0
✅ Shard chromium-03 126 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@harsh-vador
harsh-vador added this pull request to the merge queue Aug 27, 2026
Merged via the queue into main with commit 3225021 Aug 27, 2026
91 of 93 checks passed
@harsh-vador
harsh-vador deleted the fix/track-generated-ui-jsons branch August 27, 2026 14:35
kyun6318 added a commit to kyun6318/OpenMetadata that referenced this pull request Sep 21, 2026
…o probes

- ko mappings: add asciifolding to om_ngram in the 7 files whose ngram
  settings ko defines but zh omits (directory, drive_service, file, folder,
  spreadsheet, user, worksheet), matching en and the accent-insensitivity
  invariant from open-metadata#22011. Regenerable: upstream zh with ik_max_word/ik_smart
  -> nori, plus en's ngram settings where zh lacks them.
- IndexAnalyzerMappingTest: include ko in the four language loops.
- IndexMappingVersionTracker: derive the language list from
  IndexMappingLanguage instead of a hardcoded array.
- SearchConsumerFieldBehaviorIT: use "월간 매출이 증가했다" -> "매출" for ko so
  the probe only passes when nori strips the subject particle; the standard
  analyzer keeps 매출이 as one token. Note nori in the class Javadoc.
- Regenerate src/jsons and public/jsons via parseSchemas.js so the committed
  dereferenced schemas carry KO (typescript-type-generation fails fork PRs
  on drift since open-metadata#32150).
- SearchIndexMappingLanguageConfigTest: explicit UTF-8 when reading mappings.
- SearchTestImages: rewrap Javadoc to 100 columns.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Eq7ov4iB7zJgL7DXYnFBLb
akashverma0786 pushed a commit to oluies/OpenMetadata that referenced this pull request Oct 21, 2026
…age with the nori analyzer (open-metadata#30831)

* Fixes open-metadata#30830: Add Korean (KO) search index mapping language with the nori analyzer

Korean is not a supported search index mapping language, so Korean text
is indexed with om_analyzer (standard tokenizer + word_delimiter +
kstem). Korean compounds are written without spaces, so a phrase like
주문상세내역 becomes a single opaque term and free-text search over
description effectively does not work.

This follows the zh pattern: reference the analysis plugin's built-in
analyzer directly, with nori instead of ik_max_word. The ko/ mappings are
derived from zh/ and route the same field set, so there is no ko-specific
policy to maintain — nori has no max/smart split, so the ik_smart
search_analyzer is dropped.

analysis-nori is an official Elasticsearch/OpenSearch bundled plugin and
installs with a single --batch flag, unlike analysis-ik which the
integration-test image already pulls from a third-party release URL. As
with jp and zh, the plugin is required only for deployments that select
this language; EN remains plugin-free.

SearchConsumerFieldBehaviorIT discovers languages from
IndexMappingLanguage.values(), so adding the enum constant makes it
exercise ko automatically. The test image now installs analysis-nori and
the sample-text map covers ko, keeping the suite green.

* Address review: asciifolding parity, generated UI schemas, stronger ko probes

- ko mappings: add asciifolding to om_ngram in the 7 files whose ngram
  settings ko defines but zh omits (directory, drive_service, file, folder,
  spreadsheet, user, worksheet), matching en and the accent-insensitivity
  invariant from open-metadata#22011. Regenerable: upstream zh with ik_max_word/ik_smart
  -> nori, plus en's ngram settings where zh lacks them.
- IndexAnalyzerMappingTest: include ko in the four language loops.
- IndexMappingVersionTracker: derive the language list from
  IndexMappingLanguage instead of a hardcoded array.
- SearchConsumerFieldBehaviorIT: use "월간 매출이 증가했다" -> "매출" for ko so
  the probe only passes when nori strips the subject particle; the standard
  analyzer keeps 매출이 as one token. Note nori in the class Javadoc.
- Regenerate src/jsons and public/jsons via parseSchemas.js so the committed
  dereferenced schemas carry KO (typescript-type-generation fails fork PRs
  on drift since open-metadata#32150).
- SearchIndexMappingLanguageConfigTest: explicit UTF-8 when reading mappings.
- SearchTestImages: rewrap Javadoc to 100 columns.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Eq7ov4iB7zJgL7DXYnFBLb

---------

Co-authored-by: kyun6318 <[email protected]>
Co-authored-by: Sriharsha Chintalapani <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
Co-authored-by: mohitdeuex <[email protected]>
Co-authored-by: Mohit Yadav <[email protected]>

This branch was previously deployed

1 inactive deployment
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.

Track generated UI JSON schemas instead of regenerating them on every yarn install

2 participants