Skip to content

Update eslint to v9.x and other dependencies#578

Open
celdrake wants to merge 3 commits intoflightctl:mainfrom
celdrake:eslint-9.x
Open

Update eslint to v9.x and other dependencies#578
celdrake wants to merge 3 commits intoflightctl:mainfrom
celdrake:eslint-9.x

Conversation

@celdrake
Copy link
Collaborator

@celdrake celdrake commented Mar 18, 2026

  • Updates eslint from deprecated v8.57.1 to v9.39.x, and its associated plugins. This activated some new or existing linting rules.
  • Fixes multiple security issues:
  1. serialize-javascript updated to v7.0.4 to fix https://github.com/flightctl/flightctl-ui/security/dependabot/90
  2. svgo updated to v4.0.1 to fix https://github.com/flightctl/flightctl-ui/security/dependabot/91
  3. qs updated to v6.14.2 to fix https://github.com/flightctl/flightctl-ui/security/dependabot/77
  4. webpack updated to v5.105.4 for the entire project to fix https://github.com/flightctl/flightctl-ui/security/dependabot/20 and the rest of webpack-related issues.

Summary by CodeRabbit

  • Chores

    • Replaced legacy linting setup with a new ESLint configuration and updated linting packages.
    • Updated webpack and other build-related dev dependencies.
  • New Features

    • Switched multiple UI areas to use the standard design system DescriptionList component.
  • Refactor

    • Made conditional checks and error-handling blocks more explicit and consistent across the codebase.

@celdrake celdrake changed the title Eslint 9.x Update eslint to v9.x and other dependencies Mar 18, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

Walkthrough

Deleted legacy .eslintrc.js and added eslint.config.js; updated ESLint/tooling and app webpack devDependencies; removed FlightCtlDescriptionList and replaced usages with PatternFly DescriptionList; switched several Form/flight-form wrappers; standardized numerous catch/conditional patterns and normalized thrown errors.

Changes

Cohort / File(s) Summary
ESLint Migration & Tooling
/.eslintrc.js, /eslint.config.js, /package.json
Removed legacy .eslintrc.js, added new flat eslint.config.js (defineConfig + FlatCompat usage) and updated eslint-related devDependencies and related tooling versions.
App build deps
apps/ocp-plugin/package.json, apps/standalone/package.json
Bumped webpack and related build plugins (css-minimizer-webpack-plugin, copy-webpack-plugin) in app package.json files.
Removed FlightCtlDescriptionList + replacements
libs/ui-components/src/components/common/FlightCtlDescriptionList.tsx, libs/ui-components/src/components/.../ReviewStep.tsx, .../DeviceDetailsTab.tsx, .../StatusContent.tsx, .../SystemResourcesContent.tsx, .../ReviewDeviceStep.tsx, .../EnrollmentRequestDetails.tsx, .../FleetDetailsContent.tsx, .../ImageBuilds/.../ReviewStep.tsx, .../ImageBuildDetailsTab.tsx, .../RepositoryGeneralDetailsCard.tsx, .../ImageBuildDetailsTab.tsx
Deleted local FlightCtlDescriptionList wrapper and replaced its usages with PatternFly DescriptionList across many UI components; updated imports and opening/closing tags accordingly.
Form wrapper change
libs/ui-components/src/components/Catalog/DeprecateModal.tsx
Replaced PatternFly Form wrapper with project FlightCtlForm, updated imports and JSX wrapper.
Catch pattern changes (many files)
apps/standalone/src/app/components/Login/LoginPage.tsx, apps/standalone/src/app/context/AuthContext.ts, libs/ui-components/src/components/Login/TokenLoginForm.tsx, libs/ui-components/src/components/Masthead/CommandLineToolsPage.tsx, libs/ui-components/src/components/ResourceSync/ResourceSyncToRepository.tsx, libs/ui-components/src/components/common/OrganizationSelector.tsx, libs/ui-components/src/components/form/NameField.tsx, libs/ui-components/src/components/form/validations.ts, libs/ui-components/src/components/modals/LoginCommandModal/LoginCommandModal.tsx, libs/ui-components/src/components/modals/massModals/ResumeDevicesModal/MassResumeDevicesModal.tsx, libs/ui-components/src/hooks/useDeviceSpecSystemInfo.tsx, libs/ui-components/src/utils/apiCalls.ts
Replaced named catch bindings (e.g., catch (e)) with bare catch { } in multiple places, removing unused error variable bindings while preserving behavior.
Conditional / control-flow explicitness
apps/standalone/src/app/components/AppLayout/AppLayout.tsx, apps/standalone/src/app/utils/apiCalls.ts, libs/ui-components/src/components/Catalog/CatalogPage.tsx, libs/ui-components/src/components/Device/DevicesPage/DeviceToolbarFilters.tsx, libs/ui-components/src/components/EnrollmentRequest/EnrollmentRequestList.tsx, libs/ui-components/src/components/Terminal/Terminal.tsx, libs/ui-components/src/components/form/RichValidationTextField.tsx
Replaced short-circuit expressions and ternaries with explicit if / if...else blocks for clarity; logic unchanged.
Error throwing standardization
libs/ui-components/src/components/Catalog/EditWizard/EditAppWizard.tsx, libs/ui-components/src/components/Catalog/InstallWizard/InstallAppWizard.tsx
Changed thrown errors from string/translation values to new Error(...) objects when catalog item version is missing.
Minor UI / navigation tweaks
libs/ui-components/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx, libs/ui-components/src/components/Terminal/Terminal.tsx
Replaced short-circuit navigation with explicit if guards; made terminal/ref checks explicit before calling term.open and observer methods.
Misc small refactors
libs/ui-components/src/components/Catalog/DeprecateModal.tsx, libs/ui-components/src/components/ImageBuilds/.../ReviewStep.tsx, various Device/ImageBuild/Repository components
Small import/JSX adjustments related to DescriptionList replacements and minor control-flow or error-handling tweaks.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: upgrading ESLint to v9.x and updating related dependencies, which is the primary focus of the pull request and dominates the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

// eslint-disable-next-line no-restricted-imports
import { DescriptionList, DescriptionListProps } from '@patternfly/react-core';

// Wrapper that adds the PF4 class for description lists as their styles are not loaded in the Console
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The PF4 class is no longer relevant.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (2)
libs/ui-components/src/components/ResourceSync/ResourceSyncToRepository.tsx (1)

33-35: Consider logging the actual error for debugging.

While the bare catch is valid (the user-facing message intentionally uses rsId for context), the actual error from the API call is now completely discarded. This could make debugging production issues harder.

💡 Optional: Log the error for debugging
-      } catch {
+      } catch (e) {
+        // eslint-disable-next-line no-console
+        console.error('Failed to fetch resource sync:', e);
         setError(t('Resource sync {{rsId}} could not be found', { rsId }));
       }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@libs/ui-components/src/components/ResourceSync/ResourceSyncToRepository.tsx`
around lines 33 - 35, The catch block in ResourceSyncToRepository.tsx swallows
the API error; update the bare catch to capture the error (e.g., catch (err))
and log it for debugging before calling setError — include contextual info like
rsId in the log. Keep the user-facing setError(t(...)) as-is but add a
console.error or project logger call (e.g., console.error or logger.error)
referencing the caught error and rsId so failures in the API call are recorded.
eslint.config.js (1)

22-35: Consider using projectService instead of project: true for better performance and scalability in typescript-eslint v8.

The first config object applies @typescript-eslint/parser with parserOptions.project: true to all source files being linted. While this works, typescript-eslint v8 recommends migrating to projectService: true, which automatically detects the nearest tsconfig per file and requires less setup. When upgrading, pair it with tsconfigRootDir: import.meta.dirname for correct path resolution. The second config object (lines 129-146) only modifies rules and does not change the parser setup, so it does not affect this scope.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@eslint.config.js` around lines 22 - 35, Replace parserOptions.project: true
inside the languageOptions block with projectService: true and add
tsconfigRootDir using import.meta.dirname to ensure correct tsconfig resolution;
specifically modify the languageOptions object that sets parser: tsParser and
parserOptions to remove project: true, add projectService: true, and set
tsconfigRootDir: import.meta.dirname so typescript-eslint v8 will auto-detect
per-file tsconfig files and improve performance.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/standalone/package.json`:
- Around line 23-25: The dependency entry for copy-webpack-plugin in
package.json is pointing to a non-existent version (^14.0.0); update the
"copy-webpack-plugin" dependency string to a valid published version (for
example "9.1.0" or a compatible range like "^9.1.0") so npm/yarn can install it;
locate the "copy-webpack-plugin" key in apps/standalone/package.json and replace
the version value, then run install to verify resolution.

In `@eslint.config.js`:
- Around line 73-89: The replacement messages are inconsistent and missing
slashes: update the '@patternfly/react-icons' messages to use
'dist/js/icons/<icon>' (add the '/' before the placeholder) and update the
'@patternfly/react-tokens' group message to match the tokens path rule by
pointing to 'dist/js/<token>' instead of 'dist/js/icons<icon>'; ensure both the
group entries (group: ['@patternfly/react-icons/dist/esm**'] and group:
['@patternfly/react-tokens/dist/esm**']) and the paths entries (name:
'@patternfly/react-icons' and name: '@patternfly/react-tokens') use the
corrected, consistent strings with the '/' separators and the correct token vs
icon placeholders.

In `@libs/ui-components/src/components/Catalog/CatalogPage.tsx`:
- Around line 239-243: The filter predicate uses incorrect operator precedence:
change the comparison in the setCatalogs call inside CatalogPage so the
empty-string fallback applies to item.id rather than the entire boolean
expression; e.g., use c !== (item.id || '') or compute const id = item.id || ''
and then call catalogFilter.setCatalogs((catalogs) => catalogs.filter((c) => c
!== id)); update the matching add branch to use the same id variable (item.id ||
'') so both branches are consistent (references: catalogFilter.setCatalogs,
catalogFilter.catalogs, item.id).

In `@libs/ui-components/src/components/Masthead/CommandLineToolsPage.tsx`:
- Around line 124-126: The catch block currently turns off the feature by
calling setArtifactsEnabled(false) for any exception; change it so generic
fetch/parse errors are not treated as "feature disabled": remove the
unconditional setArtifactsEnabled(false) from the catch, and either rethrow the
caught error or set a distinct load-error state (e.g., setArtifactsLoadError) so
callers can handle API failures; only call setArtifactsEnabled(false) when you
can deterministically detect the feature is disabled (e.g., based on a specific
response flag or a 4xx/feature-disabled status). Ensure you update the catch in
the same async function/useEffect where setArtifactsEnabled is used and keep the
symbol names (setArtifactsEnabled, and the async loader function) to locate the
change.

---

Nitpick comments:
In `@eslint.config.js`:
- Around line 22-35: Replace parserOptions.project: true inside the
languageOptions block with projectService: true and add tsconfigRootDir using
import.meta.dirname to ensure correct tsconfig resolution; specifically modify
the languageOptions object that sets parser: tsParser and parserOptions to
remove project: true, add projectService: true, and set tsconfigRootDir:
import.meta.dirname so typescript-eslint v8 will auto-detect per-file tsconfig
files and improve performance.

In `@libs/ui-components/src/components/ResourceSync/ResourceSyncToRepository.tsx`:
- Around line 33-35: The catch block in ResourceSyncToRepository.tsx swallows
the API error; update the bare catch to capture the error (e.g., catch (err))
and log it for debugging before calling setError — include contextual info like
rsId in the log. Keep the user-facing setError(t(...)) as-is but add a
console.error or project logger call (e.g., console.error or logger.error)
referencing the caught error and rsId so failures in the API call are recorded.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b64152d4-ef30-47a8-9c5e-f796f4df5f69

📥 Commits

Reviewing files that changed from the base of the PR and between d7b8a07 and 1136fd0.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (38)
  • .eslintrc.js
  • apps/ocp-plugin/package.json
  • apps/standalone/package.json
  • apps/standalone/src/app/components/AppLayout/AppLayout.tsx
  • apps/standalone/src/app/components/Login/LoginPage.tsx
  • apps/standalone/src/app/context/AuthContext.ts
  • apps/standalone/src/app/utils/apiCalls.ts
  • eslint.config.js
  • libs/ui-components/src/components/Catalog/CatalogPage.tsx
  • libs/ui-components/src/components/Catalog/DeprecateModal.tsx
  • libs/ui-components/src/components/Catalog/EditWizard/EditAppWizard.tsx
  • libs/ui-components/src/components/Catalog/InstallWizard/InstallAppWizard.tsx
  • libs/ui-components/src/components/Device/DeviceDetails/DeviceDetailsTab.tsx
  • libs/ui-components/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.tsx
  • libs/ui-components/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.tsx
  • libs/ui-components/src/components/Device/DevicesPage/DeviceToolbarFilters.tsx
  • libs/ui-components/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.tsx
  • libs/ui-components/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx
  • libs/ui-components/src/components/EnrollmentRequest/EnrollmentRequestList.tsx
  • libs/ui-components/src/components/Fleet/CreateFleet/steps/ReviewStep.tsx
  • libs/ui-components/src/components/Fleet/FleetDetails/FleetDetailsContent.tsx
  • libs/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/ReviewStep.tsx
  • libs/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsTab.tsx
  • libs/ui-components/src/components/Login/TokenLoginForm.tsx
  • libs/ui-components/src/components/Masthead/CommandLineToolsPage.tsx
  • libs/ui-components/src/components/Repository/RepositoryDetails/RepositoryGeneralDetailsCard.tsx
  • libs/ui-components/src/components/ResourceSync/ResourceSyncToRepository.tsx
  • libs/ui-components/src/components/Terminal/Terminal.tsx
  • libs/ui-components/src/components/common/FlightCtlDescriptionList.tsx
  • libs/ui-components/src/components/common/OrganizationSelector.tsx
  • libs/ui-components/src/components/form/NameField.tsx
  • libs/ui-components/src/components/form/RichValidationTextField.tsx
  • libs/ui-components/src/components/form/validations.ts
  • libs/ui-components/src/components/modals/LoginCommandModal/LoginCommandModal.tsx
  • libs/ui-components/src/components/modals/massModals/ResumeDevicesModal/MassResumeDevicesModal.tsx
  • libs/ui-components/src/hooks/useDeviceSpecSystemInfo.tsx
  • libs/ui-components/src/utils/apiCalls.ts
  • package.json
💤 Files with no reviewable changes (2)
  • libs/ui-components/src/components/common/FlightCtlDescriptionList.tsx
  • .eslintrc.js

@celdrake celdrake force-pushed the eslint-9.x branch 2 times, most recently from 9c94140 to daa9764 Compare March 18, 2026 10:04
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (2)
eslint.config.js (2)

84-85: ⚠️ Potential issue | 🟡 Minor

Fix the icon path placeholder.

Missing / separator before <icon>.

Suggested fix
             {
               name: '@patternfly/react-icons',
-              message: 'Import using full path `@patternfly/react-icons/dist/js/icons<icon>` instead',
+              message: 'Import using full path `@patternfly/react-icons/dist/js/icons/<icon>` instead',
             },

,

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@eslint.config.js` around lines 84 - 85, Update the message string for the
'@patternfly/react-icons' rule in eslint.config.js to include the missing '/'
before the <icon> placeholder (change "...dist/js/icons<icon>..." to
"...dist/js/icons/<icon>...") so the suggested import path is correct.

73-78: ⚠️ Potential issue | 🟡 Minor

Fix the replacement-path messages.

The message on line 78 for @patternfly/react-tokens incorrectly references icons<icon> instead of <token>. Additionally, lines 74 and 85 are missing the / separator before the placeholder.

Suggested fix
             {
               group: ['@patternfly/react-icons/dist/esm**'],
-              message: 'Import using the full js path `@patternfly/react-icons/dist/js/icons<icon>` instead',
+              message: 'Import using the full js path `@patternfly/react-icons/dist/js/icons/<icon>` instead',
             },
             {
               group: ['@patternfly/react-tokens/dist/esm**'],
-              message: 'Import using the full js path `@patternfly/react-tokens/dist/js/icons<icon>` instead',
+              message: 'Import using the full js path `@patternfly/react-tokens/dist/js/<token>` instead',
             },

,

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@eslint.config.js` around lines 73 - 78, Update the replacement messages in
eslint.config.js for the PatternFly rules: in the rule object using group
['@patternfly/react-icons/dist/esm**'] change the message path to include a
slash before the placeholder (use
`@patternfly/react-icons/dist/js/icons/<icon>`), and in the rule object using
group ['@patternfly/react-tokens/dist/esm**'] change both the path to include
the slash and the placeholder name to `<token>` (use
`@patternfly/react-tokens/dist/js/tokens/<token>`); locate these messages by
their group values and update the message strings accordingly.
🧹 Nitpick comments (2)
eslint.config.js (2)

119-122: Remove rules for plugins that aren't loaded.

These rules reference prettier and import plugins that aren't included in this configuration. ESLint will either warn about unknown rules or silently ignore them.

Suggested fix
       '@typescript-eslint/interface-name-prefix': 'off',
-      'prettier/prettier': 'off',
-      'import/no-unresolved': 'off',
-      'import/extensions': 'off',
       'no-console': 'error',
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@eslint.config.js` around lines 119 - 122, The config currently lists rules
'prettier/prettier', 'import/no-unresolved', and 'import/extensions' but the
corresponding plugins aren't loaded; remove those rule entries from the rules
object in eslint.config.js (or alternatively install and add the 'prettier' and
'import' plugins to the configuration) so ESLint no longer references unknown
rules; specifically update the rules block that contains
'@typescript-eslint/interface-name-prefix', 'prettier/prettier',
'import/no-unresolved', 'import/extensions' by deleting the unused
'prettier/...' and 'import/...' lines or by adding the plugins to the top-level
plugins array and configuring them.

