Skip to content

feat(abc): src abc variables command#1293

Merged
bahrmichael merged 25 commits intomainfrom
mb/src-abc-command
Apr 16, 2026
Merged

feat(abc): src abc variables command#1293
bahrmichael merged 25 commits intomainfrom
mb/src-abc-command

Conversation

@bahrmichael
Copy link
Copy Markdown
Contributor

@bahrmichael bahrmichael commented Apr 15, 2026

This PR introduces a src abc variables command for setting and deleting variables on workflow instances using the update variables api from Sourcegraph.

Syntax:
src abc variables delete <workflow-instance-id> <variable-name>
src abc variables set <workflow-instance-id> <variable-name>=<variable-value>

With multiple arguments and --var:
src abc variables delete <workflow-instance-id> --var <variable-name-1> --var <variable-name-2>
src abc variables set <workflow-instance-id> --var <variable-name-1>=<variable-value-1> --var <variable-name-2>=<variable-value-2>

Examples:
src abc variables delete QWdlbnRpY1dvcmtmbG93SW5zdGFuY2U6MQ== approval
src abc variables set QWdlbnRpY1dvcmtmbG93SW5zdGFuY2U6MQ== prompt="Make some follow up changes"

The workflow instance id is an argument after the delete/set command, so that we can follow the existing subcommand patterns without having to introduce support for prefix args.

Comment thread cmd/src/abc.go Outdated
Comment thread cmd/src/abc_variables.go Outdated
Comment thread cmd/src/abc_variables.go Outdated
@bahrmichael bahrmichael changed the title src abc command feat(abc): src abc variables command Apr 15, 2026
@bahrmichael bahrmichael marked this pull request as ready for review April 15, 2026 13:32
@bahrmichael bahrmichael requested a review from a team April 15, 2026 13:32
Comment thread cmd/src/abc_variables_delete.go Outdated
Comment thread cmd/src/abc_variables_delete.go Outdated
Comment thread cmd/src/abc_variables_set.go Outdated
Comment thread cmd/src/abc_variables_set.go Outdated
Comment thread cmd/src/abc_variables_set.go Outdated
Comment thread cmd/src/abc_variables_set.go Outdated
Comment thread cmd/src/abc_variables_delete.go Outdated
@bahrmichael
Copy link
Copy Markdown
Contributor Author

bahrmichael commented Apr 16, 2026

List of notable changes since review:

  • Added help message on UsageError (I just got "exit code 2" if I forgot the instance id; we can isolate this to just the new commands, but I thought it's helpful to have this in general)
  • Implemented proper support for -get-cli (tested locally, If I understand correctly this flag is evaluated by the api client, and then we're supposed to just do a noop if ok=false)
  • Coalesced args and flag var args and simplified the methods
  • Added DisableSliceFlagSeparator so that lists won't be split into multiple args

@bahrmichael bahrmichael requested a review from burmudar April 16, 2026 13:08
@bahrmichael bahrmichael enabled auto-merge (squash) April 16, 2026 13:19
@bahrmichael bahrmichael merged commit 462bb96 into main Apr 16, 2026
9 checks passed
@bahrmichael bahrmichael deleted the mb/src-abc-command branch April 16, 2026 13:20
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