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: Allow higher than index 10 for verdi presto #6477

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

mbercx
Copy link
Member

@mbercx mbercx commented Jun 18, 2024

Fixes #6476

When the user is using verdi presto to create more than 11 profiles, the command will fåail because presto-10 already exists. This is due to the fact that the get_default_presto_profile_name() function sorts the existing indices as strings, which means 10 will precede 9 and hence the "last index" would be 9, making the new index 10, which already exists.

Here we fix this issue by casting the extracted existing indices as integers, so the sorting works as intended.

@mbercx mbercx requested a review from sphuber June 18, 2024 08:05
Copy link

codecov bot commented Jun 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.75%. Comparing base (ef60b66) to head (756aba4).
Report is 112 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6477      +/-   ##
==========================================
+ Coverage   77.51%   77.75%   +0.25%     
==========================================
  Files         560      561       +1     
  Lines       41444    41771     +327     
==========================================
+ Hits        32120    32476     +356     
+ Misses       9324     9295      -29     

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

Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

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

You ok Marnik, or do you have a consumption problem?

Great fix, but could you please add a quick test for it. Should be easy to create a presto-10 with the profile generation fixture and then running the command.

@mbercx mbercx force-pushed the fix/presto-overuse branch from 53e8439 to fc39480 Compare June 19, 2024 04:38
When the user is using `verdi presto` to create more than 11 profiles, the command will
fail because `presto-10` already exists. This is due to the fact that the
`get_default_presto_profile_name()` function sorts the existing indices as strings,
which means `10` will precede `9` and hence the "last index" would be `9`, making the
new index `10`, which already exists.

Here we fix this issue by casting the extracted existing indices as integers, so the
sorting works as intended.
@mbercx mbercx force-pushed the fix/presto-overuse branch from fc39480 to 756aba4 Compare June 19, 2024 04:39
@mbercx mbercx requested a review from sphuber June 19, 2024 04:40
@sphuber sphuber merged commit 022f049 into aiidateam:main Jun 19, 2024
11 checks passed
@mbercx mbercx deleted the fix/presto-overuse branch June 19, 2024 09:26
mikibonacci pushed a commit to mikibonacci/aiida-core that referenced this pull request Sep 3, 2024
…team#6477)

When the user is using `verdi presto` to create more than 11 profiles, the command will
fail because `presto-10` already exists. This is due to the fact that the
`get_default_presto_profile_name()` function sorts the existing indices as strings,
which means `10` will precede `9` and hence the "last index" would be `9`, making the
new index `10`, which already exists.

Here we fix this issue by casting the extracted existing indices as integers, so the
sorting works as intended.
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 is limited to index 10
2 participants