Skip to content

fix(ui): untrack generated natsConnection.json to unblock UI Checkstyle - #32138

Merged
harshach merged 2 commits into
mainfrom
fix/ui-checkstyle-untrack-generated-nats-schema
Aug 27, 2026
Merged

harshach merged 2 commits into
mainfrom
fix/ui-checkstyle-untrack-generated-nats-schema

Conversation

@ShaileshParmar11

@ShaileshParmar11 ShaileshParmar11 commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

CI hotfix — no issue filed, main is currently red, so this carries the skip-pr-checks
label to bypass the linked-issue gate. Happy to file a tracking issue retroactively if
maintainers want it recorded.

UI Checkstyle has been failing on every PR since #32122 (NATS JetStream connector) merged. That PR force-added a generated file into git:

openmetadata-ui/src/main/resources/ui/src/jsons/connectionSchemas/connections/messaging/natsConnection.json

That whole tree is generated output. .gitignore:100 (#UI - Dereferenced Schemas) ignores it, and yarn parse-schema — which runs on every install via postinstall → build-check — rmSyncs src/jsons/connectionSchemas/connections and rewrites the whole tree from openmetadata-spec/.

The committed copy is prettier-formatted, not the JSON.stringify(obj, null, 2) form parseSchemas.js writes. It ended up that way because .prettierignore did not exclude src/jsons/ (ESLint does — eslint.config.mjs ignores src/jsons/connectionSchemas/**), so the NATS PR's own checkstyle run reformatted the file and the reformatted output was committed.

The two formats can never agree — JSON.stringify always expands arrays and never emits a trailing newline:

-      "enum": [
-        "Nats"
-      ],
+      "enum": ["Nats"],

100 diff lines in total, plus the trailing newline.

Result: on every CI run yarn install regenerates the file → the working tree is dirty before any check executes → whichever git status --porcelain gate in ui-checkstyle.yml runs first fails:

PR shape Failing step
touches src/**/*.{ts,tsx,js,jsx,json} ESLint + Prettier + Organise Imports (src)
any other UI change (e.g. package.json / yarn.lock) Licence Header

Evidence — #32136, a fast-uri dependency bump with zero UI source changes, whose licence step logged Inserted license into 0 file(s) and still exited 1:

❌ Licence Header

  • openmetadata-ui/src/main/resources/ui/src/jsons/connectionSchemas/connections/messaging/natsConnection.json

Merge-queue UI Checkstyle runs flipped from green to red at 2026-08-27T00:38Z, the minute the NATS commit landed.

This PR:

  1. Untracks the file (git rm --cached). It stays on disk and is rebuilt at install time; the spec source openmetadata-spec/.../messaging/natsConnection.json remains committed, and MessagingServiceUtils.ts dynamic-imports the generated path exactly like every other connector. Nothing about the NATS connector itself changes.
  2. Mirrors ESLint's ignore into .prettierignore (src/jsons/{connectionSchemas,ingestionSchemas,applicationSchemas}/) so prettier cannot fight parse-schema again if a generated schema is ever committed.

Note: #32131 attempted a fix by re-running prettier on the file — that could not hold, since parse-schema rewrites it on the next install. It was closed without merging.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • UI Checkstyle passes on a PR that touches only non-src UI files (previously failed at Licence Header)
  • UI Checkstyle passes on a PR that touches src/** (previously failed at ESLint + Prettier (src))
  • NATS connection form still renders — the schema is regenerated into the same path by yarn parse-schema

Unit tests

Not applicable — no logic changed. This removes a file from git tracking and adds three .prettierignore entries.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI behaviour changes).

Manual testing performed

  1. git ls-files openmetadata-ui/src/main/resources/ui/src/jsons → now returns only the two hand-authored files (profilerSettings.json, ssoSchemas/ssoConfigurationUISchema.json).
  2. git check-ignore -v <path> → now matches .gitignore:100, confirming the file is back under the ignore rule.
  3. Reproduced the failure mode and confirmed it is gone: overwrote the on-disk file with the exact JSON.stringify(…, null, 2) bytes parse-schema emits, then ran git status --porcelain — no entry for it. Before this change the same step reported it as modified, which is precisely what CI was tripping on.

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • 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 change — the spec source is untouched; only its generated artifact is untracked.)
  • For UI changes: I attached a screen recording and/or screenshots above. (N/A — no UI behaviour change.)
  • I have added a test that covers the exact scenario we are fixing. (N/A — the regression is a tracked build artifact, not code. .gitignore + .prettierignore are the guard; CI going green on this PR is the test.)

🤖 Generated with Claude Code

Greptile Summary

This CI hotfix removes a generated NATS connection schema from version control and prevents Prettier from modifying generated schema output.

  • Untracks natsConnection.json while retaining its committed source schema and install-time generation path.
  • Excludes generated connection, ingestion, governance, application, and configuration schemas from Prettier.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/.prettierignore Excludes the schema directories generated by parseSchemas.js, preventing formatting from dirtying regenerated output.
openmetadata-ui/src/main/resources/ui/src/jsons/connectionSchemas/connections/messaging/natsConnection.json Removes a generated schema artifact from tracking; the source schema remains committed and normal installation regenerates this path.

Reviews (2): Last reviewed commit: "fix(ui): cover all five parse-schema out..." | Re-trigger Greptile

src/jsons/connectionSchemas/** is generated output: .gitignore:100
ignores the tree, and `yarn parse-schema` (postinstall -> build-check)
rmSyncs and rewrites it on every install. #32122 force-added the NATS
connection schema into it, in prettier's formatting rather than the
`JSON.stringify(obj, null, 2)` form parseSchemas.js emits.

The two formats can never agree - JSON.stringify always expands arrays
and never writes a trailing newline - so every CI run regenerates the
file, dirties the working tree before any check executes, and fails
whichever `git status --porcelain` gate in ui-checkstyle.yml runs
first: "ESLint + Prettier (src)" for PRs touching src/**, "Licence
Header" for everything else. Merge-queue UI Checkstyle has been red
since the NATS commit landed.

Untrack the file - it is rebuilt at install time, and the spec source
under openmetadata-spec/ stays committed - and mirror ESLint's
`src/jsons/connectionSchemas/**` ignore into .prettierignore so
prettier cannot rewrite generated schemas again.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@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.

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Aug 27, 2026
runParsers() in parseSchemas.js regenerates connectionSchemas/connections,
ingestionSchemas, governanceSchemas, applicationSchemas and configuration.
The first pass listed only three, leaving governanceSchemas/ and
configuration/ open to the same prettier-vs-JSON.stringify conflict.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@gitar-bot

gitar-bot Bot commented Aug 27, 2026

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

Untracks the generated natsConnection.json artifact and adds .prettierignore entries to prevent formatting conflicts with generated schemas, addressing the missing .prettierignore coverage for generated governance/configuration directories. No issues found.

✅ 1 resolved
✅ Bug: .prettierignore misses generated governanceSchemas/configuration dirs

📄 openmetadata-ui/src/main/resources/ui/.prettierignore:52-54
parseSchemas.js regenerates five directories under src/jsons/: connectionSchemas/connections, ingestionSchemas, governanceSchemas, applicationSchemas, and configuration. The new .prettierignore entries cover only the first, second, and fourth, so a committed generated file under src/jsons/governanceSchemas/ or src/jsons/configuration/ could still be reformatted by prettier and cause the exact same CI dirty-tree regression this PR fixes. Add the two missing directories to fully guard the generated tree.

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

@ShaileshParmar11 ShaileshParmar11 added the skip-pr-checks Bypass PR metadata validation check label Aug 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 67%
67.16% (80195/119395) 51.65% (48803/94478) 52.67% (14719/27943)

@sonarqubecloud

Copy link
Copy Markdown

@ShaileshParmar11 ShaileshParmar11 self-assigned this Aug 27, 2026
@harshach
harshach disabled auto-merge August 27, 2026 05:35
@harshach
harshach merged commit 2ea9782 into main Aug 27, 2026
161 of 162 checks passed
@harshach
harshach deleted the fix/ui-checkstyle-untrack-generated-nats-schema branch August 27, 2026 05:35

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 skip-pr-checks Bypass PR metadata validation check UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants