Validate Trail Finding API and CLI · Entire

Validate that e.g. this trail https://entire.io/gh/entirehq/entire.io/trails/1402/ returns all findings on the API/CLI via "entire trail finding" properly. I can see 23 in the UI.

Validated. The API does return 23 findings for trail #1402, but the CLI was dropping them because it omitted stale=any from the request. The API defaults omitted stale to current, and all 23 findings on that trail are currently stale.

Fixed in:

Validation with rebuilt CLI:

entire trail finding 1402 --status any --stale any --include-dismissed --limit 1000 --json

Result:

findings: 23
Open: 23
High: 4
Medium: 14
Low: 5
Stale: 23
has_more: false

Also ran:

go test ./cmd/entire/cli -run TrailReview

Passing.

Create a fix for the CLI.

Implemented the CLI fix.

Changed:

Validated:

1
2

mise exec -- gofmt -w cmd/entire/cli/trail_review_cmd.go cmd/entire/cli/trail_review_cmd_test.go
mise exec -- go test ./cmd/entire/cli -run TrailReview

Result: passing.

The rebuilt CLI now returns all 23 findings for trail 1402 with:

1

entire trail finding 1402 --status any --stale any --include-dismissed --limit 1000

How did you get the findings from the API?

I used a small temporary Go helper that imports the local CLI’s auth/client code, so it reuses your existing Entire login token:

client, err := cli.NewAuthenticatedAPIClient(ctx, false)
resp, err := client.Get(ctx,
  "/api/v1/trails/019ed660-9d8d-77c9-a30c-fdec69a64209/reviews/comments?stale=any&include_dismissed=true&limit=1000",
)

That calls the same data API origin/auth flow as the CLI, but lets us hit the exact endpoint directly.

Key endpoint:

GET /api/v1/trails/{trail_id}/reviews/comments?stale=any&include_dismissed=true&limit=1000

For trail 1402, I first resolved the UI trail number to its API trail id via:

entire trail show 1402

which showed:

ID: 019ed660-9d8d-77c9-a30c-fdec69a64209

Then the direct API call returned 23 comments. The important detail was that stale=any must be sent explicitly. Without it, the API defaulted to current-only findings, returning 0.

Create a trail

Created the trail: https://entire.io/gh/entireio/cli/trails/610/

Branch pushed:

dip/fix-trail-finding-stale-any

Also committed the fix:

bb784c631 Fix trail finding stale-any API filter

Validation before push:

mise run lint

passed.