-
Notifications
You must be signed in to change notification settings - Fork 258
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
feat(cargo-shuttle): raw table output, fix table column alignment #1319
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good at a glance. Will try it out later. Anything else to add?
Just wanted to look though and make sure I didn't miss anything, I'm happy with it yeah. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks!
I see that the raw project list will use colors, but not the deployment list. I think colorless is preferred for raw table. Is this a quick fix or is it complicated due to #962 ? |
The project list only applies colours when |
I've rebased my new changes on master so it can be more easily merged. The changes should now close #1315 and also close #962. Thanks for noticing the coloured output @jonaro00 Edit: I see the failing tests, I'm going through them now Edit 2: Took a few tries, but looks like it went better this time :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! 🥳
I simplified some unnecessary complexity. I'll let @oddgrd check one final time.
This looks great, but we are now missing the color on the project state in commands like |
I'm going through the commands to check, but the output from I think I've managed to restore colour to the rest of the commands, so I'll add that to my commit and rebase on main again in a bit. Thanks again for the spot! @jonaro00 I also noticed while going through the commands that |
Flag (`--raw`) added to `deployment list`, `project list`, `resource list` and `secrets` commands Renamed `get_table`s to `get_projects_table`/`get_secrets_table` for consistency Project state returns `&str` like Deployment state All output responds to `--raw` flag Project state `impl Display` does not style output, styling done in calling code Simplify output message formatting
I decided to implement the This did include fixing a couple merge issues from the new project delete command, but I think it looks right now. And the |
Excellent work, thank you! ❤️ By the way, in the future, it's preferable if you don't squash your commits after the review process has started, since it makes it harder for us to distinguish the changes you made to address reviews. We will squash them when we merge the PR. |
Description of change
--raw
parameter for commands that print tables #1315 by adding--raw
flag todeployment list
andproject list
commands, as well asresource list
andsecrets
impl Display
forProject::State
get_table
in two locations renamed toget_projects_table
/get_secrets_table
to match naming ofget_deployments_table
raw
table format ignores terminal width and has no borders&str
like Deployment state,impl Display
for state has no styling, styling done at call site when appropriate--raw
flag do not output styled messages when flag is usedHow has this been tested? (if applicable)
The following commands were run, inspecting the output manually: (nano is a project I have running)
cargo run --bin cargo-shuttle -- --api-url https://api.shuttle.rs deployment list --name nano
cargo run --bin cargo-shuttle -- --api-url https://api.shuttle.rs deployment list --name nano --raw
cargo run --bin cargo-shuttle -- --api-url https://api.shuttle.rs project list
cargo run --bin cargo-shuttle -- --api-url https://api.shuttle.rs project list --raw
cargo run --bin cargo-shuttle -- --api-url https://api.shuttle.rs resource list --name nano
cargo run --bin cargo-shuttle -- --api-url https://api.shuttle.rs resource list --name nano --raw
cargo run --bin cargo-shuttle -- --api-url https://api.shuttle.rs secrets --name nano
cargo run --bin cargo-shuttle -- --api-url https://api.shuttle.rs secrets --name nano --raw