119-119: Remove non-existent rule reference.

The rule @typescript-eslint/interface-name-prefix was removed in @typescript-eslint v3.0.0 (May 2020). Since this config uses v8.57.1, this rule no longer exists and should be removed.

Suggested fix
-      '@typescript-eslint/interface-name-prefix': 'off',
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@eslint.config.js` at line 119, Remove the obsolete ESLint rule reference
'@typescript-eslint/interface-name-prefix' from the ESLint configuration (the
string '@typescript-eslint/interface-name-prefix' in the rules block) because it
was removed in `@typescript-eslint` v3+; simply delete that entry from the rules
object so the config only contains valid/available rule names for the current
`@typescript-eslint` version.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@eslint.config.js`:
- Around line 43-47: Update the ESLint extends entry that uses the old config
name: replace the string
'plugin:`@typescript-eslint/recommended-requiring-type-checking`' inside the
extends call (the compat.extends invocation) with the new name
'plugin:`@typescript-eslint/recommended-type-checked`' so the extends array in
eslint.config.js uses the v8-compatible config.

---

Duplicate comments:
In `@eslint.config.js`:
- Around line 84-85: Update the message string for the '@patternfly/react-icons'
rule in eslint.config.js to include the missing '/' before the <icon>
placeholder (change "...dist/js/icons<icon>..." to "...dist/js/icons/<icon>...")
so the suggested import path is correct.
- Around line 73-78: Update the replacement messages in eslint.config.js for the
PatternFly rules: in the rule object using group
['@patternfly/react-icons/dist/esm**'] change the message path to include a
slash before the placeholder (use
`@patternfly/react-icons/dist/js/icons/<icon>`), and in the rule object using
group ['@patternfly/react-tokens/dist/esm**'] change both the path to include
the slash and the placeholder name to `<token>` (use
`@patternfly/react-tokens/dist/js/tokens/<token>`); locate these messages by
their group values and update the message strings accordingly.

