Skip to content

test-features: add --[no-]enforce-cascades - #2182

Merged
Billy O'Neal (BillyONeal) merged 2 commits into
microsoft:mainfrom
BillyONeal:add-cascade-check-switch
Nov 4, 2026
Merged

Billy O'Neal (BillyONeal) merged 2 commits into
microsoft:mainfrom
BillyONeal:add-cascade-check-switch

Conversation

@BillyONeal

Copy link
Copy Markdown
Member

As of #1686 , x-test-features reports cascades with an implicit pass expectation only when --all was specified. Allow callers to control this independently of which ports are selected:

  • --enforce-cascades enables these diagnostics for selected ports.
  • --no-enforce-cascades disables these diagnostics even with --all.
  • When unspecified, retain the existing default: on with --all, off otherwise.

Disabling enforcement does not hide dependency build failures or cascades that contradict explicit pass/fail expectations.

Drive by: honor --no-verbose in x-add-version while preserving its defaults. Document why --only-downloads must imply --keep-going and CMake variable arguments must imply --editable/non-cached builds rather than treating those implications as overridable defaults.

Previously, x-test-features reported cascades with an implicit pass
expectation only when --all was specified. Allow callers to control this
independently of which ports are selected:

* --enforce-cascades enables these diagnostics for selected ports.
* --no-enforce-cascades disables these diagnostics even with --all.
* When unspecified, retain the existing default: on with --all, off
  otherwise.

Explicit baseline expectations are still checked regardless of this
switch. Disabling enforcement does not hide dependency build failures or
cascades that contradict explicit pass/fail expectations.

Store ParsedArguments::switches as a map of names to bool values so the
existing console parser's no- handling no longer loses explicit false
values. Add switch_on for existing default-off callers and read_switch,
returning a const bool pointer, to distinguish unspecified from false.
Migrate existing callers and preserve enabled-only artifact forwarding
and mutually exclusive artifact switch checks.

Also honor --no-verbose in x-add-version while preserving its defaults.
Document why --only-downloads must imply keep-going and CMake variable
arguments must imply editable/non-cached builds rather than treating
those implications as overridable defaults. Update localized help and
regenerate the message map.

Add coverage for static and dynamic cascade overrides, unchanged explicit
baseline enforcement, switch values and artifact forwarding, and
add-version verbosity with and without --all.

Validation: Windows x64 Debug builds; focused argument, console parser,
and depend-info unit tests; complete test-features and versions E2E
suites; clang-format, whitespace, and message usage checks.

Related: microsoft#1686

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 4, 2026 00:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are blocking approval.

No open issues 🎉

What changed in this PR

Adds independent control over cascade diagnostics in x-test-features, extending #1686 while preserving the existing defaults. The shared argument parser now distinguishes omitted switches from explicitly disabled ones.

Changes:

  • Adds --enforce-cascades and --no-enforce-cascades, with regression coverage for overrides and dependency failures.
  • Migrates command switch consumers to boolean-aware accessors and makes x-add-version honor --no-verbose.
  • Updates help text and documents why download-only builds require keep-going and CMake variable arguments require non-cached builds.
File Description
src/​vcpkg/​vcpkgcmdarguments.cpp Preserves explicit false values and implements switch accessors.
src/​vcpkg/​configure-environment.cpp Forwards and validates only enabled artifact switches.
src/​vcpkg/​commands.z-generate-message-map.cpp Uses boolean-aware output-comment handling.
src/​vcpkg/​commands.z-check-tools-sha.cpp Uses boolean-aware fix handling.
src/​vcpkg/​commands.z-applocal.cpp Uses the verbosity switch accessor.
src/​vcpkg/​commands.upgrade.cpp Migrates upgrade switch checks.
src/​vcpkg/​commands.update-registry.cpp Migrates all-registries switch handling.
src/​vcpkg/​commands.update-baseline.cpp Migrates baseline-update switch checks.
src/​vcpkg/​commands.test-features.cpp Adds cascade enforcement overrides across cascade paths.
src/​vcpkg/​commands.set-installed.cpp Migrates switches and explains required keep-going behavior.
src/​vcpkg/​commands.search.cpp Migrates search output switches.
src/​vcpkg/​commands.remove.cpp Migrates removal switch checks.
src/​vcpkg/​commands.regenerate.cpp Migrates forwarded regeneration switches.
src/​vcpkg/​commands.print-usage.cpp Migrates usage-generation switches.
src/​vcpkg/​commands.package-info.cpp Migrates package-query switches.
src/​vcpkg/​commands.new.cpp Migrates project-creation switches.
src/​vcpkg/​commands.list.cpp Migrates listing output switches.
src/​vcpkg/​commands.install.cpp Migrates switches and documents mandatory build implications.
src/​vcpkg/​commands.format-manifest.cpp Migrates manifest-formatting switches.
src/​vcpkg/​commands.find.cpp Migrates find output switches.
src/​vcpkg/​commands.fetch.cpp Migrates status-stream switch handling.
src/​vcpkg/​commands.export.cpp Migrates export switch checks.
src/​vcpkg/​commands.env.cpp Migrates environment-selection switches.
src/​vcpkg/​commands.edit.cpp Migrates editor-target switches.
src/​vcpkg/​commands.download.cpp Migrates download and progress switches.
src/​vcpkg/​commands.depend-info.cpp Migrates dependency-display switches.
src/​vcpkg/​commands.ci.cpp Migrates CI switch checks.
src/​vcpkg/​commands.ci-verify-versions.cpp Migrates version-verification switches.
src/​vcpkg/​commands.check-support.cpp Migrates JSON-output switch handling.
src/​vcpkg/​commands.add-version.cpp Honors explicit verbosity overrides while retaining defaults.
src/​vcpkg-test/​commands.dependinfo.cpp Updates switch fixtures and tests disabled graph switches.
src/​vcpkg-test/​arguments.cpp Tests tri-state switches and disabled artifact forwarding.
locales/​messages.json Updates generated English help messages.
include/​vcpkg/​vcpkgcmdarguments.h Defines boolean switch storage and accessors.
include/​vcpkg/​configure-environment.h Clarifies enabled-switch forwarding in a comment.
include/​vcpkg/​base/​message-data.inc.h Declares cascade and verbosity help text.
include/​vcpkg/​base/​contractual-constants.h Defines the cascade enforcement switch name.
azure-pipelines/​end-to-end-tests-dir/​versions.ps1 Tests verbosity defaults and overrides.
azure-pipelines/​end-to-end-tests-dir/​test-features.ps1 Tests cascade overrides and preserved failure diagnostics.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 4, 2026 01:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the configurable cascade-enforcement and switch-handling changes.

No open issues 🎉

Review effort: Balanced

@BillyONeal
Billy O'Neal (BillyONeal) merged commit 62cfa31 into microsoft:main Nov 4, 2026
7 checks passed
@BillyONeal
Billy O'Neal (BillyONeal) deleted the add-cascade-check-switch branch November 4, 2026 21:58
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.

3 participants