Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: Fail early in verdi presto when profile name already exists #6488

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Jun 28, 2024

Fixes #6482

If an explicit profile name is specified with -p/--profile-name it should be validated as soon as possible and error if the profile already exists, before anything else is done. This prevents, for example, that a PostgreSQL user and database are created that are then not cleaned up.

If an explicit profile name is specified with `-p/--profile-name` it
should be validated as soon as possible and error if the profile already
exists, before anything else is done. This prevents, for example, that a
PostgreSQL user and database are created that are then not cleaned up.
@sphuber sphuber requested a review from GeigerJ2 June 28, 2024 08:55
Copy link

codecov bot commented Jun 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.76%. Comparing base (ef60b66) to head (d79eb36).
Report is 114 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6488      +/-   ##
==========================================
+ Coverage   77.51%   77.76%   +0.26%     
==========================================
  Files         560      561       +1     
  Lines       41444    41798     +354     
==========================================
+ Hits        32120    32502     +382     
+ Misses       9324     9296      -28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

GeigerJ2

This comment was marked as duplicate.

Copy link
Contributor

@GeigerJ2 GeigerJ2 left a comment

Choose a reason for hiding this comment

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

Looks fine, thanks @sphuber!

@sphuber sphuber merged commit 45a8b46 into aiidateam:main Jun 28, 2024
11 checks passed
@sphuber sphuber deleted the fix/6482/verdi-presto-validate-profile-name-first branch June 28, 2024 13:47
mikibonacci pushed a commit to mikibonacci/aiida-core that referenced this pull request Sep 3, 2024
…iidateam#6488)

If an explicit profile name is specified with `-p/--profile-name` it
should be validated as soon as possible and error if the profile already
exists, before anything else is done. This prevents, for example, that a
PostgreSQL user and database are created that are then not cleaned up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

verdi presto --use-postgres with existing profile name still creates PSQL db
2 participants