-
Notifications
You must be signed in to change notification settings - Fork 1
CLI coverage updates #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This workflow triggers when PRs are merged to main (Stainless SDK updates). It uses Cursor Agent to: - Compare SDK methods with existing CLI commands - Identify coverage gaps - Implement missing CLI commands in kernel/cli - Create a branch and PR with the changes Co-authored-by: mason <mason@onkernel.com>
|
Cursor Agent can help with this pull request. Just |
- Add step to extract SDK version (from git tag or commit SHA) - Pass SDK module path and version to Cursor Agent - Make SDK version update the primary task (step 1) - Always create PR even if only SDK version changes (no new commands) - Update PR templates to show SDK version changes Co-authored-by: mason <mason@onkernel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
- Use actions/checkout@v6 with fetch-tags: true (fix tag detection) - Use kernel.sh email domain - Use go-version: 'stable' instead of hardcoded version - Update wording: 'may contain new API methods' - Include new SDK method parameters in coverage gaps - Support new commands OR flags - Use evergreen branch (cli-coverage-update) instead of per-commit branches - Create/update evergreen PR instead of creating new PRs each time Co-authored-by: mason <mason@onkernel.com>
Co-authored-by: mason <mason@onkernel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| else | ||
| echo "version=${{ github.sha }}" >> $GITHUB_OUTPUT | ||
| echo "SDK version: ${{ github.sha }} (no tag)" | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SDK version incorrectly uses ancestor tag instead of current commit
High Severity
The git describe --tags --abbrev=0 command returns the most recent tag reachable from the current commit, not just tags on the current commit. When an untagged commit is pushed to main, this returns an ancestor tag (e.g., v1.0.0 from 10 commits ago). The CLI would then run go get module@v1.0.0, pulling the old tagged version instead of the newly pushed code. This defeats the workflow's purpose of keeping the CLI in sync with the latest SDK. Using git tag --points-at HEAD to check for an exact tag match would be correct.
|
|
||
| on: | ||
| push: | ||
| branches: [main] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing concurrency control causes race condition on parallel pushes
Medium Severity
The workflow lacks a concurrency block, so multiple pushes to main trigger parallel runs that all force-push to the same cli-coverage-update branch. If a newer SDK commit's workflow run completes before an older one, the older run will later overwrite the branch with the outdated SDK version. This causes the CLI to be updated to an older SDK version instead of the latest, directly contradicting the workflow's purpose of keeping the CLI in sync with the most recent SDK.
Add a workflow to
kernel-go-sdkto automatically updatekernel/cliwith new commands when the SDK is updated.This workflow was moved from the
kernel/kernel(API) repository tokernel/kernel-go-sdkbecause the Go SDK is the direct source of truth for CLI updates, ensuring the CLI is always in sync with the latest SDK methods as soon as they are merged intomain.Note
Adds
/.github/workflows/update-cli-coverage.ymlto keepkernel/clialigned with SDK changes.cursor-agentto detect SDK changes, implement missing CLI commands/flags, and verify buildkernel/kernel(API) andkernel/cli, readsstainless.yaml/openapi.yaml, and maps SDK methods to CLI commandskernel/cligo.modto the latest SDK version and runsgo get/go mod tidycli-coverage-updateand creates/updates a PR viaghwith appropriate title/bodyCLI_REPO_PATandCURSOR_API_KEY; sets git identity and runs on pushes tomainWritten by Cursor Bugbot for commit f1e6ffc. This will update automatically on new commits. Configure here.