Skip to content

Filter out soft-deleted applications from list application result - #7375

Open
khanhtc1202 wants to merge 4 commits into
masterfrom
fix-application-list
Open

Filter out soft-deleted applications from list application result#7375
khanhtc1202 wants to merge 4 commits into
masterfrom
fix-application-list

Conversation

@khanhtc1202

@khanhtc1202 khanhtc1202 commented Sep 11, 2026

Copy link
Copy Markdown
Member

What this PR does:

Applications that have been soft-deleted (i.e., marked as deleted but not removed from the database) are now excluded from the results returned by the ListApplications handler (for both client api and web api).

Why we need it:

Currently, the pipectl application list command returns deleted applications. The same happened on UI, but we have filter logic so deleted applications aren't shown in the web UI. That means users who query applications via the pipectl application list command always get the same deleted/disabled applications and can't process scanning for new disabled applications to delete.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

  • How are users affected by this change: list applications returned by client/web api will not contain soft-deleted applications
  • Is this breaking change: No
  • How to migrate (if breaking change):

Screenshots/Videos (for documentation or website changes):
Attach a screenshot or screen recording if your PR modifies any files under docs/ or any .md/.mdx files. Run the site locally using make run/site and verify your changes before submitting.

Signed-off-by: khanhtc1202 <khanhtc1202@gmail.com>
Copilot AI lite review requested due to automatic review settings September 11, 2026 07:30
@khanhtc1202
khanhtc1202 requested a review from a team as a code owner September 11, 2026 07:30
@netlify

netlify Bot commented Sep 11, 2026

Copy link
Copy Markdown

Deploy Preview for pipecd-site canceled.

Name Link
🔨 Latest commit 63c7a0f
🔍 Latest deploy log https://app.netlify.com/projects/pipecd-site/deploys/6aa3cddeeef5870008831d5a

@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.38095% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 29.76%. Comparing base (5f74072) to head (63c7a0f).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
pkg/app/server/grpcapi/web_api.go 0.00% 7 Missing ⚠️
pkg/app/server/grpcapi/api.go 78.57% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7375      +/-   ##
==========================================
+ Coverage   29.74%   29.76%   +0.02%     
==========================================
  Files         601      601              
  Lines       64442    64442              
==========================================
+ Hits        19166    19184      +18     
+ Misses      43784    43765      -19     
- Partials     1492     1493       +1     
Flag Coverage Δ
. 23.61% <52.38%> (+0.03%) ⬆️
.-pkg-app-pipedv1-plugin-analysis 32.16% <ø> (ø)
.-pkg-app-pipedv1-plugin-ecs 33.64% <ø> (ø)
.-pkg-app-pipedv1-plugin-kubernetes 58.39% <ø> (ø)
.-pkg-app-pipedv1-plugin-kubernetes_multicluster 59.62% <ø> (ø)
.-pkg-app-pipedv1-plugin-scriptrun 54.83% <ø> (ø)
.-pkg-app-pipedv1-plugin-terraform 38.46% <ø> (ø)
.-pkg-app-pipedv1-plugin-wait 33.04% <ø> (ø)
.-pkg-app-pipedv1-plugin-waitapproval 52.71% <ø> (ø)
.-pkg-plugin-sdk 50.12% <ø> (ø)
.-tool-actions-gh-release 19.23% <ø> (ø)
.-tool-actions-plan-preview 25.51% <ø> (ø)
.-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 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.

Copilot AI left a comment

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.

🟡 Changes recommended

The critical pagination issue must be addressed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR excludes soft-deleted applications from ApplicationStore.List.

Changes:

  • Filters deleted applications at the datastore layer.
  • Affects CLI and other list consumers.
File summaries
File Review
pkg/datastore/applicationstore.go Critical: Post-query filtering can skip later live applications due to pagination holes. Continue scanning pages and preserve the cursor for the last returned row.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/datastore/applicationstore.go Outdated
Signed-off-by: khanhtc1202 <khanhtc1202@gmail.com>
Signed-off-by: khanhtc1202 <khanhtc1202@gmail.com>

Copilot AI left a comment

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.

🟡 Changes recommended

Client pagination can exceed the requested limit, and deleted-application filtering lacks regression coverage.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment on lines +348 to +350
for _, app := range apps {
if filterApp(app) {
filtered = append(filtered, app)
Comment on lines +312 to +315
if app.Deleted {
return false
}
if len(labels) > 0 && !app.ContainLabels(labels) {
Comment on lines +693 to +699
if app.Deleted {
continue
}
if len(labels) > 0 && !app.ContainLabels(labels) {
continue
}
filtered = append(filtered, app)
Signed-off-by: khanhtc1202 <khanhtc1202@gmail.com>
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.

2 participants