Skip to content

errors.Join drops operator hints from the gates that need them most #242

Description

errors.Join in cockroachdb/errors does not carry the hints of the errors it joins, a single one included. Measured on the real path:

direct     hints=[do this]
join(1)    hints=[]
join(2)    hints=[]
hint(join) hints=[outer hint]

main.go renders operator guidance from errors.GetAllHints, so any hint attached below a join is dead. Two gates lose theirs.

runPostUpgradeVersionVerifyInner joins errors carrying postUpgradeVersionMismatchHint. That hint is the whole playbook for the A/B-rollback case: the two hypotheses, how to tell them apart, --post-upgrade-reconcile-window, --skip-post-upgrade-verify. None of it prints.

runPostApplyGates joins errors from verifyAppliedState, which are WithHint-bearing too.

Both suites stay green because they assert the hint on the unjoined helper. The fix is one line per site: errors.WithHint(joined, hint) after the join, with the assertion moved onto the joined error.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/applyIssues or PRs related to talm apply (preflight, COSI validation, ApplyConfiguration flow)area/commandsIssues or PRs related to pkg/commands (CLI subcommands, flag parsing, root detection)area/upgradeIssues or PRs related to talm upgrade flow (image extraction, post-upgrade verification)kind/bugCategorizes issue or PR as related to a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions