Skip to content

Fixes #36189: Read Tailwind at-rules in the UI import guard - #36654

Merged
harshach merged 3 commits into
mainfrom
harshach/ontology-studio/08-ui-boundary-followup
Oct 30, 2026
Merged

harshach merged 3 commits into
mainfrom
harshach/ontology-studio/08-ui-boundary-followup

Conversation

@harshach

@harshach harshach commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #36189

Follow-up to #36642, closing two minors from its second review.

What the guard missed. uiImportBoundary.test.ts read relative specifiers in .less and .css files only after @import and url(. A relative path in Tailwind's @source, @reference, @plugin or @config, or in Less's data-uri(), could leave src/ and still pass. Collate copies only src/, so such a path resolves to nothing there. src/styles/tailwind.css already uses @source and @plugin.

What it reads now. STYLE_SPECIFIER also reads those four at-rules and data-uri(...), including the two-argument data-uri('mime', '../x') form. The existing @source '../**/*.{tsx,ts,jsx,js,css}' in tailwind.css is now read and resolves inside src/.

Record correction. Both decision records now name both Collate copy steps. copy-om-to-collate copies src/** except three test-setup files, and copy-om-playwright-to-collate copies the end-to-end tests in playwright/** into the same folder. Production code never imports end-to-end tests, so the rule is unchanged. The new record lists the forms the guard still does not read, such as an upper-case at-rule, @source not, a path built with a Less escape or variable, image-size() and Tailwind's source(...) option. It also names a path that climbs above the UI folder and comes back into src/, which resolves in OpenMetadata and to nothing in Collate. A reviewer checks those forms. Each record gets a revision entry and an amendment.

Red and green runs. Each line was appended temporarily and then restored. Each fails the guard at this head and passes it with the main pattern.

Temporary line This head main pattern
tailwind.css: @source '../../../openmetadata-ui-core-components/src/**/*.tsx'; FAIL PASS
tailwind.css: @reference '../../public/x.css'; FAIL PASS
tailwind.css: @plugin '../../vite/plugin.js'; FAIL PASS
tailwind.css: @config '../../tailwind.config.js'; FAIL PASS
KnowledgeCenterWidget.less: data-uri('../../../../public/x.png') FAIL PASS
KnowledgeCenterWidget.less: data-uri('image/svg+xml;charset=UTF-8', '../../../../public/x.svg') FAIL PASS

At this head, the guard passes (Tests: 1 passed).

Other checks.

  • Jest on uiImportBoundary, OntologyStudio.constants, OntologyStudio.utils and OntologyStudioQueryConsole: 4 suites, 42 tests passed.
  • tsc --noEmit error set is identical to main's (35 pre-existing errors, none in a changed file).
  • ESLint --max-warnings=0 and prettier --check pass on the changed file.
  • The Playwright impact map is up to date.
  • check_decision_records.py passes at df16d79ffc5.

🤖 Generated with Claude Code

The guard read relative specifiers in style files only after @import and
url(. A relative path in Tailwind's @source, @reference, @plugin or
@config, or in Less's data-uri(), could leave src/ and still pass, though
it resolves to nothing in Collate's copy of the UI. The guard now reads
all of them. The existing @source in src/styles/tailwind.css stays inside
src/ and passes.

Both decision records now name the two Collate copy steps:
copy-om-to-collate copies src/** except three test-setup files, and
copy-om-playwright-to-collate copies playwright/**. The rule is
unchanged. The new record's list of forms the guard does not read now
matches the widened pattern. Each record gets a revision entry and an
amendment.
@harshach harshach added the safe to test Add this label to run secure Github workflows on PRs label Oct 30, 2026
@harshach
harshach requested a review from a team as a code owner October 30, 2026 06:43
@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 80%
80.5% (134797/167435) 67.35% (48206/71569) 70.39% (27145/38562)

The new record now lists every style form the guard does not read,
including `@source not`, upper-case function names, a `data-uri()`
whose first argument is not quoted, and paths built from Less escapes
or variables. It also stops saying that every path leaving `src/`
resolves to nothing in Collate, because Collate copies `playwright/`
into the same folder.

The query console record's v2 amendment is back to its landed wording.
Records are append-only, and the v3 amendment already corrects it.
The record's list of style forms the guard does not read now names
Less's image-size(), image-width() and image-height() and Tailwind's
source(...) option, and ends with any other function or option that
takes a path, so it no longer reads as complete.

It also notes that the guard accepts a path that climbs above the UI
folder and comes back into src/. Such a path resolves in OpenMetadata
and to nothing in Collate.
@gitar-bot

gitar-bot Bot commented Oct 30, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Expanding the UI import-boundary regex changes which style references fail tests and could block builds if it misparses valid paths.

Extends the UI import boundary guard to read relative specifiers in Tailwind at-rules (@source, @reference, @plugin, @config) and Less data-uri(), so paths that escape src/ are caught before Collate's copy step. No issues found.

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

@sonarqubecloud

Copy link
Copy Markdown

@harshach
harshach merged commit 6cea3f6 into main Oct 30, 2026
66 checks passed
@harshach
harshach deleted the harshach/ontology-studio/08-ui-boundary-followup branch October 30, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ontology Studio: finish the native shell, tree and scoped Query experience

1 participant