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

feat: add cloud workflow connectivity #332

Merged
merged 9 commits into from
May 14, 2024
Merged

feat: add cloud workflow connectivity #332

merged 9 commits into from
May 14, 2024

Conversation

morgante
Copy link
Contributor

@morgante morgante commented May 14, 2024

Add a local relay server for allowing workflows to report their activity back.

Summary by CodeRabbit

  • New Features

    • Introduced a new environment variable GRIT_LOCAL_SERVER for local server configuration.
    • Added a TestingMessenger struct for enhanced testing capabilities.
  • Improvements

    • Updated dependencies to support Grit cloud features for workflow results.
    • Enhanced environment variable handling in workflow execution.
  • Bug Fixes

    • Removed unnecessary logging of the app path to streamline output.
  • Enhancements

    • Added default serialization attributes to various fields in API-related structs.
    • Implemented a new constructor for improved struct initialization.
    • Updated VisibilityLevels enum to include a default trait for better usability.

@morgante morgante marked this pull request as ready for review May 14, 2024 09:47
@morgante morgante requested a review from a team as a code owner May 14, 2024 09:47
Copy link
Contributor

coderabbitai bot commented May 14, 2024

Walkthrough

Walkthrough

The recent updates introduce several significant changes across multiple crates. Key additions include a new environment variable for local server configuration, dependency adjustments related to the Grit cloud feature, and enhanced workflow handling. Logging was streamlined, and serialization attributes were refined. A new TestingMessenger struct was introduced for testing purposes, and the VisibilityLevels enum now includes a Default trait. These changes collectively enhance functionality, testing capabilities, and maintainability.

Changes

Files Change Summary
crates/auth/src/env.rs Added a new public static environment variable ENV_VAR_GRIT_LOCAL_SERVER.
crates/cli/Cargo.toml Adjusted dependencies related to the Grit cloud feature, involving workflow_server and remote_workflows.
crates/cli/src/updater.rs Removed logging of the app path in the get_app_bin_and_install method.
crates/cli/src/workflows.rs Various changes to workflow handling, including new environment variable settings and function signature updates.
crates/core/src/api.rs Added default serialization attributes, deprecated a field, and introduced a new constructor in DoneFile.
crates/grit-util/src/ranges.rs Added new fields with #[serde(skip_deserializing)] attribute to the Range struct.
crates/marzano_messenger/src/emit.rs Added Default trait to VisibilityLevels enum and adjusted comment formatting.
crates/marzano_messenger/src/lib.rs Added a new testing module to the public scope.
crates/marzano_messenger/src/testing.rs Introduced TestingMessenger struct for testing scenarios.

Recent Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between a39358e and 69b0b4d.
Files selected for processing (9)
  • crates/auth/src/env.rs (1 hunks)
  • crates/cli/Cargo.toml (3 hunks)
  • crates/cli/src/updater.rs (1 hunks)
  • crates/cli/src/workflows.rs (5 hunks)
  • crates/core/src/api.rs (4 hunks)
  • crates/grit-util/src/ranges.rs (1 hunks)
  • crates/marzano_messenger/src/emit.rs (1 hunks)
  • crates/marzano_messenger/src/lib.rs (1 hunks)
  • crates/marzano_messenger/src/testing.rs (1 hunks)
Files skipped from review due to trivial changes (3)
  • crates/cli/src/updater.rs
  • crates/marzano_messenger/src/emit.rs
  • crates/marzano_messenger/src/lib.rs
Additional Context Used
Learnings (1)
Common
User: morgante
URL: https://github.com/getgrit/gritql/pull/231

Timestamp: 2024-04-15T05:47:47.743Z
Learning: User morgante prefers not to be asked for documentation.
Additional comments not posted (10)
crates/marzano_messenger/src/testing.rs (1)

1-34: The TestingMessenger struct and its implementation look good. This will be useful for testing scenarios without sending messages to real backends.

crates/auth/src/env.rs (1)

5-5: The addition of the ENV_VAR_GRIT_LOCAL_SERVER environment variable looks good and follows the existing pattern.

crates/cli/Cargo.toml (1)

91-91: The updates to dependencies and features related to the Grit cloud feature look good and follow the existing structure.

Also applies to: 107-109, 146-147

crates/cli/src/workflows.rs (3)

67-74: The server setup block within the run_bin_workflow function is well-implemented. It correctly handles the server address and shutdown mechanism.


140-147: The updates to environment variable handling, including setting GRIT_MARZANO_PATH and ENV_VAR_GRIT_LOCAL_SERVER, are appropriate and follow the existing pattern.


56-56: The updated function signature for run_bin_workflow to include where M: Messager + Send + 'static is correct and ensures type safety.

crates/grit-util/src/ranges.rs (1)

10-13: The addition of start_byte and end_byte fields to the Range struct with #[serde(skip_deserializing)] attributes is appropriate and follows best practices.

crates/core/src/api.rs (3)

288-295: The addition of default serialization attributes for the messages, variables, ranges, and debug fields in the Match struct is appropriate and follows best practices.


Line range hint 337-364: The addition of default serialization attributes for the messages and variables fields in the EntireFile struct and the ansi_summary field in the Rewrite struct is appropriate and follows best practices.


557-570: The addition of the new constructor new for the DoneFile struct is appropriate and follows Rust conventions.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@morgante morgante merged commit 0c81511 into main May 14, 2024
7 checks passed
This was referenced May 14, 2024
@github-actions github-actions bot mentioned this pull request May 29, 2024
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.

2 participants