Skip to content

Show matchExpressions in Progressive Sync Step Groups (#10177)#256

Open
keithchong wants to merge 1 commit into
redhat-developer:mainfrom
keithchong:10177-MatchExpressionsInStepGroupTitle
Open

Show matchExpressions in Progressive Sync Step Groups (#10177)#256
keithchong wants to merge 1 commit into
redhat-developer:mainfrom
keithchong:10177-MatchExpressionsInStepGroupTitle

Conversation

@keithchong

Copy link
Copy Markdown
Collaborator

See GITOPS-10177

@openshift-ci
openshift-ci Bot requested a review from wtam2018 July 14, 2026 07:36
@keithchong
keithchong requested review from aali309 and removed request for wtam2018 July 14, 2026 07:36
@codecov-commenter

codecov-commenter commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 71 lines in your changes missing coverage. Please review.
✅ Project coverage is 11.81%. Comparing base (01e9db1) to head (fbd0b43).
⚠️ Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
...mponents/appset/graph/nodes/StepGroupComponent.tsx 0.00% 21 Missing and 3 partials ⚠️
...omponents/appset/graph/ApplicationSetGraphView.tsx 0.00% 21 Missing and 2 partials ⚠️
...ps/components/appset/AppSetMatchExpressionsTab.tsx 0.00% 15 Missing ⚠️
src/gitops/components/appset/graph/graph-utils.tsx 0.00% 7 Missing ⚠️
...itops/components/application/graph/graph-utils.tsx 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #256      +/-   ##
==========================================
- Coverage   11.92%   11.81%   -0.12%     
==========================================
  Files         154      157       +3     
  Lines        6272     6373     +101     
  Branches     2028     2197     +169     
==========================================
+ Hits          748      753       +5     
+ Misses       5524     5394     -130     
- Partials        0      226     +226     
Flag Coverage Δ
unit-tests 11.81% <0.00%> (-0.12%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added a sidebar for viewing all ApplicationSet match expressions and progressive sync step details.
    • Added context-menu access to match expressions from progressive sync step groups.
    • Improved graph nodes with application metadata and clearer match-expression labels.
  • Bug Fixes

    • Added outlines to application graph node labels for improved visibility.
  • Localization

    • Updated English, Japanese, Korean, and Chinese labels for match expressions, boolean values, and related UI text.

Walkthrough

The ApplicationSet graph now exposes progressive sync match expressions through localized context-menu actions and a topology sidebar that renders the selected step as YAML. Graph nodes also carry API metadata, while related translations, YAML tooling, and label styling are updated.

Changes

ApplicationSet match expressions

Layer / File(s) Summary
Graph data and progressive-sync labels
src/gitops/components/application/graph/graph-utils.tsx, src/gitops/components/application/graph/ApplicationGraphView.scss, src/gitops/components/appset/graph/graph-utils.tsx, src/gitops/components/appset/graph/nodes/StepGroupComponent.tsx
Graph nodes include API version/group metadata; progressive sync labels derive from match expressions; step groups support localized context-menu interaction and outlined labels.
Context menu and match-expressions sidebar
src/gitops/components/appset/AppSetMatchExpressionsTab.tsx, src/gitops/components/appset/graph/ApplicationSetGraphView.tsx, package.json
A new context-menu action opens a topology sidebar that renders the selected rolling-sync step as YAML, using the added yaml dependency.
Match-expression translation updates
locales/*/plugin__gitops-plugin.json
English, Japanese, Korean, and Chinese translations add match-expression labels and reorder related entries.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant StepGroupComponent
  participant AppSetContextMenuItem
  participant ApplicationSetGraphView
  participant AppSetMatchExpressionsTab
  User->>StepGroupComponent: Open step-group context menu
  StepGroupComponent->>AppSetContextMenuItem: Show match-expressions action
  User->>AppSetContextMenuItem: Select action
  AppSetContextMenuItem->>ApplicationSetGraphView: Set showMatchExpressions to true
  ApplicationSetGraphView->>AppSetMatchExpressionsTab: Render selected rolling-sync step
  AppSetMatchExpressionsTab-->>User: Display step YAML
Loading

Suggested reviewers: aali309

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly summarizes the main change: showing matchExpressions in Progressive Sync step groups.
Description check ✅ Passed The description references the linked GITOPS-10177 issue and is related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (1)
src/gitops/components/appset/graph/ApplicationSetGraphView.tsx (1)

371-371: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Prefer .getType() over ID-suffix matching for node-type detection.

selectedNode?.getId().endsWith('-step-group') is brittle compared to the .getType() === 'step-group' check used consistently elsewhere in this file/module for identifying step-group nodes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/gitops/components/appset/graph/ApplicationSetGraphView.tsx` at line 371,
Update the isStepGroup calculation to use selectedNode?.getType() ===
'step-group' instead of matching the node ID suffix, consistent with the other
step-group detection logic in the module.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Line 81: Move the yaml package entry from devDependencies to dependencies in
package.json, preserving its current version constraint so the runtime import in
AppSetMatchExpressionsTab.tsx remains available in production installs.

In `@src/gitops/components/appset/AppSetMatchExpressionsTab.tsx`:
- Around line 13-23: Update AppSetMatchExpressionsTabProps so customData uses
the established shape from ApplicationSetGraphView.tsx, including its step
field, instead of object. Before parseInt and any translation-string
interpolation in AppSetMatchExpressionsTab, coerce customData.step to a string
and then parse it, preserving the existing step-index lookup behavior.

In `@src/gitops/components/appset/graph/ApplicationSetGraphView.tsx`:
- Around line 351-448: Update getTopologySideBar to remove the React.useMemo
call and hoist the stable pages definition to module scope. Refactor the
selectedNode rendering logic into a small helper or equivalent conditional
structure so no nested ternary remains, and remove the redundant selectedNode
!== undefined check while preserving the existing sidebar output for no
selection, regular nodes, and step groups.

In `@src/gitops/components/appset/graph/graph-utils.tsx`:
- Around line 235-247: Update the key, operator, and values access in the graph
step logic to use optional chaining when indexing rollingSync.steps and
matchExpressions.values, including `?.[]` for array access. Extract the selected
step or match expression if useful to avoid repeating the long chain, while
preserving empty-string fallbacks for missing data.

In `@src/gitops/components/appset/graph/nodes/StepGroupComponent.tsx`:
- Line 322: Replace the concatenated step translation in
src/gitops/components/appset/graph/nodes/StepGroupComponent.tsx#L322-L322 with
the interpolation pattern using the step value, and add the “Step {{x}}”
translation key to every locale file. Apply the same change in
src/gitops/components/appset/AppSetMatchExpressionsTab.tsx#L37-L37 using
“Progressive Sync Step {{x}}” with customData?.step, and add that matching key
to every locale file.

---

Nitpick comments:
In `@src/gitops/components/appset/graph/ApplicationSetGraphView.tsx`:
- Line 371: Update the isStepGroup calculation to use selectedNode?.getType()
=== 'step-group' instead of matching the node ID suffix, consistent with the
other step-group detection logic in the module.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: b69cf727-962e-42d6-8eef-69c63d2afe78

📥 Commits

Reviewing files that changed from the base of the PR and between 4a79605 and 7b31b33.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (11)
  • locales/en/plugin__gitops-plugin.json
  • locales/ja/plugin__gitops-plugin.json
  • locales/ko/plugin__gitops-plugin.json
  • locales/zh/plugin__gitops-plugin.json
  • package.json
  • src/gitops/components/application/graph/ApplicationGraphView.scss
  • src/gitops/components/application/graph/graph-utils.tsx
  • src/gitops/components/appset/AppSetMatchExpressionsTab.tsx
  • src/gitops/components/appset/graph/ApplicationSetGraphView.tsx
  • src/gitops/components/appset/graph/graph-utils.tsx
  • src/gitops/components/appset/graph/nodes/StepGroupComponent.tsx

Comment thread package.json Outdated
Comment thread src/gitops/components/appset/AppSetMatchExpressionsTab.tsx Outdated
Comment thread src/gitops/components/appset/graph/ApplicationSetGraphView.tsx
Comment thread src/gitops/components/appset/graph/graph-utils.tsx Outdated
Comment thread src/gitops/components/appset/graph/nodes/StepGroupComponent.tsx Outdated
@keithchong keithchong changed the title Show matchExpressions in Progressive Sync Step Groups (#10177) WIP - Show matchExpressions in Progressive Sync Step Groups (#10177) Jul 15, 2026
Signed-off-by: Keith Chong <kykchong@redhat.com>
@keithchong
keithchong force-pushed the 10177-MatchExpressionsInStepGroupTitle branch from 7b31b33 to fbd0b43 Compare July 15, 2026 18:01
@keithchong keithchong changed the title WIP - Show matchExpressions in Progressive Sync Step Groups (#10177) Show matchExpressions in Progressive Sync Step Groups (#10177) Jul 15, 2026
@keithchong

Copy link
Copy Markdown
Collaborator Author

@coderabbitai

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

@keithchong I see you've tagged me but didn't include a specific request. Could you let me know what you'd like help with? For example, I can:

  • Review the changes in this PR (``)
  • Answer questions about specific files like AppSetMatchExpressionsTab.tsx or ApplicationSetGraphView.tsx
  • Help address the Codecov coverage report above
  • Something else entirely

Just let me know!

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/gitops/components/appset/graph/graph-utils.tsx (1)

235-241: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Improve label formatting and provide a fallback for empty expressions.

Concatenating the parts with hardcoded spaces (key + ' ' + operator + ' ' + values) will result in trailing spaces for operators that do not have values (e.g., Exists), or an almost empty label (" ") if matchExpressions is undefined.

Consider filtering out empty values and providing a fallback label so the step group always has a meaningful name in the graph.

♻️ Proposed refactor
       const stepGroupApps = stepGroupAppsMap.get(step);
       const stepMatchExpression =
         applicationSet.spec?.strategy?.rollingSync?.steps?.[
           parseInt(step) - 1
         ]?.matchExpressions?.at(0);
       const key = stepMatchExpression?.key || '';
       const operator = stepMatchExpression?.operator || '';
       const values = stepMatchExpression?.values?.[0] || '';
+      const labelText = [key, operator, values].filter(Boolean).join(' ') || `Progressive Sync Step ${step}`;
       if (stepGroupApps.length === 0 && hasApplicationStatus) {
         stepGroupAppsMap.set(step.toString(), [step + '-filler-node']);
...
       const stepGroup = {
         anchor: CenterAnchor,
         id: step + '-step-group',
         type: 'step-group',
         group: true,
         rank: 3,
-        label: key + ' ' + operator + ' ' + values,
+        label: labelText,
         children: [...stepGroupApps],

Also applies to: 285-285

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/gitops/components/appset/graph/graph-utils.tsx` around lines 235 - 241,
Update the step-group label construction near stepMatchExpression to build the
label from non-empty key, operator, and values parts, avoiding extra spaces for
operators without values. When matchExpressions is missing or all parts are
empty, use a meaningful fallback label so every step group remains named in the
graph.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/gitops/components/appset/graph/graph-utils.tsx`:
- Around line 235-241: Update the step-group label construction near
stepMatchExpression to build the label from non-empty key, operator, and values
parts, avoiding extra spaces for operators without values. When matchExpressions
is missing or all parts are empty, use a meaningful fallback label so every step
group remains named in the graph.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: abb86971-bb4b-4c7e-bc9e-179d9b37ef01

📥 Commits

Reviewing files that changed from the base of the PR and between 7b31b33 and fbd0b43.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (11)
  • locales/en/plugin__gitops-plugin.json
  • locales/ja/plugin__gitops-plugin.json
  • locales/ko/plugin__gitops-plugin.json
  • locales/zh/plugin__gitops-plugin.json
  • package.json
  • src/gitops/components/application/graph/ApplicationGraphView.scss
  • src/gitops/components/application/graph/graph-utils.tsx
  • src/gitops/components/appset/AppSetMatchExpressionsTab.tsx
  • src/gitops/components/appset/graph/ApplicationSetGraphView.tsx
  • src/gitops/components/appset/graph/graph-utils.tsx
  • src/gitops/components/appset/graph/nodes/StepGroupComponent.tsx
🚧 Files skipped from review as they are similar to previous changes (9)
  • src/gitops/components/application/graph/graph-utils.tsx
  • src/gitops/components/appset/AppSetMatchExpressionsTab.tsx
  • src/gitops/components/appset/graph/nodes/StepGroupComponent.tsx
  • locales/ko/plugin__gitops-plugin.json
  • src/gitops/components/application/graph/ApplicationGraphView.scss
  • locales/zh/plugin__gitops-plugin.json
  • locales/ja/plugin__gitops-plugin.json
  • locales/en/plugin__gitops-plugin.json
  • src/gitops/components/appset/graph/ApplicationSetGraphView.tsx

@aali309 aali309 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Lets merge the pf6 PR first?

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