merge queue: checking main (cc0c6ba) and #1765 together - #1768
Closed
mergify[bot] wants to merge 2 commits into
Closed
merge queue: checking main (cc0c6ba) and #1765 together#1768mergify[bot] wants to merge 2 commits into
mergify[bot] wants to merge 2 commits into
Conversation
`colors_enabled()` opened with `if cfg!(test) { return false }`, whose
comment claims tests "never depend on the dev's TTY". It cannot do
that: `cfg!(test)` is false whenever mergify-tui is compiled as a
dependency, so the guard only ever covered mergify-tui's own tests.
Every *consumer* crate's tests fell through to the real policy and read
the developer's environment — `FORCE_COLOR=1 cargo test -p
mergify-events` fails on main today, on escape sequences injected into
asserted output.
Gate on the recorded `--color` choice instead. `set_color_choice()` is
called from exactly one place, `detect_dispatch()` in main, so an unset
choice means the process did not come through the CLI: a test harness,
a doctest, an embedder. Colors stay off there, in any environment,
across every crate.
`resolve_enabled()` takes the `Option<ColorChoice>` so the new case is
covered by the existing precedence unit test rather than by global
state.
Refs MRGFY-8533.
Change-Id: Id7eb12b906409122000a14722e5ce172ab93cb4c
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.
🎉 This pull request has been checked successfully and will be merged soon. 🎉
Branch main (cc0c6ba) and #1765 are queued together for merge.
This pull request has been created by Mergify to check the mergeability of #1765.
You don't need to do anything. Mergify will close this pull request automatically when it is complete.
Required conditions of queue rule
defaultfor merge:github-review-approved[🛡 GitHub branch protection]cfg!(test)#1765github-review-approved[🛡 GitHub repository ruleset ruleRequire pull request for default branch]cfg!(test)#1765Enforce conventional commit]:title ~= ^(fix|feat|internal|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?!?:cfg!(test)#1765👀 Review Requirements]:#approved-reviews-by>=2cfg!(test)#1765author = dependabot[bot]cfg!(test)#1765author = mergify-ci-botcfg!(test)#1765author = renovate[bot]cfg!(test)#1765📕 PR description]:body ~= (?ms:.{48,})cfg!(test)#1765🔎 Reviews]:#changes-requested-reviews-by = 0cfg!(test)#1765#review-requested = 0cfg!(test)#1765#review-threads-unresolved = 0cfg!(test)#1765🤖 Continuous Integration]:check-success=ci-gateRequired conditions to stay in the queue:
base=maincfg!(test)#1765github-review-approved[🛡 GitHub branch protection]cfg!(test)#1765github-review-approved[🛡 GitHub repository ruleset ruleRequire pull request for default branch]cfg!(test)#1765label!=manual mergecfg!(test)#1765Enforce conventional commit]:title ~= ^(fix|feat|internal|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?!?:cfg!(test)#1765👀 Review Requirements]:#approved-reviews-by>=2cfg!(test)#1765author = dependabot[bot]cfg!(test)#1765author = mergify-ci-botcfg!(test)#1765author = renovate[bot]cfg!(test)#1765📕 PR description]:body ~= (?ms:.{48,})cfg!(test)#1765🔎 Reviews]:#changes-requested-reviews-by = 0cfg!(test)#1765#review-requested = 0cfg!(test)#1765#review-threads-unresolved = 0cfg!(test)#1765🤖 Continuous Integration]:check-success=ci-gatecfg!(test)#1765