Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
31478e5
Add pretty and eslint for openmetadata-ui-core-components for code qu…
aniketkatkar97 Mar 23, 2026
e67088c
Fix eslint errors
aniketkatkar97 Mar 23, 2026
e6fa812
Address comments
aniketkatkar97 Mar 23, 2026
f2df097
Address comments
aniketkatkar97 Mar 23, 2026
3f37ec3
update checkstyle workflow to check for core-components
aniketkatkar97 Mar 23, 2026
059b01f
work on comments
aniketkatkar97 Mar 23, 2026
b4b8493
change the workflow trigger for testing
aniketkatkar97 Mar 23, 2026
4edf723
Add console log for testing
aniketkatkar97 Mar 23, 2026
c2c5c2e
fix checkstyle yml
aniketkatkar97 Mar 23, 2026
e96df9f
Fix checkstyle
aniketkatkar97 Mar 23, 2026
4147533
Revert the console.log
aniketkatkar97 Mar 23, 2026
852fefc
Revert the trigger changes
aniketkatkar97 Mar 23, 2026
b969112
Worked on comments
aniketkatkar97 Mar 23, 2026
72a926a
Revert all progress-indicators.tsx changes
aniketkatkar97 Mar 23, 2026
b375386
Work on comments
aniketkatkar97 Mar 23, 2026
8a37fec
Update the checkstyle yml for testing
aniketkatkar97 Mar 23, 2026
c1c3e2e
add console log
aniketkatkar97 Mar 23, 2026
baf0131
update workflow
aniketkatkar97 Mar 23, 2026
368443a
test ui-checkstyle
aniketkatkar97 Mar 23, 2026
bad6c59
update workflow
chirag-madlani Mar 25, 2026
c0559a8
Add missing id
aniketkatkar97 Mar 25, 2026
a1da5d4
Merge remote-tracking branch 'origin/main' into core-components-pretty
aniketkatkar97 Mar 25, 2026
1fd7a10
Remove the console log
aniketkatkar97 Mar 25, 2026
0a18f96
Add and use core component nvmrc in checkstyle
aniketkatkar97 Mar 25, 2026
1bcf116
move the nvmrc to ui folder
aniketkatkar97 Mar 25, 2026
2672de6
test failure
aniketkatkar97 Mar 25, 2026
c641e89
remove console log
aniketkatkar97 Mar 25, 2026
daf11cd
Fix the checkstyle
aniketkatkar97 Mar 25, 2026
a25d116
Add prettier fix
aniketkatkar97 Mar 25, 2026
b662090
Fix the format
aniketkatkar97 Mar 25, 2026
a11a993
Update workflows and files
aniketkatkar97 Mar 25, 2026
3f60cc0
Fix playwright checkstyle
aniketkatkar97 Mar 25, 2026
fa064b8
Fix playwright changes
aniketkatkar97 Mar 25, 2026
b416ecc
Fix scripts
aniketkatkar97 Mar 25, 2026
c7ab426
failing commit
aniketkatkar97 Mar 25, 2026
a921ffc
Revert "failing commit"
aniketkatkar97 Mar 25, 2026
4e23ba4
Fix workflow
aniketkatkar97 Mar 25, 2026
37f4a2e
Work on comments
aniketkatkar97 Mar 25, 2026
b8c3ff0
Merge remote-tracking branch 'origin/main' into core-components-pretty
aniketkatkar97 Mar 25, 2026
4bdee8f
Merge branch 'main' into core-components-pretty
aniketkatkar97 Mar 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 116 additions & 12 deletions .github/workflows/ui-checkstyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- ".github/workflows/ui-checkstyle.yml"
- openmetadata-ui/src/main/resources/ui/playwright/**
- openmetadata-ui/src/main/resources/ui/eslint.config.mjs
- "openmetadata-ui-core-components/src/main/resources/ui/**"

permissions:
contents: read
Expand All @@ -35,14 +36,15 @@

env:
UI_WORKING_DIRECTORY: openmetadata-ui/src/main/resources/ui
CORE_COMPONENTS_WORKING_DIRECTORY: openmetadata-ui-core-components/src/main/resources/ui
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching the workflow from pull_request_target to pull_request can break PR commenting/updates (e.g., pull-requests: write) on PRs coming from forks because the GitHub token is read-only in that context. If you need automated PR comments, consider either (a) gating comment-writing steps to only run when github.event.pull_request.head.repo.full_name == github.repository, or (b) splitting into a safe pull_request check job (no comments) plus a pull_request_target job that only posts comments using trusted data.

Copilot uses AI. Check for mistakes.

jobs:
# ──────────────────────────────────────────────────────────────────────────
# Job 0: Authorize
# ──────────────────────────────────────────────────────────────────────────
authorize:
if: |
github.event_name == 'pull_request_target' &&
github.event_name == 'pull_request_target' &&
(github.event.action != 'labeled' || github.event.label.name == 'safe to test')
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -104,14 +106,14 @@
files_ignore: |
src/generated/**
files: |
src/**/*.{ts,tsx,js,jsx}
src/**/*.{ts,tsx,js,jsx,json}

