Filter out soft-deleted applications from list application result - #7375
Filter out soft-deleted applications from list application result#7375khanhtc1202 wants to merge 4 commits into
Conversation
Signed-off-by: khanhtc1202 <khanhtc1202@gmail.com>
✅ Deploy Preview for pipecd-site canceled.
|
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 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.
Signed-off-by: khanhtc1202 <khanhtc1202@gmail.com>
There was a problem hiding this comment.
🟡 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
| for _, app := range apps { | ||
| if filterApp(app) { | ||
| filtered = append(filtered, app) |
| if app.Deleted { | ||
| return false | ||
| } | ||
| if len(labels) > 0 && !app.ContainLabels(labels) { |
| if app.Deleted { | ||
| continue | ||
| } | ||
| if len(labels) > 0 && !app.ContainLabels(labels) { | ||
| continue | ||
| } | ||
| filtered = append(filtered, app) |
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 listcommand 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?:
Screenshots/Videos (for documentation or website changes):
Attach a screenshot or screen recording if your PR modifies any files under
docs/or any.md/.mdxfiles. Run the site locally usingmake run/siteand verify your changes before submitting.