Skip to content

Accept --contract-id on all contract commands - #2730

Open
fnando wants to merge 1 commit into
mainfrom
contract-id-flag
Open

fnando wants to merge 1 commit into
mainfrom
contract-id-flag

Conversation

@fnando

@fnando fnando commented Sep 17, 2026

Copy link
Copy Markdown
Member

What

Makes --contract-id the canonical flag for referencing an existing contract across the contract subcommands (invoke, fetch, read, extend, restore, alias add), with --id kept as a visible alias. Previously these commands only accepted --id, while stellar contract info used --contract-id with --id as an alias — so the flag naming was inconsistent.

Why

The inconsistency is a trap for users and agents: a flag that works on contract info (--contract-id) was rejected by invoke/read/etc., and vice versa. Standardizing on --contract-id everywhere (matching contract info) while keeping --id as an alias makes the naming predictable and fully backwards compatible.

Copilot AI balanced review requested due to automatic review settings September 17, 2026 17:51
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Sep 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

All reviewed changes are covered and no blocking issues were identified.

Pull request overview

Standardizes --contract-id across contract commands while retaining --id as a visible alias.

Changes:

  • Updated CLI argument definitions and error text.
  • Regenerated help documentation.
  • Added integration coverage for flag consistency.
File summaries
File Description
FULL_HELP_DOCS.md Documents canonical flags and aliases.
cmd/soroban-cli/src/key.rs Updates shared contract ID argument.
cmd/soroban-cli/src/commands/contract/invoke.rs Adds the canonical flag and alias.
cmd/soroban-cli/src/commands/contract/fetch.rs Adds the canonical flag and updates error text.
cmd/soroban-cli/src/commands/contract/alias/add.rs Adds the canonical flag and alias.
cmd/crates/soroban-test/tests/it/main.rs Registers the integration test module.
cmd/crates/soroban-test/tests/it/contract_id_flag.rs Verifies flag consistency across commands.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@fnando fnando self-assigned this Sep 17, 2026
@fnando fnando moved this from Backlog (Not Ready) to Needs Review in DevX Sep 17, 2026
@fnando
fnando requested review from a team and leighmcculloch September 17, 2026 18:00

@leighmcculloch leighmcculloch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could also use just --contract, it's a little interesting we use the term 'id' at all given it's actually an address.

So we could normalize on --contract and alias --contract-id and --id to --contract.

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

Labels

None yet

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

3 participants