Skip to content

Fix show_envvar output for a sequence or an empty envvar - #3884

Merged
Rowlando13 merged 1 commit into
pallets:stablefrom
kdeldycke:envvar-sequence-error-hint
Oct 6, 2026
Merged

Rowlando13 merged 1 commit into
pallets:stablefrom
kdeldycke:envvar-sequence-error-hint

Conversation

@kdeldycke

@kdeldycke kdeldycke commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

This PR fixes some awkward rendering in the Error: Invalid value for '--units' (env var: xxxxx) error message's hint for special cases of environment variables:

Parameter value Hint before Hint after
envvar=None Nothing Nothing
envvar="" (env var: '') Nothing
envvar=[] (env var: '[]') Nothing
envvar=["WEATHER_UNITS", "UNITS"] (env var: '['WEATHER_UNITS', 'UNITS']') (env var: 'WEATHER_UNITS', 'UNITS')

Also fixes the rendering of help screen:

Parameter value Help screen before Help screen after
envvar=None Nothing Nothing
envvar="" [env var: ] Nothing
envvar=[] [env var: ] Nothing

@kdeldycke kdeldycke added the help output Help text formatting, layout, and --help rendering label Oct 6, 2026
@kdeldycke kdeldycke added this to the 8.5.1 milestone Oct 6, 2026
@kdeldycke
kdeldycke force-pushed the envvar-sequence-error-hint branch from 2e07b32 to b285c68 Compare October 6, 2026 13:50
@kdeldycke
kdeldycke force-pushed the envvar-sequence-error-hint branch from b285c68 to c53d373 Compare October 6, 2026 13:54
@Rowlando13
Rowlando13 merged commit 8c73ff1 into pallets:stable Oct 6, 2026
12 checks passed
@kdeldycke
kdeldycke deleted the envvar-sequence-error-hint branch October 7, 2026 03:34
DuhItzAniket added a commit to DuhItzAniket/Repro that referenced this pull request Oct 20, 2026
A call whose arguments could not be encoded (a framework's context
object) had no key and was never compared. It is now keyed by its
position, the n-th such call of the function in the test's phase, when
A, A2 and H made as many of them; the tracer previews it as #n.

On pallets/click#3884, 151 calls of 2 of its 4 changed functions went
from not comparable to compared, and the card from UNVERIFIABLE to
VERIFIED (deterministic).

Work in progress: test_run_stage's perf-regress fixture fails on its
missing items, not yet diagnosed (timing or this change).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DuhItzAniket added a commit to DuhItzAniket/Repro that referenced this pull request Oct 20, 2026
…on (#97)

Fixes the second gap the real-world demo found: Repro never compared
calls whose *arguments* it could not encode, such as a framework's
context object. So a change to such functions came out UNVERIFIABLE.

## What happened
pallets/click#3884 (merged) changes `Option.get_error_hint(ctx)` and
`Option.get_help_extra(ctx)`. click's `Context` is past the encoder's
limits (depth 6, 5,000 values, 50 ms, no cycles), so those calls had no
key. In 16 and 58 tests they were not compared at all. The card was
UNVERIFIABLE: "2 of 4 changed symbols unverified".

## The fix
- **Positional keys.** A call whose arguments could not be encoded is
keyed by its *position*, the n-th such call of the function in the
test's phase. The key is `(test, phase, symbol, "", n)`; a real digest
is never empty.
- **Only when it's sound.** Calls are paired this way only when base,
base again and head made as many of them (`observations.align`).
Otherwise they stay unkeyed and are reported as `encoding_failed`, as
before.
- **Noise is still caught.** A against A2 still says whether a
positional result is noise; a test covers it.
- **Previews and the reproducer.**
- The tracer previews such a call when asked for `#n`, so its evidence
shows real values.
  - The reproducer finds it again by position.
- Without a preview, the summary says plainly that the call was matched
by position.
- The positional observations round-trip through the CBOR artifacts. The
empty digest is stored as "no digest".

## Evidence
- **click#3884, deterministic, before and after:**
- calls compared went from 244 to **395**, all the same, none not
comparable;
  - the 12 new tests pass;
  - the card went from UNVERIFIABLE to **VERIFIED**.
- **The perf-regress fixture changed exactly as expected.** Its
expectation had recorded the old behaviour: unique_tags()'s 50,000-tag
calls were not compared. Now its 20 calls per run are compared by
position and match. The golden card loses its `encoding_failed` item and
its "1 of 1 changed symbols unverified" coverage rule, and stays FLAGGED
(perf_budget). The other 16 fixtures and their goldens are unchanged.
- **New tests:**
  - positional pairing finds a real difference;
  - no pairing when the counts differ;
  - a positional result that differs on base is masked as noise;
  - the CBOR round-trip;
- the tracer previews the second of two cyclic-argument calls as `#1`
and only that one, on the real tracer;
  - the summary and preview request for a positional difference.

`docs/paper/LOG.md` records the measurements, and ARCHITECTURE §4.3 the
rule.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

help output Help text formatting, layout, and --help rendering

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants