Add duplicate check when registering a new app for pipectl
Fix Issue #3806 What: This PR adds a duplicate check to the pipectl application add command, preventing the registration of applications with duplicate names or identical repository paths.
Why: Previously, users could inadvertently register the same application multiple times, leading to confusion and potential deployment issues. This enhancement ensures the uniqueness of application entries, improving the reliability of the deployment process.
How:
Implements a check that retrieves existing applications via the ListApplications API.
Compares the new application's name and repository path against existing entries.
If a duplicate is detected, the command aborts and returns an appropriate error message.
@Tushar240503 Could you link the issue for this change? 👀
@khanhtc1202 Done
Thanks @Tushar240503 👍 I think it could be better to not send all applications to the client as implemented by this PR, it can lead to several problems include security, and performance issue. It's better to update the server side grpc handler, which processes this Add Application action to validate before create.
ref: https://github.com/pipe-cd/pipecd/blob/master/pkg/app/server/grpcapi/api.go#L134
It's better to update the server side grpc handler,
+1. I wanted to say the same point 😄
Codecov Report
Attention: Patch coverage is 0% with 46 lines in your changes missing coverage. Please review.
Project coverage is 27.80%. Comparing base (
859cc1b) to head (c6aaa8d).
| Files with missing lines | Patch % | Lines |
|---|---|---|
| pkg/app/server/grpcapi/api.go | 0.00% | 46 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #5840 +/- ##
==========================================
- Coverage 27.81% 27.80% -0.02%
==========================================
Files 510 510
Lines 54281 54327 +46
==========================================
+ Hits 15099 15105 +6
- Misses 38036 38076 +40
Partials 1146 1146
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Sorry, we updated the CI and branch protection rules.
I updated the branch of this PR by pushing the Update branch button, which is the GitHub feature.
Please let me know if you see any unexpected behavior.
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This PR was closed because it has been stalled for 7 days with no activity. Feel free to reopen if still applicable.