Skip to content

[mirror] Ignore --no-modules when --include-module is set#417

Merged
ldmonster merged 2 commits into
mainfrom
fix/mirror-mutually-exclusive-module-flags
Jul 23, 2026
Merged

[mirror] Ignore --no-modules when --include-module is set#417
ldmonster merged 2 commits into
mainfrom
fix/mirror-mutually-exclusive-module-flags

Conversation

@Glitchy-Sheep

Copy link
Copy Markdown
Contributor

Summary

--no-modules and --include-module contradict each other. Treat the whitelist as intent: mirror the listed modules and drop --no-modules, instead of silently mirroring nothing.

Problem

  • --no-modules skips module mirroring, --include-module whitelists modules to mirror
  • Passing both was accepted, and --include-module was silently ignored
  • The user got a bundle with no modules and no hint that their whitelist did nothing

Fix

  • Resolve the pair in parseAndValidateParameters: when both are set, --include-module wins
  • Clear --no-modules so only the whitelisted modules are mirrored
  • Print a one-line stderr warning so the ignored flag is not a surprise

Before / After

Before: --no-modules --include-module foo skipped all modules and ignored the whitelist without warning.
After: the same command warns --no-modules is ignored because --include-module is set and mirrors only foo.

Tests

  • TestValidationResolveModuleFlags - covers the pair dropping --no-modules, and each flag alone left untouched

--include-module was silently ignored under --no-modules, producing a
bundle with no modules and no warning. Treat the whitelist as intent:
drop --no-modules, mirror only the listed modules, and warn on stderr.

Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
@Glitchy-Sheep
Glitchy-Sheep requested a review from ldmonster as a code owner July 23, 2026 13:54
@Glitchy-Sheep Glitchy-Sheep self-assigned this Jul 23, 2026
@Glitchy-Sheep Glitchy-Sheep added the bug Something isn't working label Jul 23, 2026
Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
@ldmonster
ldmonster merged commit 0c0ff84 into main Jul 23, 2026
5 checks passed
@ldmonster
ldmonster deleted the fix/mirror-mutually-exclusive-module-flags branch July 23, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants