Repository navigation
install: preserve options following --setup-repo - #7
Conversation
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>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Final CI check for head
This supersedes the earlier in-progress status in the PR description. The PR remains open and has not been merged into |
Summary
Fix
--setup-reposwallowing the next command-line argument by removing its redundantshift. 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;mainis not changed by opening it.Root cause and impact
--setup-repois 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-runloses dry-run protection and can perform prerequisite installation and repository configuration.--setup-repo --mirror Aliyundrops mirror selection; the same issue applies toTencentCloud.--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-repoalready 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 redundantshift.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 + 18) x 3 shells x 2 baselines = 210successful scenario executions.--setup-repo --dry-runcase withDRY_RUNempty.GitHub's PR-triggered
setup-repo option regressionworkflow has also passed: https://github.com/soulteary/docker-install/actions/runs/37315728110. The broaderdocker-install CIworkflow 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-mirrorasf25407a70dfc1bbf619bc25fec0d4191b5413f8c. 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 reportaction_required, not successful execution.Both fix commits contain
Signed-off-by: Su Yang <soulteary@users.noreply.github.com>.