Repository navigation
Fixes 32149: Track generated UI JSON schemas instead of regenerating on install - #32150
Conversation
|
Too many files changed for review (287 files, 100 file limit). Bypass the limit by tagging |
❌ PR checklist incompleteThis 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 |
… 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]>
aefd797 to
2cf6535
Compare
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: 1. Contributor install leaves the tree cleanThe headline claim. Full 2. Maven build path
3. Regeneration is idempotentThis is the property that was false before and is the whole basis for committing the output. 4. The formatter exclusions are load-bearingNot cosmetic — this is the part that would have quietly recreated the original bug. With Each rewrite is a file While confirming this I also collapsed five now-redundant narrower 5. Auto-update logicAdded a probe property to One spec edit fans out to four dereferenced files — the NATS schema is inlined into Not covered locallyWhether 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
|
`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]>
2cf6535 to
95a60ee
Compare
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.
Code Review ✅ Approved 1 resolved / 1 findingsTracks 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
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
✅ Playwright Results — workflow succeededValidated commit ✅ 553 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking 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:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
…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
…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]>



Describe your changes:
Fixes #32149
openmetadata-ui/src/main/resources/ui/src/jsons/**(279 dereferenced JSON schemas produced byparseSchemas.js) was gitignored and regenerated on everyyarn install, viapostinstall->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-checkstylegates ongit 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 untrackingnatsConnection.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:
High-level design:
Track the output — dropped the
src/jsons/*rule from.gitignoreand committed all 279 files as emitted byparseSchemas.js.Stop regenerating during install —
build-checkis nowyarn run js-antlronly, so neitheryarn install(postinstall) nor the Mavenyarn run build-checkexecution rewrites tracked files.yarn parse-schemaremains for manual regeneration. The ANTLR parser output stays gitignored and still generated, so theopenmetadata-ui/pom.xmlcomment explaining why that execution exists was narrowed accordingly.Keep formatters off the generated tree —
src/jsons/added to.prettierignoreand.licenseheaderignore; the ESLint ignore widened fromsrc/jsons/connectionSchemas/**tosrc/jsons/**;src/jsons/excluded from the changed-file list in bothscripts/ui-checkstyle-changed.shandui-checkstyle.yml'sfiles_ignore. Without this, a formatter run could rewrite a committed file into somethingparse-schemawould immediately undo — reintroducing exactly the drift this PR removes.Auto-update —
typescript-type-generation.ymlnow runsyarn parse-schemanext tojson2ts-generate-all.sh, stagessrc/jsons/withsrc/generated/, and triggers onsrc/jsons/**andparseSchemas.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 futuregit add -fcannot 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 thesrc/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 forsrc/generated/.Tests:
Use cases covered
yarn installno longer ends up with a dirty working treeopenmetadata-spec/gets its dereferenced schemas auto-committed by the type-generation workflow, the same way TS types already areui-checkstylefor an unrelated PRUnit tests
Not applicable — no application code changed. The change is build configuration plus committed generator output.
Backend integration tests
Ingestion integration tests
Playwright (UI) tests
yarn installpreviously produced at build time).Manual testing performed
yarn parse-schemaon the final tree ->git status --porcelainempty. Regeneration is idempotent against the committed output, which is the property that was broken before.prettier --ignore-path .prettierignore -l 'src/jsons/**/*.json'-> 0 files. Same foreslint src/jsons/...(reports "File ignored") andlicense-check-and-add check(nosrc/jsonsentries).prettier -lon every changed non-generated file -> clean;bash -n scripts/ui-checkstyle-changed.sh-> ok; both workflow YAMLs andopenmetadata-ui/pom.xmlparse.httpsscheme) 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:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.🤖 Generated with Claude Code