Skip to content
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

[CLI] Bootstrapping restatectl admin command line #1625

Merged
merged 1 commit into from
Jun 14, 2024
Merged

Conversation

AhmedSoliman
Copy link
Contributor

@AhmedSoliman AhmedSoliman commented Jun 13, 2024

[CLI] Bootstrapping restatectl admin command line

Note: This PR contains mechanical changes, but to help reviewers, here are the most important changes:

  • Introduces new stubbed restatectl CLI that will be host debugging commands. The tool is meant to be used by operators with direct access to Restate clusters.
  • Introduce restate-cli-util hosting shared utilities and a decent portion of UI rendering tools from restate cli. This is to allow sharing the logic across CLIs.
  • Introduce CliContext. A global that gets configured by CommonOpts clap structure. This makes it easy to change output styling, logging, datetime formats across CLI utilities without threading through an environment object.
  • CliContext in conjunction with CommonOpts allow for sharing common top-level command line options between our CLIs (e.g. --yes, --table-style, etc.)

@AhmedSoliman AhmedSoliman marked this pull request as ready for review June 13, 2024 15:29
@AhmedSoliman
Copy link
Contributor Author

Looping in @jackkleeman for cloud commands

Copy link

github-actions bot commented Jun 13, 2024

Test Results

102 files  ±0  102 suites  ±0   20m 3s ⏱️ +3s
 84 tests ±0   84 ✅ ±0  0 💤 ±0  0 ❌ ±0 
215 runs  ±0  215 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit ca52ee9. ± Comparison against base commit 39f3475.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@jackkleeman jackkleeman left a comment

Choose a reason for hiding this comment

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

cloud changes lgtm 🚀

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

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

LGTM. +1 for merging :-) restatectl will certainly become very handy in the future.

Comment on lines +127 to +128
/// Sets the global context to the given value. In general, this should be called once on CLI
/// initialization.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be enforced by not using an ArcSwap in the GLOBAL_CLI_CONTEXT and instead directly storing the CliContext? Or do we need the ArcSwap for testing scenarios where one wants to update the CliContext?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's the intention, although we don't actually have tests that exercise that now.

tools/restatectl/src/build_info.rs Outdated Show resolved Hide resolved
Note: This PR contains mechanical changes, but to help reviewers, here are the most important changes:
- Introduces new stubbed `restatectl` CLI that will be host debugging commands. The tool is meant to be used by operators with direct access to Restate clusters.
- Introduce `restate-cli-util` hosting shared utilities and a decent portion of UI rendering tools from `restate` cli. This is to allow sharing the logic across CLIs.
- Introduce `CliContext`. A global that gets configured by `CommonOpts` clap structure. This makes it easy to change output styling, logging, datetime formats across CLI utilities without threading through an environment object.
- `CliContext` in conjunction with `CommonOpts` allow for sharing common top-level command line options between our CLIs (e.g. `--yes`, `--table-style`, etc.)
@AhmedSoliman AhmedSoliman merged commit 3271b79 into main Jun 14, 2024
10 checks passed
@AhmedSoliman AhmedSoliman deleted the pr1625 branch June 14, 2024 15: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.

3 participants