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

Control astro dev Output with --verbosity Flag #1770

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

schnie
Copy link
Member

@schnie schnie commented Dec 19, 2024

Description

This PR cleans up the output on the astro dev start/stop/kill/restart commands. Today these commands output a lot of information that is mostly meaningless or unhelpful, distracting from the experience. A new user whose just downloaded the CLI should be focused on getting something running in Airflow, not thinking about containers and docker, etc yet.

In this PR, we've suppressed the Image Build and Compose output for standard usage without any additional flags. This provides a nice, clean output with information about what's happening, but not every single detail. We're re-using the spinner we introduced recently for the runtime initialization messaging.

If users are interested in the full output, we've moved it behind the --verbosity (debug|trace) flag. For example, if you are troubleshooting something deep in the stack for some reason astro dev start --verbosity debug will show the output, just as it did before this change.

If the build phase encounters an error, which is probably a somewhat common occurrence in the wild, the stdout and stderr streams will be printed out, along with the error message.

🎟 Issue(s)

Related to https://github.com/astronomer/astro/issues/26133

🧪 Functional Testing

List the functional testing steps to confirm this feature or fix.

📸 Screenshots

Default experience

Screenshot 2024-12-20 at 2 11 46 PM

--verbosity debug|trace experience

Screenshot 2024-12-20 at 2 12 00 PM

Error on Build Default Experience

Screenshot 2024-12-20 at 2 22 59 PM

📋 Checklist

  • Rebased from the main (or release if patching) branch (before testing)
  • Ran make test before taking out of draft
  • Ran make lint before taking out of draft
  • Added/updated applicable tests
  • Tested against Astro-API (if necessary).
  • Tested against Houston-API and Astronomer (if necessary).
  • Communicated to/tagged owners of respective clients potentially impacted by these changes.
  • Updated any related documentation

@schnie schnie force-pushed the feature/minimize-default-dev-output branch 4 times, most recently from dd00790 to bd1590d Compare December 20, 2024 04:25
@schnie schnie force-pushed the feature/minimize-default-dev-output branch from bd1590d to 4896922 Compare December 20, 2024 16:11
@schnie schnie force-pushed the feature/minimize-default-dev-output branch from b295a68 to 6fa7960 Compare December 20, 2024 18:47
Comment on lines -197 to -212
// Get project containers
psInfo, err := d.composeService.Ps(context.Background(), d.projectName, api.PsOptions{
All: true,
})
if err != nil {
return errors.Wrap(err, composeCreateErrMsg)
}
if len(psInfo) > 0 {
// Ensure project is not already running
for i := range psInfo {
if checkServiceState(psInfo[i].State, dockerStateUp) {
return errors.New("cannot start, project already running")
}
}
}

Copy link
Member Author

Choose a reason for hiding this comment

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

It doesn't seem necessary to throw an error if the project is already started. Let's just make sure the image is updated and started, then re-print the status info.

@schnie schnie changed the title Hides most build and start output behind verbosity level Minimize astro dev Output with --verbosity Flag Dec 20, 2024
@schnie schnie changed the title Minimize astro dev Output with --verbosity Flag Control astro dev Output with --verbosity Flag Dec 20, 2024
@schnie schnie force-pushed the feature/minimize-default-dev-output branch from ca69f47 to 9e815ff Compare December 20, 2024 19:18
@schnie schnie force-pushed the feature/minimize-default-dev-output branch from 9e815ff to 0250f96 Compare December 20, 2024 19:43
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.

1 participant