[deckhouse-cli] Update the description of mirror pull flags - #411
Merged
Conversation
VaLosev
force-pushed
the
chore/update-description-flags-mirror-pull
branch
from
July 24, 2026 14:31
387dd55 to
1d75b8f
Compare
Signed-off-by: Valery Losev <[email protected]>
Signed-off-by: Valery Losev <[email protected]>
Signed-off-by: Valery Losev <[email protected]>
- `modules.ErrEmptyConstraint` is now the contract for "name@ with nothing after it", matched via `errors.Is`. - The quoting hint keyed off the literal "empty constraint" text, so rewording that message switched the hint off with the whole suite still green. - Tests take the error from a real `modules.NewFilter` call instead of building their own. Signed-off-by: Roman Berezkin <[email protected]>
The blacklist branches parse the same name@constraint dialect, so an unquoted `--exclude-module console@>=1.43.2` hit the raw "Prepare module filter: empty constraint" while the include flags already explained it. Signed-off-by: Roman Berezkin <[email protected]>
The flag takes a bare constraint, so an unquoted `--include-platform >=1.64 ./bundle` leaves the flag holding the bundle path and no positional argument. The previous hook could not fire here at all: it needed both an empty constraint and a value ending with '@', and those two are mutually exclusive for this flag. Signed-off-by: Roman Berezkin <[email protected]>
- `--include-module` and `--include-platform` were 52 lines of prose in `--help`. Rules that cannot be read off the syntax stay as three short paragraphs, examples become a table. - Quoting is shown, not explained: the rows that need quotes carry them, so the per-row "(quote in shell)" notes are gone. - `--exclude-module`, `--exclude-package` and `--include-package` say they take the same dialect as `--include-module`, quoting included. Signed-off-by: Roman Berezkin <[email protected]>
All five call sites are exercised through createModuleFilter, createPackageFilter and parseAndValidateVersionFlags, so dropping a hook now fails the suite. Before this, the whole feature could be deleted with `./internal/mirror/...` still green: every test called the detector directly with a hand-built error. Signed-off-by: Roman Berezkin <[email protected]>
- Three example rows stated behaviour the code does not have: a bare name is not "every version" (it collapses to the latest patch per minor), `+channel` has no effect for `--include-platform`, and `=bobV1` is published to every channel like any other single exact pin. - `looksLikePath` only saw ./ ../ / ~/, so a bundle directory typed as `out` or `bundles/d8` lost the hint. A separator now settles it, and a bare name counts when it is an existing directory. - The Example line kept a hardcoded module and path while the line above it used the real value, so the two disagreed. Dropped. Signed-off-by: Roman Berezkin <[email protected]>
Glitchy-Sheep
force-pushed
the
chore/update-description-flags-mirror-pull
branch
from
July 28, 2026 12:57
fe89fcf to
819da10
Compare
`%q` closed before the `@`, so the example read "console"@^1.0.0 and was not copy-pasteable. It was also the last place in mirror pull still quoting a fragment instead of the whole value. Signed-off-by: Roman Berezkin <[email protected]>
Glitchy-Sheep
approved these changes
Jul 28, 2026
ldmonster
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, running the
d8 mirror pullcommand with the--include-moduleflag may result in an error due to redirection with the ">" symbol.To avoid this issue, I've highlighted in the flag descriptions that the module version and its restrictions should be written in quotation marks.
Added the DiagnoseConstraintParseError function to report an error when output is redirected instead of being passed to d8.
This function is triggered when both signals are present:
modules.NewFilter/modules.ParseVersionConstraintproduces when there is no constraint).@after whitespace removal—a clear sign that the shell ate the>=…part as a redirection target.The parseAndValidateVersionFlags, createModuleFilter, and createPackageFilter functions have been updated to call this check, and tests have been added.