Skip to content

refactor(cli): merge argument parsing and command execution#1568

Merged
SuperFluffy merged 6 commits intomainfrom
ENG-834/merge-cli-and-command-structs
Oct 2, 2024
Merged

refactor(cli): merge argument parsing and command execution#1568
SuperFluffy merged 6 commits intomainfrom
ENG-834/merge-cli-and-command-structs

Conversation

@SuperFluffy
Copy link
Copy Markdown
Contributor

@SuperFluffy SuperFluffy commented Sep 26, 2024

Summary

Refactors the CLI to give it a cleaner structure.

Background

The CLI was split into a cli module that was concerned with parsing arguments, and a commands which consumed the argument data structures.

The patch clears this up by implementing inherent <Args>::run methods on all leaf argument types, so that the implementation follows the same structure for all its effects.

Note that this match does restructure the public facing command line (except for a few lines of documentation). It merely restructures the implementation.

Changes

  • Refactors each type deriving clap::Args to have an inherent method run.
  • Flattens the crate structure to not be unnecessarily nested.

Testing

These will be tested in follow PRs. Smoke tests using a subset of the astria CLI commands should still work.

Related Issues

Closes #1546

@SuperFluffy SuperFluffy force-pushed the ENG-834/merge-cli-and-command-structs branch from f90d3e3 to b640028 Compare September 26, 2024 12:38
@SuperFluffy SuperFluffy marked this pull request as ready for review September 26, 2024 12:53
@SuperFluffy SuperFluffy requested a review from a team as a code owner September 26, 2024 12:53
@SuperFluffy SuperFluffy requested a review from noot September 26, 2024 12:53
@SuperFluffy SuperFluffy force-pushed the ENG-834/merge-cli-and-command-structs branch from ec8acf2 to 5dfa949 Compare September 30, 2024 12:47
Copy link
Copy Markdown
Contributor

@sambukowski sambukowski left a comment

Choose a reason for hiding this comment

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

LGTM! Only thing is the nit of the extra chain id.

@SuperFluffy SuperFluffy force-pushed the ENG-834/merge-cli-and-command-structs branch from 4f7b74d to 174b5fc Compare October 2, 2024 15:04
@SuperFluffy SuperFluffy enabled auto-merge October 2, 2024 15:21
@SuperFluffy SuperFluffy added this pull request to the merge queue Oct 2, 2024
Merged via the queue into main with commit 29a5d19 Oct 2, 2024
@SuperFluffy SuperFluffy deleted the ENG-834/merge-cli-and-command-structs branch October 2, 2024 15:31
steezeburger added a commit that referenced this pull request Oct 7, 2024
* main: (34 commits)
  feat(proto): add bundle and optimistic block apis (#1519)
  feat(sequencer)!: make empty transactions invalid  (#1609)
  chore(sequencer): simplify boolean expressions in `transaction container` (#1595)
  refactor(cli): merge argument parsing and command execution (#1568)
  feat(charts): astrotrek chart (#1513)
  chore(charts): genesis template to support latest changes (#1594)
  fix(ci): code freeze action fix (#1610)
  chore(sequencer)!: exclusively use Borsh encoding for stored data (ENG-768) (#1492)
  ci: code freeze through github actions (#1588)
  refactor(sequencer): use builder pattern for transaction container tests (#1592)
  feat(conductor)!: implement chain ID checks (#1482)
  chore(ci): upgrade audit-check (#1577)
  feat(sequencer)!: transaction categories on UnsignedTransaction (#1512)
  fix(charts): sequencer prometheus rules   (#1598)
  chore(all): Migrate all instances of `#[allow]` to `#[expect]` (#1561)
  chore(charts,sequencer-faucet): asset precision (#1517)
  chore(docs): endpoints (#1543)
  fix(docker): use target binary build param as name of image entrypoint (#1573)
  fix(ci): ibc bridge test timeout (#1587)
  Feature: Add `graph-node` to charts. (#1489)
  ...
github-merge-queue bot pushed a commit that referenced this pull request Oct 23, 2024
## Summary
Removes unused code from astria cli.

## Background
This code was no longer included in the module tree. It should have been
removed in #1568 but forgotten.

## Changes
- Remove unused code.
sgranfield4403-3 added a commit to sgranfield4403-3/astria that referenced this pull request Oct 2, 2025
## Summary
Removes unused code from astria cli.

## Background
This code was no longer included in the module tree. It should have been
removed in astriaorg/astria#1568 but forgotten.

## Changes
- Remove unused code.
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.

Don't distinguish between command types and their handlers

3 participants