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

add watch option #11702

Merged
merged 34 commits into from
Feb 9, 2024
Merged

add watch option #11702

merged 34 commits into from
Feb 9, 2024

Conversation

gabcoyne
Copy link
Contributor

@gabcoyne gabcoyne commented Jan 22, 2024

Title: Add --watch Command to Monitor Flow Runs in CLI

Overview:

This pull request introduces the --watch command to the CLI, enhancing the user experience by allowing real-time monitoring of flow runs. This feature is particularly useful for users who need to track the progress of their flows and get immediate feedback upon completion.

Example:

With the --watch option, users can now initiate a flow run and actively monitor its progress. Upon completion, the command outputs the final state of the flow run to stderr, providing immediate visibility into the success or failure of the execution. Here's a simple example:

prefect deployment run --watch <slugified-flow-name>/<slugified-deployment-name>

This command will initiate the monitoring of the specified flow run and display updates until the run is completed.

Checklist:

  • [ N/A] References any related issue (N/A if not applicable).
  • Includes tests covering the new functionality.
  • Labeled appropriately, e.g., feature.
  • For new functions or classes: includes helpful docstrings.
  • [N/A ] For documentation changes: if applicable, includes redirect settings in netlify.toml.

Copy link

netlify bot commented Jan 22, 2024

Deploy Preview for prefect-docs-preview ready!

Name Link
🔨 Latest commit baf2332
🔍 Latest deploy log https://app.netlify.com/sites/prefect-docs-preview/deploys/65c66107a31cf40009b5ef6c
😎 Deploy Preview https://deploy-preview-11702--prefect-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@gabcoyne gabcoyne added the feature A new feature label Jan 23, 2024
@gabcoyne gabcoyne marked this pull request as ready for review January 23, 2024 15:32
@gabcoyne gabcoyne requested a review from a team as a code owner January 23, 2024 15:32
@abrookins
Copy link
Collaborator

Oooo, nice one

@abrookins
Copy link
Collaborator

abrookins commented Jan 23, 2024

We could expand this later to stream events and logs in real-time, I think:

class PrefectCloudEventSubscriber:

Copy link
Contributor

@serinamarie serinamarie left a comment

Choose a reason for hiding this comment

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

Cool! I left some initial comments. Around line 560 is where it would be good to exit_with_error early if a user provides a watch_interval but no --watch flag, etc. etc.

src/prefect/cli/deployment.py Outdated Show resolved Hide resolved
src/prefect/cli/deployment.py Outdated Show resolved Hide resolved
src/prefect/cli/deployment.py Outdated Show resolved Hide resolved
src/prefect/cli/deployment.py Outdated Show resolved Hide resolved
gabcoyne and others added 5 commits January 24, 2024 13:36
Co-authored-by: Serina Grill <42048900+serinamarie@users.noreply.github.com>
Co-authored-by: Serina Grill <42048900+serinamarie@users.noreply.github.com>
@serinamarie serinamarie self-assigned this Jan 24, 2024
src/prefect/cli/deployment.py Outdated Show resolved Hide resolved
src/prefect/cli/deployment.py Outdated Show resolved Hide resolved
src/prefect/cli/deployment.py Outdated Show resolved Hide resolved
Co-authored-by: Alexander Streed <desertaxle@users.noreply.github.com>
@zzstoatzz zzstoatzz merged commit 6544d0e into main Feb 9, 2024
43 of 44 checks passed
@zzstoatzz zzstoatzz deleted the feature/cli-wait branch February 9, 2024 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants