Skip to content

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

Closed

Description

@harsh-vador

Problem

openmetadata-ui/src/main/resources/ui/src/jsons/** holds 279 dereferenced JSON schemas produced by parseSchemas.js. They are gitignored and regenerated on every yarn install, via postinstall -> build-check -> parse-schema.

That arrangement is fragile in two ways:

  1. A force-added file breaks CI for everyone. ui-checkstyle gates on git status --porcelain after running yarn install. If any file under src/jsons/ is tracked and its committed bytes do not match generator output, the tree is dirty before any linting runs, and the job fails on every PR regardless of what that PR changed. The reported failure is attributed to whichever sub-check ran (ESLint/Prettier, Licence Header), which makes it read as a lint problem when it is not. This happened with Fixes #28152: Add NATS JetStream Messaging Connector #32122 and was hotfixed by fix(ui): untrack generated natsConnection.json to unblock UI Checkstyle #32138.
  2. The work is repeated on every install for output that is fully determined by openmetadata-spec/.

Two files force-added by #29964 (profilerSettings.json, ssoSchemas/ssoConfigurationUISchema.json) remain tracked today and are the same latent trap.

Proposal

Handle these the same way src/generated/ TypeScript types are already handled: commit the generated output, stop regenerating it during install, and keep it in sync with a CI auto-update job.

  • Drop the src/jsons/* ignore rule; track all 279 files
  • Remove parse-schema from build-check, so neither yarn install nor the Maven build rewrites tracked files (yarn parse-schema stays available for manual regeneration)
  • Exclude src/jsons/ from Prettier, the licence-header check, and ESLint, so no formatter can reintroduce drift between committed files and generator output
  • Extend typescript-type-generation.yml to run yarn parse-schema and stage src/jsons/ alongside src/generated/

Trade-off

Dereferenced schemas are large (workflow.json ~21k lines, testSuitePipeline.json ~16k). Spec changes will produce proportionally large diffs, auto-committed by the bot. This is the same trade-off already accepted for src/generated/.

Discussed with @chirag-madlani and @karanh37 — agreed to commit them and drop the install-time regeneration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    UI

    Type

    No type

    Projects

    • Status
      Done ✅

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions