Skip to content

Fix error stages are not shown for plugin-arch piped created pipeline#5950

Merged
khanhtc1202 merged 6 commits into
masterfrom
fix-visible-stage-ui
Jun 26, 2025
Merged

Fix error stages are not shown for plugin-arch piped created pipeline#5950
khanhtc1202 merged 6 commits into
masterfrom
fix-visible-stage-ui

Conversation

@khanhtc1202
Copy link
Copy Markdown
Member

@khanhtc1202 khanhtc1202 commented Jun 13, 2025

What this PR does:

Fix error the stages are not showing for plugin-arch piped created pipeline.

Why we need it:

Previously, the stage visibility was based on pipelineStage.visible field, which is marked as deprecated for pipedv1 (plugin-arch piped). This change updates the UI logic to show the stage as expected without using pipelineStage.visible field. Instead, the UI will use pipelineStage.status and pipelineStage.rollback values to determine whether to show a stage in the pipeline or not.

Screenshot 2025-06-26 at 16 34 59

Which issue(s) this PR fixes:

Part of #4980

Does this PR introduce a user-facing change?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

Signed-off-by: khanhtc1202 <khanhtc1202@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.15%. Comparing base (6eb415a) to head (1460183).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5950   +/-   ##
=======================================
  Coverage   28.15%   28.15%           
=======================================
  Files         518      518           
  Lines       55910    55910           
=======================================
  Hits        15744    15744           
  Misses      38914    38914           
  Partials     1252     1252           
Flag Coverage Δ
. 23.22% <ø> (ø)
.-pkg-app-pipedv1-plugin-example 0.00% <ø> (ø)
.-pkg-app-pipedv1-plugin-kubernetes 66.42% <ø> (ø)
.-pkg-app-pipedv1-plugin-kubernetes_multicluster 67.51% <ø> (ø)
.-pkg-app-pipedv1-plugin-wait 35.51% <ø> (ø)
.-pkg-plugin-sdk 50.89% <ø> (ø)
.-tool-actions-gh-release 19.23% <ø> (ø)
.-tool-actions-plan-preview 25.30% <ø> (ø)
.-tool-codegen-protoc-gen-auth 0.00% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.

@khanhtc1202 khanhtc1202 marked this pull request as ready for review June 26, 2025 07:32
@khanhtc1202 khanhtc1202 requested review from a team as code owners June 26, 2025 07:32
Copy link
Copy Markdown
Member

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

I left a comment about the optional chaining feature of TypeScript.

const stages: Stage[][] = [];
const visibleStages = deployment.stagesList.filter((stage) => stage.visible);
let visibleStages: Stage[] = [];
if (deployment.deployTargetsByPluginMap?.length === 0) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure about the optional chaining feature in TypeScript, but I think that the deployment.deployTargetsByPluginMap?.length will be undefined when the deployment.deployTargetsByPluginMap is null/undefined. And undefined === 0 will be false.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yep, I think you can change like that.

 if (deployment?.deployTargetsByPluginMap?.length) return PIPED_VERSION.V1;

this would reject both "undefined" and "length === 0"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks both, addressed by 1460183 🙏

Signed-off-by: khanhtc1202 <khanhtc1202@gmail.com>
Copy link
Copy Markdown
Contributor

@hongky-1994 hongky-1994 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Copy Markdown
Member

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

👍🏻

@khanhtc1202 khanhtc1202 merged commit c382260 into master Jun 26, 2025
37 of 40 checks passed
@khanhtc1202 khanhtc1202 deleted the fix-visible-stage-ui branch June 26, 2025 07:55
@github-actions github-actions Bot mentioned this pull request Jul 14, 2025
@github-actions github-actions Bot mentioned this pull request Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants