Skip to content

[IMP] cli: rewrite help, fix bugs, modernize codebase - #227

Closed
nhomar wants to merge 5 commits into
mainfrom
main-study-cli-v2
Closed

[IMP] cli: rewrite help, fix bugs, modernize codebase#227
nhomar wants to merge 5 commits into
mainfrom
main-study-cli-v2

Conversation

@nhomar

@nhomar nhomar commented Feb 14, 2026

Copy link
Copy Markdown
Member

Rationale

Rebased on main (7.0.0) keeping only the changes that still apply after the deployv-only refactor (.travis.yml support was dropped in the meantime, the tool now works exclusively from the variables.sh of the deployv image).

Changes kept (adapted to the current codebase)

# Tag Description
1 [FIX] --build-env-args VAR1 VAR2 silently discarded all but the first variable due to x[0] extraction (this is exactly the usage documented in the README). Flatten instead, with test coverage.
2 [REF] git_run.py used bare print() calls that polluted stdout with no way to silence them; use logging.debug().
3 [FIX] The --run-extra-args default -itP duplicated the -ditP already hardcoded in the 20-run.sh template.
4 [IMP] Rewrite all --help descriptions: program description/epilog with examples, document every default, and fix the wrong --build-env-args help (the deployv template generates ENV NAME=TRUE, not ARG/ENV NAME=$NAME).
5 [IMP] README: document the Ed25519 SSH key flow (the tool already prefers id_ed25519.pub and warns RSA is deprecated), keep RSA as legacy.

Changes dropped (already obsolete on main)

  • Delete .travis.yml — already removed on main.
  • setup.cfg universal = 0 — the [bdist_wheel] section no longer exists.
  • Python 2 vestiges (encode('utf-8') try/except) — already removed by the pathlib migration / pre-commit autofixes.
  • Default Python 3.5 → 3.10_python_version_env no longer exists (deployv-only mode).
  • 20-run.sh rewrite — superseded by the detach-aware rewrite on main (-ditP + docker attach + ownership fix).
  • README output paths (2_7/env_1_job_1) — the output structure is flat now; the README on main is already correct.
  • .t2d.yml docs and help texts referencing .travis.yml parsing — that mode no longer exists; help texts were rewritten for the variables.sh/deployv reality instead.

nhomar added 5 commits August 7, 2026 15:54
Using --build-env-args with multiple values in a single flag, e.g.:

    --build-env-args VIM_INSTALL ZSH_INSTALL

silently discarded every value but the first one, because the parsing
only extracted item[0] from each appended nargs list. This is exactly
the usage documented in the README, so it was broken as documented.

Flatten the nested lists instead, so both the repeated-flag form and
the multi-value form generate every ENV line in the Dockerfile.
Every git command executed was printed twice to stdout with bare
print() calls, polluting the tool output with debug noise that could
not be silenced. Use logging.debug() instead, so it stays hidden by
default and can be enabled when actually debugging.
The 20-run.sh template already hardcodes -ditP in the docker run
command, so the -itP included in the --run-extra-args default value
produced 'docker run -itP ... -ditP ...' with every flag repeated.
Docker tolerates the repetition, but it is confusing when reading the
generated script and the --help default. Keep only the LANG export in
the default value.
The --help output had terse descriptions with no examples nor default
values, making the tool hard to discover without reading the source.

- Add a program description explaining what the tool actually does
  today: generate a Dockerfile and helper scripts from the deployv
  image of a repository based on its variables.sh file.
- Add an epilog with usage examples and the TRAVIS2DOCKER_ROOT_PATH
  environment variable.
- Document the default value of every parameter in its help text.
- Fix the --build-env-args help: it documented 'ARG NAME' and
  'ENV NAME=$NAME' lines, but the deployv template actually generates
  'ENV NAME=TRUE' lines used to enable optional installation steps
  such as VIM_INSTALL and ZSH_INSTALL.
- Clarify that -ditP is already hardcoded in 20-run.sh so it does not
  need to be passed via --run-extra-args.
The tool prefers ~/.ssh/id_ed25519.pub for the container's
authorized_keys and warns that RSA keys are deprecated, but the README
only documented how to remove the passphrase from RSA keys. Document
the Ed25519 flow first and keep the RSA one as legacy.

Also clarify that https urls are supported for public repositories and
remove trailing whitespace.
@moylop260

Copy link
Copy Markdown
Collaborator

Superseded by #238

@moylop260 moylop260 closed this Aug 7, 2026
@moylop260
moylop260 deleted the main-study-cli-v2 branch August 7, 2026 22:15
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.

2 participants