Skip to content

Back up each name given to the interactive backup command - #68

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/interactive-backup-multiple-names
Nov 11, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feature/interactive-backup-multiple-names

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

  • The interactive backup command now splits its argument on whitespace and backs up each name in turn, matching the command-line form (java -jar gh-backup.jar octocat github). Previously backup octocat github passed the single name octocat github to GitHub, which can never match, so nothing was backed up.
  • A name that fails is reported on standard error and the remaining names are still backed up. The command still counts as one backup-completed usage event, as before.
  • The backup usage hint now reads Usage: backup <user/org> [user/org2] .... The startup menu and help lines are left unchanged so the recorded docs/images/gh-backup-interactive.gif stays accurate.
  • COMMANDS.md, USER_GUIDE.md and CHANGELOG.md ([Unreleased] → Fixed) describe the multi-name form.

Closes #67

Test plan

  • mvn test: 225 tests run, 0 failures, 0 errors, 1 skipped (that skip was already there)
  • New tests testRun_InteractiveMode_BackupSeveralNames_EachBackedUpSeparately and ..._FailureDoesNotStopTheOthers were confirmed to fail with the source fix stashed and to pass with it restored
  • testRun_InteractiveMode_BackupWithoutTarget was updated for the new usage hint

Deferred issues

A documentation accuracy sweep of README.md, COMMANDS.md, CONFIG.md, USER_GUIDE.md and CONTRIBUTING.md against the source was also performed this cycle; no other drift was found.

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric (a Copilot review was requested but the reviewer is not configured on this repository, so the rubric below is the review):

  • Scope: PASS — the five files are the fix (BackupCommandLineRunner.java), its tests, and the three docs that describe the interactive backup command (COMMANDS.md, USER_GUIDE.md, CHANGELOG.md); no unrelated churn.
  • Tests-new: PASS — no new public method is added; the changed branch of runInteractiveMode is exercised by two new tests.
  • Tests-fix: PASS — with BackupCommandLineRunner.java stashed, BackupCommandLineRunnerTest failed 3 of 38 (both new tests plus the updated usage-hint assertion); restored, 38/38 passed.
  • Sibling structure: PASS — new tests follow the testRun_InteractiveMode_<Scenario> naming and the provideInput / @Mock + openMocks pattern of their neighbours.
  • Sibling renames: PASS — none renamed.
  • Docs: PASS — COMMANDS.md and USER_GUIDE.md interactive tables show backup <user/org> [user/org2] ...; CHANGELOG.md [Unreleased] → Fixed has an entry; README.md and CONFIG.md do not describe the command's arguments.
  • Issue resolution: PASS — Interactive backup treats several names as one GitHub name #67 names the single-split in runInteractiveMode, which is exactly the line replaced.
  • CI: PASS — build and docker-build both green on the PR head.
  • Config-doc parity: PASS — no property added or changed.
  • Command-doc parity: PASS — no new CLI flag, JVM property or REST endpoint; the changed interactive command is documented.
  • Package placement: PASS — no new classes.
  • No credential leakage: PASS — only user/org names are printed, as before.

Notes outside the diff:

  • src/main/java/com/github/backup/BackupCommandLineRunner.java:142 — parts[1] cannot be empty or start with whitespace here (the line is trimmed and split once on \s+), so the per-name loop never receives an empty name.
  • src/main/java/com/github/backup/BackupCommandLineRunner.java:109,162 — the startup menu and help text still read backup <user/org>; this was left as is so the recorded docs/images/gh-backup-interactive.gif stays accurate. The docs tables and usage hint carry the multi-name form.
  • Interactive mode, unlike the command line, does not reject a hyphen-leading name as an unknown option (backup -x is looked up on GitHub). This predates the PR and is out of its scope.

Verdict: ready to merge once the docs check passes.

This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit b0947a8 into main Nov 11, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/interactive-backup-multiple-names branch November 11, 2026 04:36
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.

Interactive backup treats several names as one GitHub name

1 participant