fix: improve CLI coverage workflow reliability and accuracy#78
Merged
Conversation
Two fixes: 1. Replace racy two-step branch check (git ls-remote + git fetch) with a single git fetch that uses its exit code directly. 2. Add SDK diff computation step: before the agent runs, compute the diff between the CLI's current SDK version and the new one. This gives the agent a focused view of exactly what methods/params were added, so it doesn't miss new fields like DeploymentListParams.AppVersion. The full enumeration is preserved as a safety net. Co-authored-by: Cursor <cursoragent@cursor.com>
| 7d. If you added no new commands or flags (SDK version bump only), skip this step. | ||
|
|
||
| ## Step 7: Commit and Push | ||
| ## Step 8: Commit and Push |
There was a problem hiding this comment.
Stale step number reference in constraints section
Low Severity
The constraints section references "Steps 2-4" for the full enumeration, but the commit renumbered all steps by inserting a new Step 2 (Review SDK Diff). The full enumeration (SDK Method Enumeration, CLI Command Enumeration, and Gap Analysis) is now Steps 3–5. The stale reference "Steps 2-4" now points to the wrong set of steps and notably excludes Step 5 (Gap Analysis), which is the step that includes the new SDK diff cross-check — arguably the most important part of this PR's changes.
Additional Locations (1)
|
Bugbot Autofix prepared fixes for 1 of the 1 bugs found in the latest run.
Or push these changes by commenting: Preview (f66151b736)diff --git a/.github/workflows/update-cli-coverage.yml b/.github/workflows/update-cli-coverage.yml
--- a/.github/workflows/update-cli-coverage.yml
+++ b/.github/workflows/update-cli-coverage.yml
@@ -361,7 +361,7 @@
# Constraints
- ALWAYS update the SDK version in go.mod - this is the primary purpose
- - ALWAYS perform the full enumeration (Steps 2-4) - this is critical for finding gaps
+ - ALWAYS perform the full enumeration (Steps 3-5) - this is critical for finding gaps
- ALL SDK methods in api.md MUST have corresponding CLI commands, EXCEPT those marked with x-cli-skip in openapi.yaml
- SKIP endpoints marked with x-cli-skip: true in openapi.yaml - these are internal endpoints (e.g., hosted UI auth flows) not suitable for CLI
- Streaming methods may have different CLI implementations (e.g., follow flags) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
git ls-remote+git fetchwith a singlegit fetchwhose exit code determines branch existence. The old approach was racy — the branch could be deleted between the two calls (e.g. right after a PR merge).git diff <old_version>..<new_version>onapi.mdand Go source files. This gives the agent a focused view of exactly what methods and param fields were added/changed between SDK versions. The agent is instructed to treat each addition as a checklist item. The full enumeration is preserved as a safety net — the diff is an additional input, not a replacement.This should fix issues like PR kernel/cli#118 where the agent missed the new
AppVersionfield onDeploymentListParams.Changes
go.modand diffs against the new version/tmp/sdk-diff.patchbefore doing the full enumerationTest plan
cli-coverage-updatebranch doesn't existcli-coverage-updatebranch existsAppVersion)Made with Cursor
Note
Low Risk
CI/workflow-only changes; main risk is the new
git diffstep failing when the CLI’s pinned version isn’t a valid tag/commit, though it falls back to an empty diff.Overview
Improves the
update-cli-coverageGitHub Actions workflow by computing an SDK diff between the CLI’s currently-pinned SDK version (fromkernel/cligo.mod) and the new SDK version, saving it to/tmp/sdk-diff.patchfor the agent to review.Updates the cursor-agent instructions to require reviewing this diff before the full SDK/CLI enumeration and to cross-check gap analysis against it, reducing missed new methods/flags. Also simplifies the
cli-coverage-updatebranch checkout logic to rely ongit fetchfor existence checks, avoiding a race where the branch could disappear between remote checks.Written by Cursor Bugbot for commit 4dac142. This will update automatically on new commits. Configure here.