---

Nitpick comments:
In `@eslint.config.js`:
- Around line 119-122: The config currently lists rules 'prettier/prettier',
'import/no-unresolved', and 'import/extensions' but the corresponding plugins
aren't loaded; remove those rule entries from the rules object in
eslint.config.js (or alternatively install and add the 'prettier' and 'import'
plugins to the configuration) so ESLint no longer references unknown rules;
specifically update the rules block that contains
'@typescript-eslint/interface-name-prefix', 'prettier/prettier',
'import/no-unresolved', 'import/extensions' by deleting the unused
'prettier/...' and 'import/...' lines or by adding the plugins to the top-level
plugins array and configuring them.
- Line 119: Remove the obsolete ESLint rule reference
'@typescript-eslint/interface-name-prefix' from the ESLint configuration (the
string '@typescript-eslint/interface-name-prefix' in the rules block) because it
was removed in `@typescript-eslint` v3+; simply delete that entry from the rules
object so the config only contains valid/available rule names for the current
`@typescript-eslint` version.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 776a6fd1-5ee8-4d9b-b1a2-3c19cd55728d

📥 Commits

Reviewing files that changed from the base of the PR and between 9c94140 and daa9764.

📒 Files selected for processing (34)
  • apps/standalone/src/app/components/AppLayout/AppLayout.tsx
  • apps/standalone/src/app/components/Login/LoginPage.tsx
  • apps/standalone/src/app/context/AuthContext.ts
  • apps/standalone/src/app/utils/apiCalls.ts
  • eslint.config.js
  • libs/ui-components/src/components/Catalog/CatalogPage.tsx
  • libs/ui-components/src/components/Catalog/DeprecateModal.tsx
  • libs/ui-components/src/components/Catalog/EditWizard/EditAppWizard.tsx
  • libs/ui-components/src/components/Catalog/InstallWizard/InstallAppWizard.tsx
  • libs/ui-components/src/components/Device/DeviceDetails/DeviceDetailsTab.tsx
  • libs/ui-components/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.tsx
  • libs/ui-components/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.tsx
  • libs/ui-components/src/components/Device/DevicesPage/DeviceToolbarFilters.tsx
  • libs/ui-components/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.tsx
  • libs/ui-components/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx
  • libs/ui-components/src/components/EnrollmentRequest/EnrollmentRequestList.tsx
  • libs/ui-components/src/components/Fleet/CreateFleet/steps/ReviewStep.tsx
  • libs/ui-components/src/components/Fleet/FleetDetails/FleetDetailsContent.tsx
  • libs/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/ReviewStep.tsx
  • libs/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsTab.tsx
  • libs/ui-components/src/components/Login/TokenLoginForm.tsx
  • libs/ui-components/src/components/Masthead/CommandLineToolsPage.tsx
  • libs/ui-components/src/components/Repository/RepositoryDetails/RepositoryGeneralDetailsCard.tsx
  • libs/ui-components/src/components/ResourceSync/ResourceSyncToRepository.tsx
  • libs/ui-components/src/components/Terminal/Terminal.tsx
  • libs/ui-components/src/components/common/FlightCtlDescriptionList.tsx
  • libs/ui-components/src/components/common/OrganizationSelector.tsx
  • libs/ui-components/src/components/form/NameField.tsx
  • libs/ui-components/src/components/form/RichValidationTextField.tsx
  • libs/ui-components/src/components/form/validations.ts
  • libs/ui-components/src/components/modals/LoginCommandModal/LoginCommandModal.tsx
  • libs/ui-components/src/components/modals/massModals/ResumeDevicesModal/MassResumeDevicesModal.tsx
  • libs/ui-components/src/hooks/useDeviceSpecSystemInfo.tsx
  • libs/ui-components/src/utils/apiCalls.ts