- name: ESLint + Prettier + Organise Imports
id: lint
if: steps.changed-files.outputs.any_changed == 'true'
working-directory: ${{ env.UI_WORKING_DIRECTORY }}
env:
CHANGED_FILES: ${{ steps.changed-files.outputs.added_modified_files }}
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two operational issues here:

  1. all_changed_files can include deleted files; passing those paths to Prettier (--write) commonly fails because the files no longer exist. Prefer added_modified_files (or explicitly exclude deleted_files) for both UI and core-components lint steps.
  2. Switching from pull_request_target to pull_request can prevent PR commenting for contributions from forks (the token is typically read-only, even if the workflow requests pull-requests: write). If PR comments are required, consider keeping pull_request_target with appropriate safety gating, or change the workflow to report via checks/artifacts instead of writing PR comments.
Suggested change
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
CHANGED_FILES: ${{ steps.changed-files.outputs.added_modified_files }}

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Bug: all_changed_files includes deleted files, breaking lint on removal PRs

The switch from added_modified_files to all_changed_files in the tj-actions/changed-files output means deleted files will also be passed to ESLint and Prettier. When a PR removes a .ts/.tsx file, the lint step will attempt to process a file that no longer exists on disk, causing the CI job to fail with a file-not-found error.

This affects both the existing UI jobs (lines 116, 216, 576) and the new core-components job (line 779).

Suggested fix:

Use `added_modified_files` (the original value) instead of `all_changed_files`, or filter the list to exclude deleted files:

  CHANGED_FILES: ${{ steps.changed-files.outputs.added_modified_files }}

Was this helpful? React with 👍 / 👎 | Reply gitar fix to apply this suggestion

run: |
if [ -z "$CHANGED_FILES" ]; then
echo "No added or modified files to process."
Expand Down Expand Up @@ -150,13 +152,14 @@
### ❌ Lint Check Failed — ESLint + Prettier + Organise Imports (src)

The following files have style issues that need to be fixed:
${{ steps.lint.outputs.changed_files }}
${{ steps.changed-files.outputs.all_changed_files }}

**Fix locally:**
**Fix locally (fast — changed files only):**
```bash
cd openmetadata-ui/src/main/resources/ui
yarn ui-checkstyle
yarn ui-checkstyle:changed
```
Or to fix all files: `yarn ui-checkstyle`
edit-mode: replace

- name: Delete comment on success
Expand Down Expand Up @@ -211,7 +214,7 @@
if: steps.changed-files.outputs.any_changed == 'true'
working-directory: ${{ env.UI_WORKING_DIRECTORY }}
env:
CHANGED_FILES_ALL: ${{ steps.changed-files.outputs.added_modified_files }}
CHANGED_FILES_ALL: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
if [ -z "$CHANGED_FILES_ALL" ]; then
echo "No added or modified files to process."
Expand Down Expand Up @@ -248,7 +251,7 @@
### ❌ Licence Header Check Failed

The following files are missing or have outdated licence headers:
${{ steps.license.outputs.changed_files }}
${{ steps.changed-files.outputs.all_changed_files }}

