eval status: enrich with related evals and placed allocs tables (#26156)

When debugging an evaluation, you almost always want to know about all the
related evaluations and what allocations were placed by that evaluation (and
where), not just failed placements. We can enrich the command by adding the
`related` query parameter to the API, and having the command query for the
evaluations allocations automatically. Emit this data as a pair of new tables
and expose fields like quota limits, and previous/next/blocked eval without the
`-verbose` flag.

Update the docs to include the full output and remove references to long-removed
behavior of the `-json` flag.

Ref: https://hashicorp.atlassian.net/browse/NMD-818
Ref: https://go.hashi.co/rfc/nmd-212
This commit is contained in:
Tim Gross
2025-06-30 09:23:36 -04:00
committed by GitHub
parent 0c2fcb3e30
commit aa3c08d069
6 changed files with 232 additions and 50 deletions

View File

@@ -161,7 +161,7 @@ func TestSetQueryOptions(t *testing.T) {
c, s := makeClient(t, nil, nil)
defer s.Stop()
r, _ := c.newRequest("GET", "/v1/jobs")
r, _ := c.newRequest("GET", "/v1/jobs?format=baz")
q := &QueryOptions{
Region: "foo",
Namespace: "bar",
@@ -188,6 +188,7 @@ func TestSetQueryOptions(t *testing.T) {
try("index", "1000")
try("wait", "100000ms")
try("reverse", "true")
try("format", "baz")
}
func TestQueryOptionsContext(t *testing.T) {

View File

@@ -46,7 +46,7 @@ func (e *Evaluations) Count(q *QueryOptions) (*EvalCountResponse, *QueryMeta, er
// Info is used to query a single evaluation by its ID.
func (e *Evaluations) Info(evalID string, q *QueryOptions) (*Evaluation, *QueryMeta, error) {
var resp Evaluation
qm, err := e.client.query("/v1/evaluation/"+evalID, &resp, q)
qm, err := e.client.query("/v1/evaluation/"+evalID+"?related=true", &resp, q)
if err != nil {
return nil, nil, err
}