💤 Files with no reviewable changes (1)
  • libs/ui-components/src/components/common/FlightCtlDescriptionList.tsx
🚧 Files skipped from review as they are similar to previous changes (15)
  • libs/ui-components/src/components/ResourceSync/ResourceSyncToRepository.tsx
  • libs/ui-components/src/components/Catalog/EditWizard/EditAppWizard.tsx
  • libs/ui-components/src/components/Login/TokenLoginForm.tsx
  • libs/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/ReviewStep.tsx
  • libs/ui-components/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.tsx
  • libs/ui-components/src/components/Repository/RepositoryDetails/RepositoryGeneralDetailsCard.tsx
  • libs/ui-components/src/components/Device/DevicesPage/DeviceToolbarFilters.tsx
  • libs/ui-components/src/components/Catalog/CatalogPage.tsx
  • libs/ui-components/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.tsx
  • libs/ui-components/src/hooks/useDeviceSpecSystemInfo.tsx
  • libs/ui-components/src/components/form/validations.ts
  • apps/standalone/src/app/components/AppLayout/AppLayout.tsx
  • libs/ui-components/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx
  • libs/ui-components/src/components/EnrollmentRequest/EnrollmentRequestList.tsx
  • libs/ui-components/src/components/Catalog/DeprecateModal.tsx

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
libs/ui-components/src/components/Masthead/CommandLineToolsPage.tsx (1)

124-126: ⚠️ Potential issue | 🟠 Major

Do not treat generic load failures as “artifacts feature disabled.”

At Line 124 and Line 125, the catch path still sets hasArtifactsEnabled to false for any exception, which conflates transient fetch/parse failures with the explicit 501 disabled-feature case already handled above.

Proposed fix
-      } catch {
-        setArtifactsEnabled(false);
+      } catch (error) {
+        setLoadError(getErrorMessage(error));
       } finally {
         setLoading(false);
       }

Based on learnings: In the flightctl-ui codebase, error handling for API calls follows a React pattern where the caller component implements try-catch blocks and manages error states.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@libs/ui-components/src/components/Masthead/CommandLineToolsPage.tsx` around
lines 124 - 126, The catch block that currently calls setArtifactsEnabled(false)
conflates transient fetch/parse errors with the explicit 501 "feature disabled"
case; change the catch to stop mutating hasArtifactsEnabled via
setArtifactsEnabled and instead handle errors by setting a local error/loading
state or rethrowing so the caller can manage it—keep the existing explicit
branch that sets setArtifactsEnabled(false) when the API returns 501, but remove
the generic setArtifactsEnabled(false) from the catch around the fetch/parse
logic (references: setArtifactsEnabled and hasArtifactsEnabled).
eslint.config.js (1)

73-89: ⚠️ Potential issue | 🟡 Minor

Fix PatternFly replacement-path messages for consistency and correctness.

The messages still mix token/icon placeholders and miss the / before <icon> in icon paths, which can mislead imports.

Suggested message fixes
-              message: 'Import using the full js path `@patternfly/react-icons/dist/js/icons<icon>` instead',
+              message: 'Import using the full js path `@patternfly/react-icons/dist/js/icons/<icon>` instead',
             },
             {
               group: ['@patternfly/react-tokens/dist/esm**'],
-              message: 'Import using the full js path `@patternfly/react-tokens/dist/js/icons<icon>` instead',
+              message: 'Import using the full js path `@patternfly/react-tokens/dist/js/<token>` instead',
             },
@@
-              message: 'Import using full path `@patternfly/react-icons/dist/js/icons<icon>` instead',
+              message: 'Import using full path `@patternfly/react-icons/dist/js/icons/<icon>` instead',
             },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@eslint.config.js` around lines 73 - 89, Update the PatternFly
replacement-path messages so they are consistent and correct: change every icon
message to include the missing "/" before "<icon>" and use the same phrasing for
icons vs tokens; specifically update the group message for
'@patternfly/react-icons/dist/esm**' and the paths.name messages for
'@patternfly/react-icons' to "Import using the full js path
`@patternfly/react-icons/dist/js/icons/<icon>` instead", and update the group
message for '@patternfly/react-tokens/dist/esm**' and the paths.name message for
'@patternfly/react-tokens' to "Import using the full js path
`@patternfly/react-tokens/dist/js/<token>` instead" so icons and tokens use
consistent wording and placeholders.
🧹 Nitpick comments (1)
eslint.config.js (1)

27-35: Consider scoping type-aware parsing to TypeScript files only to reduce lint overhead.

Line 34 applies project: true globally across all files with no file-type matcher. While the tsconfig files are configured to support JS files (most have allowJs: true), type-aware parsing on plain JS files (e.g., libs/i18n/i18next-parser.config.js, mock files) may be unnecessary overhead. Consider creating a separate config object targeting only .ts and .tsx files with project: true and limiting the global parser config to basic linting.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@eslint.config.js` around lines 27 - 35, The global parserOptions currently
sets project: true under parserOptions (affecting all files); change to scope
type-aware parsing to TypeScript only by removing project: true from the global
parserOptions and adding a separate config object (or override) that targets .ts
and .tsx files and sets parserOptions.project: true; keep the global
parserOptions (and ecmaFeatures.jsx) lightweight for JS files to reduce lint
overhead and reference the parserOptions block and any overrides in
eslint.config.js when making this change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@eslint.config.js`:
- Around line 73-89: Update the PatternFly replacement-path messages so they are
consistent and correct: change every icon message to include the missing "/"
before "<icon>" and use the same phrasing for icons vs tokens; specifically
update the group message for '@patternfly/react-icons/dist/esm**' and the
paths.name messages for '@patternfly/react-icons' to "Import using the full js
path `@patternfly/react-icons/dist/js/icons/<icon>` instead", and update the
group message for '@patternfly/react-tokens/dist/esm**' and the paths.name
message for '@patternfly/react-tokens' to "Import using the full js path
`@patternfly/react-tokens/dist/js/<token>` instead" so icons and tokens use
consistent wording and placeholders.

In `@libs/ui-components/src/components/Masthead/CommandLineToolsPage.tsx`:
- Around line 124-126: The catch block that currently calls
setArtifactsEnabled(false) conflates transient fetch/parse errors with the
explicit 501 "feature disabled" case; change the catch to stop mutating
hasArtifactsEnabled via setArtifactsEnabled and instead handle errors by setting
a local error/loading state or rethrowing so the caller can manage it—keep the
existing explicit branch that sets setArtifactsEnabled(false) when the API
returns 501, but remove the generic setArtifactsEnabled(false) from the catch
around the fetch/parse logic (references: setArtifactsEnabled and
hasArtifactsEnabled).

---

Nitpick comments:
In `@eslint.config.js`:
- Around line 27-35: The global parserOptions currently sets project: true under
parserOptions (affecting all files); change to scope type-aware parsing to
TypeScript only by removing project: true from the global parserOptions and
adding a separate config object (or override) that targets .ts and .tsx files
and sets parserOptions.project: true; keep the global parserOptions (and
ecmaFeatures.jsx) lightweight for JS files to reduce lint overhead and reference
the parserOptions block and any overrides in eslint.config.js when making this
change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4d7df738-ba89-4b0a-a768-d909fb6985f4

📥 Commits

Reviewing files that changed from the base of the PR and between daa9764 and 784f64b.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (38)
  • .eslintrc.js
  • apps/ocp-plugin/package.json
  • apps/standalone/package.json
  • apps/standalone/src/app/components/AppLayout/AppLayout.tsx
  • apps/standalone/src/app/components/Login/LoginPage.tsx
  • apps/standalone/src/app/context/AuthContext.ts
  • apps/standalone/src/app/utils/apiCalls.ts
  • eslint.config.js
  • libs/ui-components/src/components/Catalog/CatalogPage.tsx
  • libs/ui-components/src/components/Catalog/DeprecateModal.tsx
  • libs/ui-components/src/components/Catalog/EditWizard/EditAppWizard.tsx
  • libs/ui-components/src/components/Catalog/InstallWizard/InstallAppWizard.tsx
  • libs/ui-components/src/components/Device/DeviceDetails/DeviceDetailsTab.tsx
  • libs/ui-components/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.tsx
  • libs/ui-components/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.tsx
  • libs/ui-components/src/components/Device/DevicesPage/DeviceToolbarFilters.tsx
  • libs/ui-components/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.tsx
  • libs/ui-components/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx
  • libs/ui-components/src/components/EnrollmentRequest/EnrollmentRequestList.tsx
  • libs/ui-components/src/components/Fleet/CreateFleet/steps/ReviewStep.tsx
  • libs/ui-components/src/components/Fleet/FleetDetails/FleetDetailsContent.tsx
  • libs/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/ReviewStep.tsx
  • libs/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsTab.tsx
  • libs/ui-components/src/components/Login/TokenLoginForm.tsx
  • libs/ui-components/src/components/Masthead/CommandLineToolsPage.tsx
  • libs/ui-components/src/components/Repository/RepositoryDetails/RepositoryGeneralDetailsCard.tsx
  • libs/ui-components/src/components/ResourceSync/ResourceSyncToRepository.tsx
  • libs/ui-components/src/components/Terminal/Terminal.tsx
  • libs/ui-components/src/components/common/FlightCtlDescriptionList.tsx
  • libs/ui-components/src/components/common/OrganizationSelector.tsx
  • libs/ui-components/src/components/form/NameField.tsx
  • libs/ui-components/src/components/form/RichValidationTextField.tsx
  • libs/ui-components/src/components/form/validations.ts
  • libs/ui-components/src/components/modals/LoginCommandModal/LoginCommandModal.tsx
  • libs/ui-components/src/components/modals/massModals/ResumeDevicesModal/MassResumeDevicesModal.tsx
  • libs/ui-components/src/hooks/useDeviceSpecSystemInfo.tsx
  • libs/ui-components/src/utils/apiCalls.ts
  • package.json
💤 Files with no reviewable changes (2)
  • libs/ui-components/src/components/common/FlightCtlDescriptionList.tsx
  • .eslintrc.js
🚧 Files skipped from review as they are similar to previous changes (24)
  • libs/ui-components/src/components/Device/DevicesPage/DeviceToolbarFilters.tsx
  • libs/ui-components/src/components/modals/massModals/ResumeDevicesModal/MassResumeDevicesModal.tsx
  • libs/ui-components/src/components/Login/TokenLoginForm.tsx
  • libs/ui-components/src/components/form/NameField.tsx
  • package.json
  • libs/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/ReviewStep.tsx
  • libs/ui-components/src/components/Repository/RepositoryDetails/RepositoryGeneralDetailsCard.tsx
  • libs/ui-components/src/components/Catalog/DeprecateModal.tsx
  • libs/ui-components/src/components/Catalog/CatalogPage.tsx
  • libs/ui-components/src/components/Terminal/Terminal.tsx
  • libs/ui-components/src/hooks/useDeviceSpecSystemInfo.tsx
  • libs/ui-components/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.tsx
  • libs/ui-components/src/components/EnrollmentRequest/EnrollmentRequestList.tsx
  • libs/ui-components/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.tsx
  • libs/ui-components/src/components/form/validations.ts
  • apps/standalone/src/app/utils/apiCalls.ts
  • libs/ui-components/src/components/Catalog/EditWizard/EditAppWizard.tsx
  • libs/ui-components/src/components/Catalog/InstallWizard/InstallAppWizard.tsx
  • libs/ui-components/src/utils/apiCalls.ts
  • apps/standalone/src/app/components/AppLayout/AppLayout.tsx
  • libs/ui-components/src/components/modals/LoginCommandModal/LoginCommandModal.tsx
  • libs/ui-components/src/components/ResourceSync/ResourceSyncToRepository.tsx
  • apps/standalone/package.json
  • libs/ui-components/src/components/form/RichValidationTextField.tsx

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant