Skip to content

Comments

refactor(KFLUXUI-1002): rename Enterprise Contract to Conforma#708

Open
marcin-michal wants to merge 4 commits intokonflux-ci:mainfrom
marcin-michal:KFLUXUI-1002/conforma-rename
Open

refactor(KFLUXUI-1002): rename Enterprise Contract to Conforma#708
marcin-michal wants to merge 4 commits intokonflux-ci:mainfrom
marcin-michal:KFLUXUI-1002/conforma-rename

Conversation

@marcin-michal
Copy link
Member

@marcin-michal marcin-michal commented Feb 16, 2026

Assisted-by: Cursor

Fixes

KFLUXUI-1002

Description

Renaming mentions of Enterprise Contract to Conforma as it has been renamed https://conforma.dev/posts/whats-in-a-name/

Some mentions of Enterprise Contract are left as is, as some pipeline runs still use this old name (for example https://konflux-ui.apps.stone-prd-rh01.pg1f.p1.openshiftapps.com/ns/konflux-ui-tenant/applications/konflux-ui/pipelineruns/ec-k2wsc).

Some dead code related to ECs was removed as well.

Type of change

  • Feature
  • Bugfix
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Summary by CodeRabbit

  • New Features

    • UI updated to surface "Conforma" branding across security tabs, headings, tables, and policy links.
  • Bug Fixes

    • Fixed terminology and documentation link targets so policy and help links point to Conforma resources.
  • Refactor

    • Security analysis UI and data flow reorganized/renamed to Conforma for consistent labeling and table behavior.

@marcin-michal marcin-michal self-assigned this Feb 16, 2026
@marcin-michal marcin-michal requested a review from a team as a code owner February 16, 2026 16:00
@marcin-michal marcin-michal requested review from rakshett and sahil143 and removed request for a team February 16, 2026 16:00
@snyk-io
Copy link
Contributor

snyk-io bot commented Feb 16, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 16, 2026

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'version', 'include', 'exclude', 'rules', 'limits'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

This PR renames and migrates the Enterprise Contract surface to Conforma across types, utils, hooks, components, routes, and tests. It adds Conforma-specific table components and hooks, removes legacy Enterprise Contract modules, updates constants/URLs, and adjusts pipeline/taskrun security tabs and related tests.

Changes

Cohort / File(s) Summary
Conforma Table Components
src/components/Conforma/ConformaTable/ConformaHeader.tsx, src/components/Conforma/ConformaTable/ConformaRow.tsx, src/components/Conforma/ConformaTable/ConformaExpandedRowContent.tsx, src/components/Conforma/ConformaTable/ConformaTable.tsx, src/components/Conforma/ConformaTable/ConformaTable.scss
Introduces Conforma table header, row, expanded content, and main table. Prop/types updated to UIConformaData; CSS class names changed from ec-* to conforma-*; new column classes and sortable headers added.
Conforma Types
src/types/conforma.ts
Renames and re-exports types/enums for Conforma (UIConformaData, ConformaResult, ComponentConformaResult, CONFORMA_RESULT_STATUS, etc.) replacing Enterprise Contract counterparts.
Hooks & Result Mapping
src/components/Conforma/useConformaResult.tsx, src/components/Conforma/utils.tsx, src/components/Conforma/__tests__/*
Adds useConformaResult, useConformaResultFromLogs, and mapConformaResultData; renames parsing utilities to Conforma variants and updates internal names/return shapes to Conforma types. Tests updated accordingly.
Conforma Utilities
src/utils/conforma-utils.tsx, src/utils/__tests__/conforma-utils.spec.tsx
Moves/updates rule/status helpers to use CONFORMA_RESULT_STATUS; getRuleStatus signature and display text updated; tests added for util behavior.
Route & Tab Integrations
src/components/PipelineRun/.../PipelineRunSecurityTab.tsx, src/components/TaskRunDetailsView/.../TaskRunSecurityTab.tsx, src/routes/page-routes/*
Replaces Enterprise Contract tabs with Conforma equivalents in PipelineRun/TaskRun route and tab exports; route elements updated to render new Conforma tabs.
Enterprise Contract Removals
src/components/EnterpriseContract/..., src/models/enterprise-contract-policy.ts, src/types/enterprise-contract.-policy.ts
Removes legacy EnterpriseContract table, header/row files, policy model exports, and Enterprise Contract-specific types and large mock data files.
Tests Migration
src/components/Conforma/__tests__/*, src/components/PipelineRun/.../__tests__/*, src/components/TaskRunDetailsView/.../__tests__/*
Updates and adds tests to reflect Conforma names/hooks, replaces mocks and expectations previously tied to Enterprise Contract.
Constants & Docs
src/consts/documentation.ts, src/components/Conforma/__data__/mockConformaLogsJson.ts
Replaces SECURITY_ENTERPRISE_CONTRACT_* constants with CONFORMA_* constants and updates mock data exports and statuses.
Exports / Barrels
src/models/index.ts, src/types/index.ts
Removes enterprise-contract policy exports from barrels and switches type exports to conforma module where applicable.
Minor UI/Permissions
src/components/UserAccess/UserAccessForm/PermissionsTable.tsx
Updates permission label text to include “Conforma (Enterprise Contract)” while keeping mapping structure unchanged.

Sequence Diagram(s)

sequenceDiagram
    participant Route as PipelineRun Route
    participant Tab as SecurityConformaTab
    participant Hook as useConformaResult
    participant Table as ConformaTable
    participant Row as WrappedConformaRow
    Route->>Tab: render pipeline security tab
    Tab->>Hook: useConformaResult(pipelineRunName)
    Hook-->>Tab: [UIConformaData[], loaded, error]
    Tab->>Table: <ConformaTable conformaResult={...}>
    Table->>Row: render rows (WrappedConformaRow)
    Row->>Table: expanded row -> ConformaExpandedRowContent
    ConformaExpandedRowContent->>Table: external link -> CONFORMA_POLICY_AVAILABLE_RULE_COLLECTIONS_URL
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

ok-to-test

Suggested reviewers

  • sahil143
  • testcara
  • JoaoPedroPP
  • StanislavJochman
  • rrosatti

A refactor sailed in with a Conforma name,
Types and tabs reorganized to play the game.
Rows and headers dressed anew,
Tests adjusted, links in view —
Conforma now leads where Enterprise once came.

🚥 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 pull request title accurately describes the primary change: a comprehensive rename of Enterprise Contract terminology to Conforma throughout the codebase.
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 docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link
Contributor

@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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
src/components/TaskRunDetailsView/tabs/__tests__/TaskRunSecurityEnterpriseContractTab.spec.tsx (1)

1-115: ⚠️ Potential issue | 🟡 Minor

Test file name doesn't match the component under test.

Same issue as the PipelineRun test: this file is still named TaskRunSecurityEnterpriseContractTab.spec.tsx but now tests TaskRunSecurityTab. Rename to TaskRunSecurityTab.spec.tsx to follow the convention of naming test files after the component being tested. As per coding guidelines: "Name test files after the component being tested."

src/utils/conforma-utils.tsx (1)

45-57: ⚠️ Potential issue | 🟠 Major

Fix error message on line 56 and address code duplication.

The error message on line 56 still references "EC results" instead of "Conforma results" for consistency with the renamed function.

Additionally, both extractConformaResultsFromTaskRunLogs and getRuleStatus are duplicated across src/utils/conforma-utils.tsx and src/components/Conforma/utils.tsx. The src/components/Conforma/utils.tsx versions are actively used throughout the codebase (SecurityConformaTab, ConformaRow, useConformaResult), while src/utils/conforma-utils.tsx versions are only referenced by their own test file. Consider consolidating to a single canonical location.

Fix error message
-    throw new Error(`Failed to parse EC results: ${error.message}`);
+    throw new Error(`Failed to parse Conforma results: ${error.message}`);
src/components/Conforma/utils.tsx (2)

40-40: ⚠️ Potential issue | 🟡 Minor

Typo in comment: "formay" → "format".

Line 40: This regex expect the logs from tekton results to be in this formay should read format.

📝 Proposed fix
-/**
- * This regex expect the logs from tekton results to be in this formay
+/**
+ * This regex expects the logs from tekton results to be in this format

10-37: ⚠️ Potential issue | 🟠 Major

Consolidate duplicate getRuleStatus function; extractConformaResultsFromTaskRunLogs implementations serve different log formats and should remain separate.

The getRuleStatus function is identical in both this file and src/utils/conforma-utils.tsx, creating unnecessary duplication. Move the implementation to src/utils/conforma-utils.tsx (where it's already tested) and import it here to follow DRY principles.

However, extractConformaResultsFromTaskRunLogs legitimately differs: this component version parses step-report-json :- format using a lookbehind regex, while the utils version parses [report-json] prefix format. Each has corresponding test coverage matching its log format. Keep both implementations separate.

Also fix typo on line 40: "formay" → "format".

src/utils/__tests__/conforma-utils.spec.tsx (1)

194-194: ⚠️ Potential issue | 🟡 Minor

Stale describe block name: extractEcResultsFromTaskRunLogs.

The function under test was renamed to extractConformaResultsFromTaskRunLogs, but the describe block at line 194 still references the old name. Test descriptions at lines 215, 230, 258, and 288 also still say "EC results" — worth updating for grep-ability and consistency.

📝 Proposed fix for the describe block
-  describe('extractEcResultsFromTaskRunLogs', () => {
+  describe('extractConformaResultsFromTaskRunLogs', () => {
🤖 Fix all issues with AI agents
In `@src/components/Conforma/__tests__/utils.spec.ts`:
- Line 3: The test suite's describe label still reads
'extractEcResultsFromTaskRunLogs' but the function under test was renamed;
update the string in the describe(...) in
src/components/Conforma/__tests__/utils.spec.ts to match the current function
name used by the test cases (replace the stale 'extractEcResultsFromTaskRunLogs'
label with the new function name referenced in the file), so the describe block
correctly reflects the function being tested.
- Line 1: There are two implementations of
extractConformaResultsFromTaskRunLogs; remove the dead/unused one (the duplicate
implementation outside the Conforma component) and its associated test
(conforma-utils.spec.tsx), leaving only the active implementation used by
useConformaResult; ensure you delete the unused function declaration and its
test file, remove any exports/imports pointing to that removed module, and run
the test suite to confirm nothing else references
extractConformaResultsFromTaskRunLogs.

In
`@src/components/PipelineRun/PipelineRunDetailsView/tabs/__tests__/PipelineRunSecurityEnterpriseContractTab.spec.tsx`:
- Around line 1-63: The test file name doesn't match the component under
test—rename the file from PipelineRunSecurityEnterpriseContractTab.spec.tsx to
PipelineRunSecurityTab.spec.tsx and commit the rename; ensure any references
(e.g., in test-runner patterns, exports or related imports) are updated if
present, and run the test suite to confirm snapshots/coverage remain valid for
the PipelineRunSecurityTab tests.
🧹 Nitpick comments (9)
src/components/Conforma/useConformaResult.tsx (1)

141-141: Missed parameter rename: ecResult should be crResult or conformaResult.

The parameter name ecResult on line 141 still uses the old "Enterprise Contract" abbreviation, inconsistent with the rest of the Conforma rename in this file (e.g., crJson, crLoaded, conformaResult).

Suggested fix
-export const mapConformaResultData = (ecResult: ComponentConformaResult[]): UIConformaData[] => {
-  return ecResult.reduce((acc, compResult) => {
+export const mapConformaResultData = (crResult: ComponentConformaResult[]): UIConformaData[] => {
+  return crResult.reduce((acc, compResult) => {
src/components/Conforma/__tests__/useConformaResult.spec.tsx (2)

62-62: Incorrect describe block name — should be useConformaResultFromLogs.

This describe block (line 62) tests useConformaResultFromLogs (see line 111), but is named 'useConformaResult', which collides with the second describe block on line 328 that actually tests useConformaResult. This makes test output ambiguous.

Suggested fix
-describe('useConformaResult', () => {
+describe('useConformaResultFromLogs', () => {

227-302: Leftover ec-prefixed variable names in test assertions.

Several destructured variable names still use the old ec prefix (e.g., ecResult on lines 230/233, ec/ecLoaded on lines 241/244, 276/278, 299/301). These are inconsistent with the Conforma rename throughout the rest of this file.

src/components/PipelineRun/PipelineRunDetailsView/PipelineRunDetailsView.tsx (1)

17-17: Inconsistent rename: isResourceEnterpriseContract still uses old terminology.

The function is now imported from conforma-utils but retains the EnterpriseContract name. Consider renaming to something like isResourceConforma for consistency with the broader rename effort in this PR, or add a comment explaining why it's intentionally kept.

src/components/Conforma/ConformaTable/ConformaRow.tsx (1)

53-63: key prop is ineffective here and findIndex result of -1 is unguarded.

ConformaRow is rendered as a single element (not inside a .map()), so the key prop has no reconciliation effect. More importantly, if obj is not found in sortedConformaResult, findIndex returns -1 and the component still renders — contradicting the apparent intent of the guard.

Proposed fix
 export const WrappedConformaRow: React.FC<WrappedConformaRowProps> = ({ obj, customData }) => {
   const customConformaResult = customData?.sortedConformaResult;
 
-  if (Array.isArray(customConformaResult) && customConformaResult.length > 0) {
-    const index = customConformaResult.findIndex((item) => item === obj);
-
-    return <ConformaRow data={obj} key={index} />;
+  if (Array.isArray(customConformaResult) && customConformaResult.includes(obj)) {
+    return <ConformaRow data={obj} />;
   }
 
   return null;
 };
src/utils/__tests__/conforma-utils.spec.tsx (1)

82-82: createECLog helper not renamed to match Conforma convention.

The helper at line 82 still uses EC in its name. For consistency with the rest of the rename, consider createConformaLog.

📝 Proposed fix
-  const createECLog = (data: ConformaResult): string => `[report-json] ${JSON.stringify(data)}`;
+  const createConformaLog = (data: ConformaResult): string => `[report-json] ${JSON.stringify(data)}`;

Then update all call sites within this file.

src/components/Conforma/ConformaTable/ConformaTable.tsx (2)

67-71: crResult.sort(...) mutates the prop array in place.

Array.prototype.sort is in-place. Sorting a prop directly inside useMemo mutates the parent's array, which can cause subtle React bugs (stale references, skipped re-renders). Consider spreading first:

📝 Proposed fix
   const sortedCRResult = React.useMemo(() => {
     return crResult
-      ? crResult.sort(getSortColumnFuntion(COLUMN_ORDER[activeSortIndex], activeSortDirection))
+      ? [...crResult].sort(getSortColumnFuntion(COLUMN_ORDER[activeSortIndex], activeSortDirection))
       : undefined;
   }, [activeSortDirection, activeSortIndex, crResult]);

91-96: Inconsistent customData key naming between Table and Row components.

The Table-level customData prop passes {{ sortedCRResult }}, while the Row override passes {{ sortedConformaResult: sortedCRResult }}. Since WrappedConformaRow expects the sortedConformaResult key and the Row explicitly overrides the customData, the Table-level prop with key sortedCRResult is unused. Align the keys for consistency:

📝 Proposed fix
         loaded
-        customData={{ sortedCRResult }}
+        customData={{ sortedConformaResult: sortedCRResult }}
         expand
src/components/Conforma/SecurityConformaTab.tsx (1)

32-44: getResultsSummary lacks parameter types.

The function parameters CRs and crLoaded are untyped. Adding types would align with the strict TypeScript guidelines.

📝 Proposed fix
-const getResultsSummary = (CRs, crLoaded) => {
+const getResultsSummary = (CRs: UIConformaData[] | undefined, crLoaded: boolean) => {

@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

❌ Patch coverage is 91.72662% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.12%. Comparing base (d8a8dde) to head (064c07d).

Files with missing lines Patch % Lines
...omponents/Conforma/ConformaTable/ConformaTable.tsx 76.47% 8 Missing ⚠️
src/components/Conforma/useConformaResult.tsx 92.30% 4 Missing ⚠️
.../components/Conforma/ConformaTable/ConformaRow.tsx 95.23% 3 Missing ⚠️
src/components/Conforma/SecurityConformaTab.tsx 95.65% 2 Missing ⚠️
src/routes/page-routes/pipeline.tsx 0.00% 2 Missing ⚠️
src/routes/page-routes/taskrun.tsx 0.00% 2 Missing ⚠️
...onents/PipelineRun/PipelineRunDetailsView/index.ts 0.00% 1 Missing ⚠️
src/components/TaskRunDetailsView/index.ts 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #708      +/-   ##
==========================================
- Coverage   87.23%   87.12%   -0.11%     
==========================================
  Files         764      761       -3     
  Lines       58225    58088     -137     
  Branches     5658     6875    +1217     
==========================================
- Hits        50792    50610     -182     
+ Misses       7376     7356      -20     
- Partials       57      122      +65     
Flag Coverage Δ
e2e 45.81% <21.42%> (-3.38%) ⬇️
unittests 85.76% <91.72%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...forma/ConformaTable/ConformaExpandedRowContent.tsx 93.22% <100.00%> (ø)
...mponents/Conforma/ConformaTable/ConformaHeader.tsx 100.00% <100.00%> (ø)
src/components/Conforma/SecurityTabEmptyState.tsx 90.47% <ø> (ø)
src/components/Conforma/utils.tsx 100.00% <100.00%> (ø)
.../PipelineRunDetailsView/PipelineRunDetailsView.tsx 93.14% <100.00%> (ø)
...lineRunDetailsView/tabs/PipelineRunSecurityTab.tsx 100.00% <100.00%> (ø)
...mponents/TaskRunDetailsView/TaskRunDetailsView.tsx 100.00% <100.00%> (ø)
...nts/TaskRunDetailsView/tabs/TaskRunSecurityTab.tsx 100.00% <100.00%> (ø)
...nts/UserAccess/UserAccessForm/PermissionsTable.tsx 100.00% <100.00%> (ø)
src/consts/documentation.ts 100.00% <100.00%> (ø)
... and 12 more

... and 64 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d8a8dde...064c07d. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@marcin-michal marcin-michal force-pushed the KFLUXUI-1002/conforma-rename branch from 2527cbb to d5ffeb9 Compare February 16, 2026 16:35
Copy link
Member

@rrosatti rrosatti left a comment

Choose a reason for hiding this comment

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

LGTM! I'd just suggest to delete the src/components/Conforma/__data__/mockConformaPolicies.ts file, it seems to not being used anywhere :)

Copy link
Contributor

@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: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/Conforma/utils.tsx (1)

40-40: ⚠️ Potential issue | 🟡 Minor

Typo in JSDoc comment: "formay" → "format".

✏️ Fix
- * This regex expect the logs from tekton results to be in this formay
+ * This regex expects the logs from tekton results to be in this format
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/Conforma/utils.tsx` at line 40, Fix the typo in the JSDoc
above the regex that parses Tekton results: change "formay" to "format" in the
comment (the JSDoc immediately preceding the regex in Conforma's utils.tsx).
🧹 Nitpick comments (9)
src/components/Conforma/useConformaResult.tsx (1)

87-88: eslint-disable-next-line no-console suppresses a lint rule rather than fixing the root cause.

Both console.warn calls disable no-console inline. Per project conventions, consider using a structured logging abstraction or moving these to an appropriate observability hook instead of silencing the rule.

Also applies to: 110-111

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

In `@src/components/Conforma/useConformaResult.tsx` around lines 87 - 88, Replace
the inline console.warn calls (and the accompanying eslint-disable comments) in
useConformaResult (file: src/components/Conforma/useConformaResult.tsx,
occurrences around the current console.warn at ~87 and ~110) with the project's
structured logging/observability mechanism: import and call the existing logger
or observability hook (e.g. processLogger or useLogger) to emit a warning/error
with the error object and contextual fields, or accept a logger via hook params
and use that; remove the eslint-disable comments after switching to the logger
so no lint rules are suppressed.
src/components/Conforma/ConformaTable/__tests__/ConformaExpandedRowContent.spec.tsx (1)

29-42: LGTM — minor optional coverage gap for solution field.

The two test cases correctly cover the render/no-render paths. The invalidContent fixture exercises the early-return guard correctly (null?.length is falsy). The solution field rendered by ConformaExpandedRowContent has no dedicated test case, but this is a low-risk gap since the field is optional.

✏️ Optional: add a solution field test
  it('should render the component', () => {
    render(<ConformaExpandedRowContent obj={rowContent} />);
    screen.getByText('Effective from');
    screen.getByText('Collection');
    screen.getByText('abcd, efg');
    screen.getByText('Rule Description');
    screen.getByText('dummy description');
  });

+  it('should render solution when present', () => {
+    render(<ConformaExpandedRowContent obj={{ ...rowContent, solution: 'Fix the issue' }} />);
+    screen.getByText('Solution');
+    screen.getByText('Fix the issue');
+  });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/components/Conforma/ConformaTable/__tests__/ConformaExpandedRowContent.spec.tsx`
around lines 29 - 42, Add a small test in ConformaExpandedRowContent.spec.tsx to
assert the optional "solution" field renders when present: render the component
with a fixture that includes a non-empty solution and use screen.getByText to
verify the solution string appears (and conversely ensure it is absent for
invalidContent if desired). Target the ConformaExpandedRowContent component and
the existing test harness (render/screen) so the new assertion mirrors the style
of the existing "Rule Description" / "dummy description" checks.
src/utils/__tests__/conforma-utils.spec.tsx (1)

97-138: container.querySelector('svg') is a fragile, implementation-detail query.

Per project test guidelines, semantic queries (getByRole, getByLabelText) are preferred over structural DOM queries. PatternFly icons can expose role="img" or an accessible title; querying for raw SVG elements is brittle if the icon library changes its rendering.

✏️ Example using accessible text assertion instead
-      expect(result.container.querySelector('svg')).toBeInTheDocument();
-      expect(result.container).toHaveTextContent('Success');
+      expect(result.getByText('Success')).toBeInTheDocument();

If the icons must be asserted, use getByRole('img', { hidden: true }) to query by accessible role rather than by tag name.

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

In `@src/utils/__tests__/conforma-utils.spec.tsx` around lines 97 - 138, The tests
assert icon presence by querying raw SVGs which is brittle; update the
getRuleStatus tests to use semantic queries instead (e.g., replace
expect(result.container.querySelector('svg')).toBeInTheDocument() with
expect(result.getByRole('img', { hidden: true })).toBeInTheDocument() or
getByLabelText/getByTitle if the icon exposes accessible text), keeping the rest
of the assertions (text content like 'Success', 'Failed', 'Warning', 'Missing')
the same; apply this change to each test that checks the icon for getRuleStatus
and for any null/undefined edge-case tests that assert icon presence.
src/components/Conforma/utils.tsx (1)

10-37: getRuleStatus is duplicated with src/utils/conforma-utils.tsx.

Both files export an identical implementation of getRuleStatus. The component-level utils.tsx should import from the shared utility instead of maintaining its own copy.

♻️ Proposed fix: remove the duplicate, import from the shared util
-import { CheckCircleIcon } from '@patternfly/react-icons/dist/esm/icons/check-circle-icon';
-import { DotCircleIcon } from '@patternfly/react-icons/dist/esm/icons/dot-circle-icon';
-import { ExclamationCircleIcon } from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';
-import { ExclamationTriangleIcon } from '@patternfly/react-icons/dist/esm/icons/exclamation-triangle-icon';
-import { global_danger_color_100 as redColor } from '@patternfly/react-tokens/dist/js/global_danger_color_100';
-import { global_success_color_100 as greenColor } from '@patternfly/react-tokens/dist/js/global_success_color_100';
-import { global_warning_color_100 as yellowColor } from '@patternfly/react-tokens/dist/js/global_warning_color_100';
 import { CONFORMA_RESULT_STATUS, ConformaResult } from '~/types/conforma';
+export { getRuleStatus } from '~/utils/conforma-utils';

-export const getRuleStatus = (type: CONFORMA_RESULT_STATUS) => {
-  switch (type) {
-    ...
-  }
-};
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/Conforma/utils.tsx` around lines 10 - 37, Remove the
duplicated getRuleStatus implementation in the component-level utils and instead
import the shared getRuleStatus from the existing shared utility; delete the
local function (and any identical icon/color constants it only used) and add an
import for the shared getRuleStatus so the component uses that exported function
(ensure the shared module exports getRuleStatus and that the referenced symbols
CONFORMA_RESULT_STATUS, CheckCircleIcon, ExclamationCircleIcon,
ExclamationTriangleIcon, DotCircleIcon, greenColor, redColor, yellowColor are
provided by the shared implementation or imported where needed).
src/components/Conforma/__tests__/useConformaResult.spec.tsx (1)

62-62: Misleading describe block name — tests useConformaResultFromLogs, not useConformaResult.

This describe block (line 62) tests useConformaResultFromLogs (see the renderHookWithQueryClient at line 111), but it's named 'useConformaResult' — the same name as the second describe block at line 328 which tests the actual useConformaResult hook. This creates ambiguous test output and makes failures harder to triage.

Proposed fix
-describe('useConformaResult', () => {
+describe('useConformaResultFromLogs', () => {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/Conforma/__tests__/useConformaResult.spec.tsx` at line 62, The
describe block currently named 'useConformaResult' actually contains tests for
useConformaResultFromLogs; rename that top-level describe to
'useConformaResultFromLogs' (and update any nested test titles if they reference
the old name) so test output is unambiguous; locate the block that calls
renderHookWithQueryClient and references useConformaResultFromLogs and change
the describe string to match the hook under test, keeping the existing test
bodies intact.
src/components/Conforma/SecurityConformaTab.tsx (2)

32-43: Missing TypeScript types on getResultsSummary parameters.

CRs and crLoaded are untyped. Since this is in changed lines, consider adding types for consistency with the strict TypeScript guideline.

Proposed fix
-const getResultsSummary = (CRs, crLoaded) => {
+const getResultsSummary = (CRs: UIConformaData[] | undefined, crLoaded: boolean) => {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/Conforma/SecurityConformaTab.tsx` around lines 32 - 43,
getResultsSummary currently accepts untyped parameters CRs and crLoaded; add
explicit TypeScript types: type CRs as an array of objects that include a
status: string property (e.g., Array<{ status: string }>) or a more specific
interface if one exists, type crLoaded as boolean, and annotate the function
return as Record<string, number> (or the appropriate mapped type). Update the
getResultsSummary signature to use these types so TypeScript can validate uses
of cr.status and the returned statusFilter; keep using the existing statuses
variable and reduce logic unchanged.

24-24: Remove duplicate getRuleStatus function and use shared implementation.

The getRuleStatus function is defined identically in both src/components/Conforma/utils.tsx and src/utils/conforma-utils.tsx. The canonical version exists in src/utils/conforma-utils.tsx, and both SecurityConformaTab.tsx and ConformaRow.tsx should import from there instead of maintaining a duplicate in the local utils file.

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

In `@src/components/Conforma/SecurityConformaTab.tsx` at line 24, Remove the
duplicate getRuleStatus implementation in the local component utils
(src/components/Conforma/utils.tsx) and update imports in
SecurityConformaTab.tsx and ConformaRow.tsx to import getRuleStatus from the
shared canonical module (src/utils/conforma-utils.tsx); ensure both files
replace any local import like "import { getRuleStatus } from './utils';" with
the shared module import and delete the duplicate function definition from the
component utils file so only the single shared getRuleStatus symbol is used
across components.
src/components/PipelineRun/PipelineRunDetailsView/tabs/PipelineRunSecurityTab.tsx (1)

5-5: Use the ~/components path alias for consistency.

Line 3 already uses the ~ alias for an internal import; line 5 (new) goes back to a relative path.

♻️ Proposed fix
-import { SecurityConformaTab } from '../../../Conforma/SecurityConformaTab';
+import { SecurityConformaTab } from '~/components/Conforma/SecurityConformaTab';

As per coding guidelines: "Use absolute imports with configured path aliases: ~/components, ~/types, ~/k8s, ~/utils, ~/models, @routes."

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

In
`@src/components/PipelineRun/PipelineRunDetailsView/tabs/PipelineRunSecurityTab.tsx`
at line 5, Replace the relative import of SecurityConformaTab with the project
path-alias import to match existing style: update the import for
SecurityConformaTab (symbol SecurityConformaTab in PipelineRunSecurityTab.tsx)
to use the ~/components alias instead of '../../../Conforma/SecurityConformaTab'
so it follows the established absolute import patterns (e.g., ~/components).
src/components/TaskRunDetailsView/tabs/__tests__/TaskRunSecurityTab.spec.tsx (1)

39-57: Misleading test name — scenario is loading state, not error.

mockUseConformaResult.mockReturnValue([null, false, undefined]) gives crLoaded=false, crError=undefined, which produces the spinner (loading) path in SecurityConformaTab, not an error path. An error scenario would require a truthy third value (e.g., new Error('...')).

♻️ Proposed rename
-  it('should handle error when conforma fails to load', () => {
+  it('should show nothing when conforma data has not loaded yet', () => {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/TaskRunDetailsView/tabs/__tests__/TaskRunSecurityTab.spec.tsx`
around lines 39 - 57, The test name is misleading: mockUseConformaResult
currently returns [null, false, undefined] which represents a loading state
(crLoaded=false, crError=undefined) and triggers the spinner in
SecurityConformaTab; either rename the test "should handle loading when Conforma
is not yet loaded" to reflect that, or change the mock to simulate an error
(return a truthy error as the third tuple value, e.g., an Error instance) so the
test exercises the error branch in SecurityConformaTab; update assertions
accordingly (if simulating error, assert the error UI is shown and the loading
spinner is not).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/Conforma/__tests__/useConformaResult.spec.tsx`:
- Around line 345-351: The tests in the second describe('useConformaResult')
block lose the namespace spy because jest.clearAllMocks() resets it; add a call
to mockUseNamespaceHook('test-ns') inside that block's beforeEach (alongside
queryClient = createTestQueryClient(), jest.clearAllMocks(), etc.) so
useConformaResult sees the mocked namespace during those tests and the spy is
re-established.

In `@src/components/Conforma/ConformaTable/ConformaTable.tsx`:
- Around line 67-71: The current sortedCRResult useMemo calls
crResult.sort(...), which mutates the crResult prop; fix by copying before
sorting (e.g. replace crResult.sort(...) with [...crResult].sort(...) or
crResult.slice().sort(...)) so sortedCRResult is derived from an immutable copy;
keep the same getSortColumnFuntion(COLUMN_ORDER[activeSortIndex],
activeSortDirection) call and dependency array.

In `@src/components/Conforma/useConformaResult.tsx`:
- Around line 141-142: The parameter name ecResult in mapConformaResultData is
stale; rename it to a clearer name like conformaResults (or conformaResultList)
and update all uses within the function (e.g., the reduce call and any
references to compResult) so the parameter and its internal references reflect
the new Conforma naming and remove the old "ec" prefix.

In
`@src/components/PipelineRun/PipelineRunDetailsView/tabs/PipelineRunSecurityTab.tsx`:
- Line 12: pipelineRunName coming from useParams<RouterParams>() is typed as
string | undefined but SecurityConformaTab and useConformaResult expect a
string; update the call site in PipelineRunSecurityTab.tsx to either
guard/assert before passing it: obtain const { pipelineRunName } =
useParams<RouterParams>(); then either throw or return early if pipelineRunName
is undefined, or pass pipelineRunName! (non-null assertion) to
SecurityConformaTab, ensuring SecurityConformaTab and its
useConformaResult(pipelineRunName: string) receive a guaranteed string; choose a
guard (e.g., render fallback/error when undefined) or a single non-null
assertion to satisfy the type checker.

In `@src/types/conforma.ts`:
- Line 30: Remove the dead type alias ConformaResultType: find and delete the
export type ConformaResultType = 'violations' | 'successes' | 'warnings';
declaration in src/types/conforma.ts so the codebase relies solely on the
existing CONFORMA_RESULT_STATUS enum; ensure no other files reference
ConformaResultType (run a quick project-wide search) and keep
CONFORMA_RESULT_STATUS as the single source of truth.

---

Outside diff comments:
In `@src/components/Conforma/utils.tsx`:
- Line 40: Fix the typo in the JSDoc above the regex that parses Tekton results:
change "formay" to "format" in the comment (the JSDoc immediately preceding the
regex in Conforma's utils.tsx).

---

Nitpick comments:
In `@src/components/Conforma/__tests__/useConformaResult.spec.tsx`:
- Line 62: The describe block currently named 'useConformaResult' actually
contains tests for useConformaResultFromLogs; rename that top-level describe to
'useConformaResultFromLogs' (and update any nested test titles if they reference
the old name) so test output is unambiguous; locate the block that calls
renderHookWithQueryClient and references useConformaResultFromLogs and change
the describe string to match the hook under test, keeping the existing test
bodies intact.

In
`@src/components/Conforma/ConformaTable/__tests__/ConformaExpandedRowContent.spec.tsx`:
- Around line 29-42: Add a small test in ConformaExpandedRowContent.spec.tsx to
assert the optional "solution" field renders when present: render the component
with a fixture that includes a non-empty solution and use screen.getByText to
verify the solution string appears (and conversely ensure it is absent for
invalidContent if desired). Target the ConformaExpandedRowContent component and
the existing test harness (render/screen) so the new assertion mirrors the style
of the existing "Rule Description" / "dummy description" checks.

In `@src/components/Conforma/SecurityConformaTab.tsx`:
- Around line 32-43: getResultsSummary currently accepts untyped parameters CRs
and crLoaded; add explicit TypeScript types: type CRs as an array of objects
that include a status: string property (e.g., Array<{ status: string }>) or a
more specific interface if one exists, type crLoaded as boolean, and annotate
the function return as Record<string, number> (or the appropriate mapped type).
Update the getResultsSummary signature to use these types so TypeScript can
validate uses of cr.status and the returned statusFilter; keep using the
existing statuses variable and reduce logic unchanged.
- Line 24: Remove the duplicate getRuleStatus implementation in the local
component utils (src/components/Conforma/utils.tsx) and update imports in
SecurityConformaTab.tsx and ConformaRow.tsx to import getRuleStatus from the
shared canonical module (src/utils/conforma-utils.tsx); ensure both files
replace any local import like "import { getRuleStatus } from './utils';" with
the shared module import and delete the duplicate function definition from the
component utils file so only the single shared getRuleStatus symbol is used
across components.

In `@src/components/Conforma/useConformaResult.tsx`:
- Around line 87-88: Replace the inline console.warn calls (and the accompanying
eslint-disable comments) in useConformaResult (file:
src/components/Conforma/useConformaResult.tsx, occurrences around the current
console.warn at ~87 and ~110) with the project's structured
logging/observability mechanism: import and call the existing logger or
observability hook (e.g. processLogger or useLogger) to emit a warning/error
with the error object and contextual fields, or accept a logger via hook params
and use that; remove the eslint-disable comments after switching to the logger
so no lint rules are suppressed.

In `@src/components/Conforma/utils.tsx`:
- Around line 10-37: Remove the duplicated getRuleStatus implementation in the
component-level utils and instead import the shared getRuleStatus from the
existing shared utility; delete the local function (and any identical icon/color
constants it only used) and add an import for the shared getRuleStatus so the
component uses that exported function (ensure the shared module exports
getRuleStatus and that the referenced symbols CONFORMA_RESULT_STATUS,
CheckCircleIcon, ExclamationCircleIcon, ExclamationTriangleIcon, DotCircleIcon,
greenColor, redColor, yellowColor are provided by the shared implementation or
imported where needed).

In
`@src/components/PipelineRun/PipelineRunDetailsView/tabs/PipelineRunSecurityTab.tsx`:
- Line 5: Replace the relative import of SecurityConformaTab with the project
path-alias import to match existing style: update the import for
SecurityConformaTab (symbol SecurityConformaTab in PipelineRunSecurityTab.tsx)
to use the ~/components alias instead of '../../../Conforma/SecurityConformaTab'
so it follows the established absolute import patterns (e.g., ~/components).

In
`@src/components/TaskRunDetailsView/tabs/__tests__/TaskRunSecurityTab.spec.tsx`:
- Around line 39-57: The test name is misleading: mockUseConformaResult
currently returns [null, false, undefined] which represents a loading state
(crLoaded=false, crError=undefined) and triggers the spinner in
SecurityConformaTab; either rename the test "should handle loading when Conforma
is not yet loaded" to reflect that, or change the mock to simulate an error
(return a truthy error as the third tuple value, e.g., an Error instance) so the
test exercises the error branch in SecurityConformaTab; update assertions
accordingly (if simulating error, assert the error UI is shown and the loading
spinner is not).

In `@src/utils/__tests__/conforma-utils.spec.tsx`:
- Around line 97-138: The tests assert icon presence by querying raw SVGs which
is brittle; update the getRuleStatus tests to use semantic queries instead
(e.g., replace expect(result.container.querySelector('svg')).toBeInTheDocument()
with expect(result.getByRole('img', { hidden: true })).toBeInTheDocument() or
getByLabelText/getByTitle if the icon exposes accessible text), keeping the rest
of the assertions (text content like 'Success', 'Failed', 'Warning', 'Missing')
the same; apply this change to each test that checks the icon for getRuleStatus
and for any null/undefined edge-case tests that assert icon presence.

Copy link
Contributor

@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

🧹 Nitpick comments (5)
src/components/Conforma/__tests__/useConformaResult.spec.tsx (3)

65-77: mockEnterpriseContractPipelineRun is duplicated across both describe blocks.

The fixture is defined identically in both blocks. Extract it to file scope to avoid the duplication.

✏️ Proposed fix

Move the shared fixture before the first describe block (file scope) and remove the duplicate in the second block:

+const mockEnterpriseContractPipelineRun = {
+  metadata: {
+    name: 'test-pipelinerun',
+    labels: { [ENTERPRISE_CONTRACT_LABEL]: 'enterprise-contract' },
+  },
+  status: { pipelineSpec: { tasks: [{ name: EC_TASK }] } },
+};
+
 describe('useConformaResultFromLogs', () => {
-  const mockEnterpriseContractPipelineRun = { ... };
   ...
 });

 describe('useConformaResult', () => {
-  const mockEnterpriseContractPipelineRun = { ... };
   ...
 });

Also applies to: 331-343

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

In `@src/components/Conforma/__tests__/useConformaResult.spec.tsx` around lines 65
- 77, The test fixture mockEnterpriseContractPipelineRun (which references
ENTERPRISE_CONTRACT_LABEL and EC_TASK) is duplicated in both describe blocks;
move its declaration out to file scope above the first describe so both tests
reuse the same object and delete the duplicate inside the second describe,
ensuring imports/constants (ENTERPRISE_CONTRACT_LABEL, EC_TASK) are still in
scope and updating any references if renamed.

62-62: First describe block is mislabeled — should be useConformaResultFromLogs.

The block at line 62 is named 'useConformaResult' but every test inside it renders useConformaResultFromLogs (line 111). This causes ambiguity since there is also a second describe('useConformaResult') block at line 328 that correctly tests the useConformaResult hook. Test output will show two suites with the same name.

✏️ Proposed fix
-describe('useConformaResult', () => {
+describe('useConformaResultFromLogs', () => {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/Conforma/__tests__/useConformaResult.spec.tsx` at line 62, The
top-level describe string is wrong: rename the first describe that currently
reads 'useConformaResult' to 'useConformaResultFromLogs' so it matches the hook
under test (useConformaResultFromLogs) and avoids colliding with the other
describe for useConformaResult; locate the describe(...) call in the test file
surrounding the tests that render useConformaResultFromLogs and update its label
accordingly.

227-244: Stale ecResult / ec / ecLoaded destructuring names.

Several test destructurings still use the old EC-prefixed names. These don't affect test correctness but contradict the rename and mislead readers.

✏️ Proposed fix
-    const [ecResult, loaded] = result.current;  // line 230
+    const [conformaResult, loaded] = result.current;

-    const [ecResult, loaded] = result.current;  // line 241
+    const [conformaResult, loaded] = result.current;

-    const [ecResult, loaded] = result.current;  // line 276
+    const [conformaResult, loaded] = result.current;

-    const [ec, ecLoaded] = result.current;  // line 299
+    const [conformaResult, crLoaded] = result.current;

Also applies to: 276-278, 299-302

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

In `@src/components/Conforma/__tests__/useConformaResult.spec.tsx` around lines
227 - 244, Tests still destructure using legacy EC-prefixed names (ecResult / ec
/ ecLoaded) which should be updated to the new Conforma names; update all
occurrences where the hook result is destructured (e.g., in the it blocks using
renderHookWithQueryClient and mockCommmonFetchJSON) to use the current naming
convention (for example replace ecResult/ec/ecLoaded with conformaResult/loaded
or result/loaded as used elsewhere), and apply the same rename to the other
instances mentioned (around the other test blocks referenced) so variable names
are consistent and no stale EC-prefixed identifiers remain.
src/components/Conforma/ConformaTable/ConformaTable.tsx (2)

21-21: Fix typo in exported function name: getSortColumnFuntiongetSortColumnFunction.

The misspelled function is defined at line 21 and called once at line 69 within the same file, so the rename scope is limited to ConformaTable.tsx.

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

In `@src/components/Conforma/ConformaTable/ConformaTable.tsx` at line 21, Rename
the misspelled exported function getSortColumnFuntion to getSortColumnFunction
and update every internal reference to it (including the call where
getSortColumnFuntion is invoked) so the export and usages match; ensure the
exported identifier and any imports/usages within ConformaTable.tsx are updated
to the corrected name.

84-96: Line 96's customData prop is misleading and functionally unused.

The Table component receives customData={{ sortedCRResult }} with key sortedCRResult, but the Row callback (lines 84–93) provides its own customData={{ sortedConformaResult: sortedCRResult }} with the correct key that WrappedConformaRow expects (sortedConformaResult). This override prevents a runtime bug, but it also means line 96's customData is never consumed.

Either remove line 96's customData prop (since Table doesn't require it) or align the key name to avoid confusion:

✏️ Proposed fix
-      customData={{ sortedCRResult }}
+      customData={{ sortedConformaResult: sortedCRResult }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/Conforma/ConformaTable/ConformaTable.tsx` around lines 84 -
96, The Table is being passed a top-level prop customData={{ sortedCRResult }}
that is never used because the Row renderer supplies its own customData with the
expected key sortedConformaResult; remove the redundant top-level customData
prop (the one using sortedCRResult) from the Table props in ConformaTable.tsx,
or if you prefer keeping it, rename its key to sortedConformaResult so it
matches what WrappedConformaRow expects (reference the Row callback and
WrappedConformaRow, and the variables sortedCRResult and sortedConformaResult).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/Conforma/useConformaResult.tsx`:
- Around line 87-88: In useConformaResult (the catch blocks inside the async
fetch flow), remove the eslint-disable comment and replace console.warn('Error
while fetching Conforma result from logs', err) (and the similar console.warn at
lines ~110-111) with the project's logging utility (e.g., call logger.warn or
processLogger.warn consistent with the repo's logger API) so the error and
context are recorded via the central logger; if the function already returns the
error upward, alternatively remove the log entirely and propagate the
error—ensure the import/use of the project's logger is added and used in those
catch blocks instead of console.warn.

---

Duplicate comments:
In `@src/components/Conforma/__tests__/useConformaResult.spec.tsx`:
- Around line 345-352: There's a duplicate call to
mockUseNamespaceHook('test-ns') in the second describe's beforeEach; remove the
redundant invocation (or hoist a single call to the outer beforeEach) so
mockUseNamespaceHook is only set once; update the beforeEach that currently
calls mockUseNamespaceHook in the second describe and keep only the single,
authoritative call to mockUseNamespaceHook('test-ns') to avoid duplicate
mocking.

In `@src/components/Conforma/ConformaTable/ConformaTable.tsx`:
- Around line 67-71: The reviewer noted the in-place sort mutation is already
addressed; remove the duplicate review comment and ensure the memoized
sortedCRResult still uses a non-mutating copy (the [...crResult].sort(...)
pattern) and that the comparator function reference (getSortColumnFuntion) is
correct where used; no behavioral change to sortedCRResult is needed—just clean
up the duplicate comment and verify the comparator name is the intended symbol.

In `@src/components/Conforma/useConformaResult.tsx`:
- Around line 141-142: The function signature for mapConformaResultData still
references the old parameter name in comments or internal references; update any
remaining uses or inline comments that mention ecResult to use the new parameter
name conformaResult, and ensure all references inside the mapConformaResultData
function body (and any tests/helpers calling it) read from the conformaResult
parameter to avoid stale identifier mismatches.

---

Nitpick comments:
In `@src/components/Conforma/__tests__/useConformaResult.spec.tsx`:
- Around line 65-77: The test fixture mockEnterpriseContractPipelineRun (which
references ENTERPRISE_CONTRACT_LABEL and EC_TASK) is duplicated in both describe
blocks; move its declaration out to file scope above the first describe so both
tests reuse the same object and delete the duplicate inside the second describe,
ensuring imports/constants (ENTERPRISE_CONTRACT_LABEL, EC_TASK) are still in
scope and updating any references if renamed.
- Line 62: The top-level describe string is wrong: rename the first describe
that currently reads 'useConformaResult' to 'useConformaResultFromLogs' so it
matches the hook under test (useConformaResultFromLogs) and avoids colliding
with the other describe for useConformaResult; locate the describe(...) call in
the test file surrounding the tests that render useConformaResultFromLogs and
update its label accordingly.
- Around line 227-244: Tests still destructure using legacy EC-prefixed names
(ecResult / ec / ecLoaded) which should be updated to the new Conforma names;
update all occurrences where the hook result is destructured (e.g., in the it
blocks using renderHookWithQueryClient and mockCommmonFetchJSON) to use the
current naming convention (for example replace ecResult/ec/ecLoaded with
conformaResult/loaded or result/loaded as used elsewhere), and apply the same
rename to the other instances mentioned (around the other test blocks
referenced) so variable names are consistent and no stale EC-prefixed
identifiers remain.

In `@src/components/Conforma/ConformaTable/ConformaTable.tsx`:
- Line 21: Rename the misspelled exported function getSortColumnFuntion to
getSortColumnFunction and update every internal reference to it (including the
call where getSortColumnFuntion is invoked) so the export and usages match;
ensure the exported identifier and any imports/usages within ConformaTable.tsx
are updated to the corrected name.
- Around line 84-96: The Table is being passed a top-level prop customData={{
sortedCRResult }} that is never used because the Row renderer supplies its own
customData with the expected key sortedConformaResult; remove the redundant
top-level customData prop (the one using sortedCRResult) from the Table props in
ConformaTable.tsx, or if you prefer keeping it, rename its key to
sortedConformaResult so it matches what WrappedConformaRow expects (reference
the Row callback and WrappedConformaRow, and the variables sortedCRResult and
sortedConformaResult).

Copy link
Member

@rrosatti rrosatti left a comment

Choose a reason for hiding this comment

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

LGTM, nice job! :)

Copy link
Member

@StanislavJochman StanislavJochman left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants