Skip to content

install: preserve options following --setup-repo - #7

Merged
soulteary merged 1 commit into
mainfrom
fix/setup-repo-option-parsing
Oct 5, 2026
Merged

soulteary merged 1 commit into
mainfrom
fix/setup-repo-option-parsing

Conversation

@soulteary

@soulteary soulteary commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fix --setup-repo swallowing the next command-line argument by removing its redundant shift. Add 17 offline parser regression scenarios and a dedicated sh/Bash CI workflow.

Head: fix/setup-repo-option-parsing (768f0ab6b6580a203ed2152fd32e453b07258ebc). Base: main (8e48617d08099001019c990a5bd366927d06cc62). This PR is intentionally left open for review; main is not changed by opening it.

Root cause and impact

--setup-repo is a valueless flag, but its case arm advances the argument list and the enclosing loop advances it again. This discards the following option:

  • --setup-repo --dry-run loses dry-run protection and can perform prerequisite installation and repository configuration.
  • --setup-repo --mirror Aliyun drops mirror selection; the same issue applies to TencentCloud.
  • Following --channel, --version, --no-autostart, --help, and unknown-option validation can also be skipped.

The defect exists in the inherited parser, not in the TencentCloud preset. A standalone --setup-repo already works and remains covered.

Do not reproduce the unpatched dry-run failure by running the full installer on a real host. The new regression suite executes an unchanged extraction of the real parser and mirror/channel validation, stopping before installation functions. If the extraction boundary is missing, it fails before executing the extracted file. A swallowed flag therefore cannot cause package-manager or network execution in these parser tests.

Changes

  • install.sh: remove exactly one redundant shift.
  • scripts/test-setup-repo.sh: cover both flag orders, adjacent value-taking options, repeated flags, help, environment compatibility, and invalid options/mirrors/channels.
  • .github/workflows/setup-repo.yml: shell syntax checks and the new suite under sh and Bash, using read-only repository permission and no cloud credentials.

No package list, service behavior, distribution detection, mirror endpoint, or unrelated fork changes are modified.

Validation

Local checks were run on both the fork-main baseline and the existing upstream PR branch baseline with the equivalent fix applied:

  • 17 new parser scenarios pass under sh/dash, Bash, and BusyBox ash.
  • All 18 existing mirror scenarios pass under the same shells.
  • (17 + 18) x 3 shells x 2 baselines = 210 successful scenario executions.
  • Both unpatched baselines fail the new --setup-repo --dry-run case with DRY_RUN empty.
  • Shell syntax and workflow YAML parsing checks pass; each installer's production diff is exactly one removed line.

GitHub's PR-triggered setup-repo option regression workflow has also passed: https://github.com/soulteary/docker-install/actions/runs/37315728110. The broader docker-install CI workflow was still in progress at the status check; this is not a claim that the full CI suite has passed.

Not performed locally: full make shellcheck / make test, Tencent Cloud network checks, package downloads, or Docker service acceptance. Docker and ShellCheck are unavailable locally. The public runner's offline tests do not establish Tencent Cloud intranet availability.

Upstream coordination

The equivalent isolated patch has been appended to feat/tencent-cloud-mirror as f25407a70dfc1bbf619bc25fec0d4191b5413f8c. Upstream docker#579 now reports that head and three commits, without importing unrelated fork-main changes. The generic parser fix is separate so it can be reviewed or cherry-picked independently.

Updating the upstream PR description and posting a supplemental comment were both attempted, but GitHub returned HTTP 403 (Resource not accessible by integration). Those upstream metadata writes did not happen. Replacement text has been prepared separately for the PR author. Upstream workflows currently report action_required, not successful execution.

Both fix commits contain Signed-off-by: Su Yang <soulteary@users.noreply.github.com>.

Remove the extra shift from the valueless --setup-repo option. The loop
already advances past the current option; advancing twice discarded the
next argument, including --dry-run, --mirror, --channel, or --help.
A swallowed --dry-run could run prerequisite installation and repository
configuration instead of only printing the execution plan.

Add 17 offline parser regression scenarios and a dedicated sh/bash CI
workflow. Extract the real parser before installation functions so the
regression cannot invoke package managers even against a broken script.
Cover option order, values, repeated flags, environment compatibility,
help, and error handling without changing other option semantics.

Validated on both fork-main and TencentCloud branch baselines: 17 new
parser scenarios plus 18 existing mirror scenarios under sh, bash, and
BusyBox ash (210 successful scenario executions). Both unpatched baselines
fail the new --setup-repo --dry-run regression. Shell syntax and workflow
YAML checks passed. No cloud network or package installation was tested.

Signed-off-by: Su Yang <soulteary@users.noreply.github.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-05T13:21:28.269086Z 768f0ab PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copy link
Copy Markdown
Owner Author

Final CI check for head 768f0ab6b6580a203ed2152fd32e453b07258ebc: all three PR-triggered workflows have completed successfully.

This supersedes the earlier in-progress status in the PR description. The PR remains open and has not been merged into main. Upstream docker#579 already contains the equivalent fix commit f25407a70dfc1bbf619bc25fec0d4191b5413f8c, but its workflows still require upstream action and the integration could not edit its description or post the supplemental comment (HTTP 403). Tencent Cloud intranet and real VM installation acceptance are still not performed.

@soulteary
soulteary merged commit f6ea53e into main Oct 5, 2026
37 checks passed
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.

1 participant