Skip to content

state: join the messages of additional errors in a condition - #1546

Merged
justinsb merged 2 commits into
gke-labs:mainfrom
codebot-robot:issue_1544
Nov 22, 2026
Merged

justinsb merged 2 commits into
gke-labs:mainfrom
codebot-robot:issue_1544

Conversation

@codebot-robot

@codebot-robot codebot-robot commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1544

When more than one error has the condition's type, the reason comes from
the first, and the message joins the messages of all of them in list order,
separated by "; ". Duplicate messages are omitted, and at most five
messages are joined. When more than five messages are present, the condition
message ends with how many are left out (e.g. "; and 3 more").

Document in buildCondition that list order decides which error is first so
callers append in a fixed order.

Fixes gke-labs#1544

@justinsb justinsb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The change in buildCondition does what the issue asks. The test is 143 lines for it and calls the unexported function directly.

  1. Shrink TestBuildCondition. Make it one table with a row for each rule: one error, two errors of one type, a repeated message, more than five messages, and an error of another type. Each row has the errors, the expected reason and the expected message. That is about 40 lines.
  2. Show the joined message through a route's computed status. The issue asks for a route with two failures of one type in two rules that reports the first reason and both messages in order. If the changed line in httproute_test.go is that test, say so in its comment; otherwise add it.
  3. err == nil in the loop. No caller appends a nil error. Remove the check.

@codebot-robot codebot-robot removed their assignment Nov 22, 2026
@justinsb justinsb self-assigned this Nov 22, 2026
@justinsb
justinsb merged commit 599d949 into gke-labs:main Nov 22, 2026
14 checks passed
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.

state: join the messages of additional errors in a condition

2 participants