Conversation
…sNodeRuntimeRunInstallScripts, extractAmbientContextMetrics Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🎯 Excellent work on this test suite! This PR is perfectly aligned with the project's testing and coverage standards. What looks great
StatusThis PR is ready for review and merge. The test coverage improvements on pure functions strengthen the codebase's reliability and maintainability.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ Ponytail Reviewer completed successfully! Lean already. Ship. Diff is purely additive table-driven tests using stdlib testing/testify idiomatically; no over-engineering to cut.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
Comment MemoryNote This comment is managed by comment memory.It stores persistent context for this thread in the code block at the top of this comment.
|
There was a problem hiding this comment.
Verdict
No blocking issues in the changed lines.
The patch only adds table-driven tests, and the cases line up with the current behavior of the covered pure functions. I did not find a correctness, performance, or maintainability regression in these additions.
Files reviewed:
- pkg/cli/token_usage_parse_test.go
- pkg/parser/import_field_extractor_test.go
🔎 Code quality review by PR Code Quality Reviewer · gpt54 · 4.12 AIC · ⌖ 6.76 AIC · ⊞ 7K
Comment /review to run again
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd — approving; the test suites are thorough and well-structured.
📋 Key Themes & Highlights
Key Themes
- Full branch coverage: all three functions reach 87.5–100% coverage
- Consistent structure: every suite uses table-driven tests with
t.Parallel()at both suite and subtest level - Behavioural documentation: test names read as specifications (e.g.
"unparsable timestamp treated as no timestamp","entries with timestamps sort before entries without")
Positive Highlights
- ✅
validateGitHubAppJSON— the"client-id present but null value still counts as key"case explicitly documents the map-key-presence semantics of the implementation, a subtle but important correctness boundary - ✅
hasNodeRuntimeRunInstallScripts— covers every level of nested map traversal independently, making future regressions easy to localise - ✅
extractAmbientContextMetrics— stable-sort and timestamp-vs-no-timestamp tie-breaking cases are exactly the edge cases most likely to break under future refactors - ✅
t.Parallel()at both suite and subtest level — no unnecessary serial bottlenecks - ✅
(go/redacted):build !integrationtag on the new CLI test file keeps it in the unit-test bucket
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 21.8 AIC · ⌖ 9.72 AIC · ⊞ 7.7K
Comment /matt to run again
There was a problem hiding this comment.
Review: Pure-function test lock-down
This PR adds well-structured pure-function tests for validateGitHubAppJSON, hasNodeRuntimeRunInstallScripts, and extractAmbientContextMetrics. The test cases cover nil/empty inputs, boundary conditions, stable-sort semantics, and type-safety at each nesting level.
One minor design question (non-blocking): the test case "client-id present but null value still counts as key" asserts that {"client-id":null,"private-key":"key"} is accepted as valid. A null identity field passing validation is permissive — it is fine if intentional, but a short comment in the test or the production function explaining why key presence alone (regardless of value) is sufficient would help future readers understand the contract.
Otherwise, LGTM — parallel subtests, comprehensive edge cases, correct build tags, and no test pollution.
🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 20.8 AIC · ⌖ 9.03 AIC · ⊞ 6.2K
There was a problem hiding this comment.
Pull request overview
Adds table-driven tests for three pure Go helpers covering parsing, validation, and ambient-context ordering.
Changes:
- Tests GitHub App JSON and Node runtime extraction.
- Tests ambient-context metric selection and timestamp handling.
Show a summary per file
| File | Description |
|---|---|
pkg/parser/import_field_extractor_test.go |
Adds parser helper tests. |
pkg/cli/token_usage_parse_test.go |
Adds ambient-context extraction tests. |
Review details
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
| name: "client-id present but null value still counts as key", | ||
| appJSON: `{"client-id":null,"private-key":"key"}`, | ||
| want: `{"client-id":null,"private-key":"key"}`, |
Adds a draft Architecture Decision Record capturing the decision to use PureLock automation to systematically identify and lock down pure Go functions with low unit test coverage via table-driven test suites.
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (309 new lines in 📄 Draft ADR committed:
📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision. ❓ Why ADRs Matter
ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you. 📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in
|
|
Please refresh the branch with the latest base changes if GitHub offers it, address any remaining review feedback or check noise, and then run the Run: https://github.com/github/gh-aw/actions/runs/32645772987
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
…drift Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Refreshed and finished:
Pre-existing failure inherited from Note: CI on the agent's HEAD is stale — a maintainer needs to re-trigger it before merge. |
|
🎉 This pull request is included in a new release. Release: |
Locks down 3 pure Go functions with high-coverage testify suites, selected by the
purelock_precomputeranking (weakest coverage among analyzer-confirmed pure functions).validateGitHubAppJSONpkg/parser/import_field_extractor.go:1031func validateGitHubAppJSON(appJSON string) stringpkg/parser72.6% → 73.0%fuzz_friendly: true, but table-driven cases already cover every branch: empty/null input, malformed JSON, non-object JSON, missing/present client-id, app-id, private-key, and unicode values)hasNodeRuntimeRunInstallScriptspkg/parser/import_field_extractor.go:909func hasNodeRuntimeRunInstallScripts(fm map[string]any) boolpkg/parser72.6% → 73.0%extractAmbientContextMetricspkg/cli/token_usage_parse.go:323func extractAmbientContextMetrics(entries []TokenUsageEntry) *AmbientContextMetricspkg/cli63.607% → 63.625%Validation performed
gofmt -lclean on both test filesgo vet ./pkg/parser/ ./pkg/cli/passesgo test ./pkg/parser/ ./pkg/cli/ -race -count=1 -run '<new tests>'— all passgo tool cover -funcNote: the optional experimental coverage upload step could not run in this environment because the
$RUNNER_TEMP/gh-awmount is read-only here; coverage deltas above were computed directly fromgo tool cover -funcoutput instead.