pipecd icon indicating copy to clipboard operation
pipecd copied to clipboard

Add duplicate check when registering a new app for pipectl

Open Tushar240503 opened this issue 7 months ago • 7 comments

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 avatar May 16 '25 13:05 Tushar240503

@Tushar240503 Could you link the issue for this change? 👀

khanhtc1202 avatar May 16 '25 13:05 khanhtc1202

@khanhtc1202 Done

Tushar240503 avatar May 16 '25 14:05 Tushar240503

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.

khanhtc1202 avatar May 16 '25 14:05 khanhtc1202

ref: https://github.com/pipe-cd/pipecd/blob/master/pkg/app/server/grpcapi/api.go#L134

khanhtc1202 avatar May 16 '25 14:05 khanhtc1202

It's better to update the server side grpc handler,

+1. I wanted to say the same point 😄

t-kikuc avatar May 16 '25 14:05 t-kikuc

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.

codecov[bot] avatar May 17 '25 23:05 codecov[bot]

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.

Warashi avatar May 29 '25 03:05 Warashi

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.

github-actions[bot] avatar Jun 30 '25 00:06 github-actions[bot]

This PR was closed because it has been stalled for 7 days with no activity. Feel free to reopen if still applicable.

github-actions[bot] avatar Jul 07 '25 00:07 github-actions[bot]