testkit: OUTPUT_PATTERN guard; prebuilt CLI for spec-kit CI#7
Conversation
- CliBridge.runGitCmd: detect missing output via OUTPUT_PATTERN instead of a fragile substring match on quoted field names. - spec-kit-conformance job: set GIT_TESTKIT_CLI to the binary built in the prior step so Python/Java steps avoid repeated go run recompiles. - Clarify testkit README Go regression path and ROADMAP CLI location wording. Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
You have used all Bugbot PR reviews included in your free trial for your GitHub account on this workspace. To continue using Bugbot reviews, enable Bugbot for your team in the Cursor dashboard. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
testkit/java/src/main/java/io/gitfire/testkit/CliBridge.java (1)
257-260: Good improvement to use regex-based validation.Using
OUTPUT_PATTERN.matcher(json).find()instead of a substring check is more robust and consistent with how other fields are validated.Optional: The pre-check on line 257 is redundant since
extractRequiredon line 260 already throws if the pattern doesn't match. Other methods likegetCurrentShaandgetBranchescallextractRequireddirectly without pre-checks. Consider removing lines 257-259 if maintaining consistency with those methods is preferred.,
♻️ Optional simplification
payload.append("]}"); String json = invoke(payload.toString()); - if (!OUTPUT_PATTERN.matcher(json).find()) { - throw new IllegalStateException("missing output in bridge response: " + json); - } return extractRequired(json, OUTPUT_PATTERN, "output"); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@testkit/java/src/main/java/io/gitfire/testkit/CliBridge.java` around lines 257 - 260, Remove the redundant pre-check that calls OUTPUT_PATTERN.matcher(json).find() before returning extractRequired(json, OUTPUT_PATTERN, "output"); instead rely on extractRequired to perform the match and throw if missing (consistent with getCurrentSha/getBranches). Update the method in CliBridge to delete the if-block referencing OUTPUT_PATTERN.matcher(json).find() and simply return extractRequired(json, OUTPUT_PATTERN, "output").
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@testkit/java/src/main/java/io/gitfire/testkit/CliBridge.java`:
- Around line 257-260: Remove the redundant pre-check that calls
OUTPUT_PATTERN.matcher(json).find() before returning extractRequired(json,
OUTPUT_PATTERN, "output"); instead rely on extractRequired to perform the match
and throw if missing (consistent with getCurrentSha/getBranches). Update the
method in CliBridge to delete the if-block referencing
OUTPUT_PATTERN.matcher(json).find() and simply return extractRequired(json,
OUTPUT_PATTERN, "output").
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9be183be-d7a4-494c-b057-01dc0aeecffa
📒 Files selected for processing (4)
.github/workflows/ci.ymltestkit/README.mdtestkit/ROADMAP.mdtestkit/java/src/main/java/io/gitfire/testkit/CliBridge.java
|
@cursoragent address feedback then kick off bugbot review |
|
Here is what was done and what is blocked on your side. Code review feedback (CodeRabbit)The redundant That change is committed and pushed on Bugbot reviewPosting a PR comment with
So this environment’s GitHub token cannot add comments, and I cannot trigger Bugbot from here by commenting What you should do: On PR #7, add a comment as yourself (or another user the integration allows), for example:
or
That is what Cursor’s docs describe for a manual Bugbot run. If you still see the trial limit message from Tests
|
extractRequired already fails with a clear message when output is missing; matches getCurrentSha/getBranches style (CodeRabbit review). Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>


Summary
runGitCmdusesextractRequired(json, OUTPUT_PATTERN, "output")only, consistent withgetCurrentSha/getBranches(no redundant pre-check; per CodeRabbit review).spec-kit-conformance): Aftergo build ./cmd/git-testkit-cli, Python and Maven steps setGIT_TESTKIT_CLI=./git-testkit-cliso wrappers invoke the prebuilt binary instead ofgo runon every subprocess.testkit/README.mddescribes the Go regression root as the directory containinggo.mod(avoids implying a fixed path like/workspace).testkit/ROADMAP.mdspells out that the CLI lives undercmd/git-testkit-cli, not a separatetestkit/clitree.Notes
On current
main,invoke()already usesOK_PATTERNfor theokfield; thewrapper-cross-platformjob already builds the CLI and setsGIT_TESTKIT_CLI. There is noGitTestKitCLIalias incli.pyanymore.Testing
go test -short ./...(Java/Maven not available in this environment).Summary by CodeRabbit
Documentation
Chores
Refactor