feat(jtk): add --name filter to fields list#195
Conversation
Closes #194 AI agents frequently pass `--project` to `jtk fields list` which doesn't exist, causing Cobra to error and the agent to give up on finding field IDs. Adding `--name` for case-insensitive substring filtering gives agents (and humans) a direct way to find fields without piping through grep.
TDD AssessmentPR: Add Coverage: SufficientThe logic is simple (client-side substring filter after fetching) and the test suite covers the meaningful cases well. What's covered:
Minor gaps (not blocking):
Verdict: Approve on coverage. The new logic is straightforward and the added tests are proportionate to the change. |
monit-reviewer
left a comment
There was a problem hiding this comment.
Automated PR Review
Reviewed commit: 3bb5c97
Approved with 1 non-blocking suggestion below. Address at your discretion.
Summary
| Reviewer | Findings |
|---|---|
| harness-engineering:architecture-reviewer | 1 |
harness-engineering:architecture-reviewer (1 findings)
💡 Suggestion - tools/jtk/internal/cmd/fields/fields_test.go:202
TestRunList_NameFilter_WithCustom doesn't verify that
GetCustomFields(vsGetFields) is actually called whencustomOnly=true. The mock server returns the same response regardless of which endpoint is hit, so a bug in the routing logic (lines 74-78 of fields.go) wouldn't be caught. Consider checkingr.URL.Pathin the mock handler to confirm the correct API endpoint is called. The routing logic is trivially correct today, so this is a test quality suggestion rather than a blocking issue.
Completed in 2m 22s | $0.56
| Field | Value |
|---|---|
| Reviewers | hybrid-synthesis, database:sql-reviewer, security:code-auditor, harness-engineering:knowledge-reviewer, harness-engineering:enforcement-reviewer, harness-engineering:architecture-reviewer, harness-engineering:legibility-reviewer |
| Reviewed by | pr-review-daemon · monit-pr-reviewer |
| Duration | 2m 22s (Reviewers: 22s · Synthesis: 47s) |
| Cost | $0.56 |
| Tokens | 143.6k in / 7.9k out |
| Turns | 9 |
| testutil.NotContains(t, stdout.String(), "Summary") | ||
| } | ||
|
|
||
| func TestRunList_NameFilter_WithCustom(t *testing.T) { |
There was a problem hiding this comment.
🔵 Low (harness-engineering:architecture-reviewer): TestRunList_NameFilter_WithCustom doesn't verify that GetCustomFields (vs GetFields) is actually called when customOnly=true. The mock server returns the same response regardless of which endpoint is hit, so a bug in the routing logic (lines 74-78 of fields.go) wouldn't be caught. Consider checking r.URL.Path in the mock handler to confirm the correct API endpoint is called. The routing logic is trivially correct today, so this is a test quality suggestion rather than a blocking issue.
Summary
--nameflag tojtk fields listfor case-insensitive substring filtering on field names--project(which doesn't exist), causing Cobra errors —--namegives a direct way to find fields likejtk fields list --name "story point"--customCloses #194
Test plan
--customrunListtest calls for new parametermake buildpassesmake testpassesintegration-tests.md