aiida-core icon indicating copy to clipboard operation
aiida-core copied to clipboard

Feature: Multi computer and code export/import via YAML files

Open GeigerJ2 opened this issue 3 months ago • 1 comments

[wip]

Why verdi comptuer setup-many instead of modifying setup

A separate verdi computer setup-many command was added rather than extending the existing setup command due to architectural constraints in AiiDA's CLI framework:

Key difficulties with modifying setup:

  • Required field validation: Click validates required options (--label, --hostname, etc.) before the function executes, making it impossible to bypass validation when using config files
  • ConfigFileOption conflicts: The existing ConfigFileOption automatically merges single YAML files into CLI parameters but doesn't support multiple files
  • Interactive prompting system: The command's interactive behavior (prompting for missing fields) conflicts with batch operations that should be non-interactive by design

I attempted to retrofit the batch functionality onto the interactive single-computer setup command, but that either resulted in parameter validation errors, prompting conflicts, or complex workarounds that would compromise the existing user experience. In the end, adding a new setup-many command instead seemed like a better option, and provides a clean, purpose-built solution for batch operations without affecting the existing functionality.

GeigerJ2 avatar Sep 12 '25 08:09 GeigerJ2

Codecov Report

:x: Patch coverage is 50.72464% with 34 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 78.99%. Comparing base (9bccdc8) to head (50e976c).

Files with missing lines Patch % Lines
src/aiida/cmdline/commands/cmd_computer.py 18.19% 18 Missing :warning:
src/aiida/cmdline/commands/cmd_code.py 65.22% 16 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7007      +/-   ##
==========================================
- Coverage   79.04%   78.99%   -0.05%     
==========================================
  Files         566      566              
  Lines       43699    43754      +55     
==========================================
+ Hits        34539    34560      +21     
- Misses       9160     9194      +34     

: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.

codecov[bot] avatar Sep 12 '25 08:09 codecov[bot]