**Fix locally:**
```bash
Expand Down Expand Up @@ -571,7 +574,7 @@
if: steps.changed-files.outputs.any_changed == 'true'
working-directory: ${{ env.UI_WORKING_DIRECTORY }}
env:
CHANGED_FILES: ${{ steps.changed-files.outputs.added_modified_files }}
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
if [ -z "$CHANGED_FILES" ]; then
echo "No added or modified files to process."
Expand Down Expand Up @@ -610,13 +613,14 @@
### ❌ Playwright Lint Check Failed — ESLint + Prettier + Organise Imports

The following files have style issues that need to be fixed:
${{ steps.lint.outputs.changed_files }}
${{ steps.changed-files.outputs.all_changed_files }}

**Fix locally:**
**Fix locally (fast — changed files only):**
```bash
cd openmetadata-ui/src/main/resources/ui
yarn ui-checkstyle:playwright
yarn ui-checkstyle:playwright:changed
```
Or to fix all playwright files: `yarn ui-checkstyle:playwright`
edit-mode: replace

- name: Delete comment on success
Expand Down Expand Up @@ -734,3 +738,103 @@
repo: context.repo.repo,
comment_id: process.env.COMMENT_ID
})

# ──────────────────────────────────────────────────────────────────────────
# Job 8: Core Components — ESLint + Prettier
# ──────────────────────────────────────────────────────────────────────────
lint-core-components:
needs: authorize
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching from pull_request_target to pull_request improves security, but it also commonly removes pull-requests: write capabilities for PRs originating from forks (GitHub restricts the GITHUB_TOKEN to read-only in that case). The steps that create/update/delete PR comments can fail due to insufficient permissions. Consider gating PR-comment steps to same-repo PRs (e.g., if: github.event.pull_request.head.repo.full_name == github.repository), or splitting comments into a pull_request_target workflow that only reads artifacts/results and never checks out untrusted code.

Copilot uses AI. Check for mistakes.
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version-file: "${{ env.CORE_COMPONENTS_WORKING_DIRECTORY }}/.nvmrc"
cache: yarn
cache-dependency-path: "${{ env.CORE_COMPONENTS_WORKING_DIRECTORY }}/yarn.lock"

- name: Install Yarn Packages
Comment thread Fixed
Comment on lines +757 to +763

Check failure

Code scanning / CodeQL

Checkout of untrusted code in a privileged context Critical

Potential execution of untrusted code on a privileged workflow (
pull_request_target
)
working-directory: ${{ env.CORE_COMPONENTS_WORKING_DIRECTORY }}
run: yarn install --frozen-lockfile


- name: Get changed core-components files
Comment on lines +763 to +768

Check failure

Code scanning / CodeQL

Checkout of untrusted code in a privileged context Critical

Potential execution of untrusted code on a privileged workflow (
pull_request_target
)
id: changed-files
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323
with:
path: ${{ env.CORE_COMPONENTS_WORKING_DIRECTORY }}
files: |
src/**/*.{ts,tsx,js,jsx,json}
Comment thread
gitar-bot[bot] marked this conversation as resolved.

- name: ESLint + Prettier (core-components)
id: lint
if: steps.changed-files.outputs.any_changed == 'true'
working-directory: ${{ env.CORE_COMPONENTS_WORKING_DIRECTORY }}
env:
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
Comment on lines +776 to +782
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two operational issues here:

  1. all_changed_files can include deleted files; passing those paths to Prettier (--write) commonly fails because the files no longer exist. Prefer added_modified_files (or explicitly exclude deleted_files) for both UI and core-components lint steps.
  2. Switching from pull_request_target to pull_request can prevent PR commenting for contributions from forks (the token is typically read-only, even if the workflow requests pull-requests: write). If PR comments are required, consider keeping pull_request_target with appropriate safety gating, or change the workflow to report via checks/artifacts instead of writing PR comments.

Copilot uses AI. Check for mistakes.
if [ -z "${CHANGED_FILES// }" ]; then
echo "No added or modified files to process."
exit 0
fi
yarn lint:base --fix $CHANGED_FILES
yarn pretty:base --write $CHANGED_FILES
Comment on lines +787 to +788
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using all_changed_files can include deleted/renamed paths depending on the action output, which will make eslint/prettier fail when they receive non-existent files. Also, including *.json here means ESLint may error or warn unless JSON is explicitly supported in the ESLint config. A safer approach is to use only added/modified files for ESLint/Prettier inputs (e.g., added_modified_files) and either exclude json from ESLint inputs or add a JSON parser/plugin/config for JSON files.

Copilot uses AI. Check for mistakes.
if [ -n "$(git status --porcelain)" ]; then
FILES=$(git status --porcelain | awk '{print " - `" $2 "`"}' | head -30)
echo "changed_files<<EOF" >> "$GITHUB_OUTPUT"
echo "$FILES" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
git checkout -- .
git clean -fd
exit 1
fi

- name: Find existing lint comment
Comment on lines +776 to +799

Check failure

Code scanning / CodeQL

Checkout of untrusted code in a privileged context Critical

Potential execution of untrusted code on a privileged workflow (
pull_request_target
)
if: always()
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: github-actions[bot]
body-includes: '<!-- check:lint-core-components -->'

- name: Post failure comment
if: failure()
Comment on lines +808 to +809
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching from pull_request_target to pull_request improves security, but it also commonly removes pull-requests: write capabilities for PRs originating from forks (GitHub restricts the GITHUB_TOKEN to read-only in that case). The steps that create/update/delete PR comments can fail due to insufficient permissions. Consider gating PR-comment steps to same-repo PRs (e.g., if: github.event.pull_request.head.repo.full_name == github.repository), or splitting comments into a pull_request_target workflow that only reads artifacts/results and never checks out untrusted code.

Copilot uses AI. Check for mistakes.
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
<!-- check:lint-core-components -->
### ❌ Lint Check Failed — ESLint + Prettier (core-components)

The following files have style issues that need to be fixed:
${{ steps.changed-files.outputs.all_changed_files }}

**Fix locally (fast — changed files only):**
```bash
cd openmetadata-ui-core-components/src/main/resources/ui
yarn ui-checkstyle:changed
```
Or to fix all files: `yarn lint:fix && yarn pretty`
edit-mode: replace

- name: Delete comment on success
if: success() && steps.fc.outputs.comment-id != ''
uses: actions/github-script@v7
env:
COMMENT_ID: ${{ steps.fc.outputs.comment-id }}
with:
script: |
github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: process.env.COMMENT_ID
})
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.17.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2021 Collate
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Node
node/

# Dependencies
node_modules/

# Production
build/
dist/

# macOS
.DS_Store

# Ignore files (Prettier has trouble parsing files without extension)
.gitignore
.prettierignore

# Assets
*.gif
*.svg
*.png
*.ico
*.ttf
*.md
*.webp
*.jpg
*.jpeg

# Snapshots
*.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#
# Copyright 2022 Collate.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
---
tabWidth: 2
bracketSameLine: true
htmlWhitespaceSensitivity: 'strict'
singleQuote: true
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
body {
font-family: "Inter", "Poppins", sans-serif;
font-family: 'Inter', 'Poppins', sans-serif;
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import "@fontsource/inter/400.css";
import "@fontsource/inter/500.css";
import "@fontsource/inter/600.css";
import "@fontsource/inter/700.css";
import "@fontsource/inter/800.css";
import "@fontsource/inter/900.css";
import type { Preview, StoryFn } from "@storybook/react";
import "../src/styles/storybook.css";
import "./index.css";
import '@fontsource/inter/400.css';
import '@fontsource/inter/500.css';
import '@fontsource/inter/600.css';
import '@fontsource/inter/700.css';
import '@fontsource/inter/800.css';
import '@fontsource/inter/900.css';
import type { Preview, StoryFn } from '@storybook/react';
import '../src/styles/storybook.css';
import './index.css';

const preview: Preview = {
parameters: {
Expand Down
Loading
Loading