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: baml-cli support for Boundary Cloud #1046

Open
wants to merge 12 commits into
base: canary
Choose a base branch
from
Open

Conversation

sxlijin
Copy link
Collaborator

@sxlijin sxlijin commented Oct 15, 2024

Important

Add BAML CLI support for deploying projects to Boundary Cloud with authentication and deployment functionalities.

  • Behavior:
    • Adds support for deploying BAML projects to Boundary Cloud via baml-cli.
    • Implements get_or_create_project and deploy_new_project in deploy.rs.
    • Adds OAuth2 authentication flow in propelauth.rs.
  • CLI:
    • New commands auth, login, and deploy added to commands.rs.
    • run_cli function in lib.rs initializes and runs the CLI.
  • Documentation:
    • Updates docs.yml to include Boundary Cloud documentation.
    • Adds host-your-baml-functions.mdx for hosting BAML functions on Boundary Cloud.
  • Misc:
    • Adds api_client.rs for API interactions.
    • Introduces FutureWithProgress trait in tui.rs for progress indication.
    • Updates Cargo.toml files to include new dependencies and features.

This description was created by Ellipsis for 220a830. It will automatically update as commits are pushed.

Copy link

vercel bot commented Oct 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
baml ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2024 4:49am

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to b6f6437 in 1 minute and 4 seconds

More details
  • Looked at 3637 lines of code in 46 files
  • Skipped 4 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. engine/cli/src/propelauth.rs:132
  • Draft comment:
    Log the error when open::that fails to provide more context for debugging.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The request_authorization_code function in propelauth.rs does not handle the case where the open::that function fails. It should log the error for better debugging.
2. engine/cli/src/deploy.rs:283
  • Draft comment:
    Consider reusing a single reqwest::Client instance for multiple requests instead of creating a new one each time. This can improve performance by reusing connections.
  • Reason this comment was not posted:
    Marked as duplicate.
3. engine/cli/src/auth.rs:68
  • Draft comment:
    Handle the error case for PersistedTokenData::read_from_storage() to provide a user-friendly message or guidance on resolving the issue.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment is suggesting a code improvement that is actionable and clear. It is not asking for confirmation or making speculative statements. The suggestion is directly related to the code change in the diff.
    The comment could be seen as unnecessary if the existing error handling is deemed sufficient by the project's standards. However, providing user-friendly error messages is generally a good practice.
    Even if the current error handling is technically sufficient, enhancing user experience with clearer error messages is beneficial and aligns with good coding practices.
    The comment is valid as it suggests an actionable improvement to the code by enhancing error handling for better user experience.

Workflow ID: wflow_3aErTaG8P0HfxHvn


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

&self,
req: GetOrCreateProjectRequest,
) -> Result<GetOrCreateProjectResponse> {
let resp = reqwest::Client::new()
Copy link

Choose a reason for hiding this comment

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

Consider reusing a single reqwest::Client instance for multiple requests instead of creating a new one each time. This can improve performance by reusing connections.

Copy link
Contributor

Choose a reason for hiding this comment

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

don't we have a static builder? We should use that one i think cause it has some settings that make it configure correctly.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Incremental review on 60a2e39 in 35 seconds

More details
  • Looked at 65 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_zJnCSVGlgzO3c5xZ


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

println!(" https://dashboard.boundaryml.com/projects/{project_id}/api-keys");
println!();
println!("3. Call your functions!");
println!(" https://dashboard.boundaryml.com/projects/{project_id}/api-keys");
Copy link

Choose a reason for hiding this comment

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

The URL for calling functions is repeated. Consider removing the duplicate line to avoid confusion.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 985cd64 in 25 seconds

More details
  • Looked at 31 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. docs/docs.yml:54
  • Draft comment:
    Inconsistent indentation. Ensure consistent indentation for proper YAML parsing.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_WEUpt7OIlvb4KEx4


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on b9afff5 in 35 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 1 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. docs/docs.yml:58
  • Draft comment:
    The change from section: NextJS to page: Nextjs is incorrect. It should remain as section to maintain consistency with the rest of the structure.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment suggests that the change from 'section' to 'page' is incorrect. However, the context shows that 'page' is used frequently in similar contexts, indicating that the change might be intentional and consistent with other parts of the file. Without strong evidence that 'section' is the correct term here, the comment seems speculative.
    I might be missing specific knowledge about the structure of this YAML file and whether 'section' or 'page' is the correct term in this context. The comment could be correct if there's a specific convention being violated.
    The frequent use of 'page' in similar contexts suggests that the change might be intentional and correct. Without clear evidence that 'section' is required here, the comment seems speculative.
    Delete the comment as it seems speculative and lacks strong evidence that the change is incorrect.

Workflow ID: wflow_a8YfOtB7fNioN7R4


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 5193c52 in 42 seconds

More details
  • Looked at 211 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. engine/cli/src/deploy.rs:160
  • Draft comment:
    The get_or_create_project function does not handle the case where there are multiple projects. This will cause the function to fail if there are multiple projects, which is not the intended behavior according to the comments. Consider implementing an interactive prompt to allow the user to select a project.
  • Reason this comment was not posted:
    Comment was on unchanged code.
2. engine/cli/src/deploy.rs:227
  • Draft comment:
    The get_or_create_project function does not handle the case where there are multiple projects. This will cause the function to fail if there are multiple projects, which is not the intended behavior according to the comments. Consider implementing an interactive prompt to allow the user to select a project.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_MwSn06R2Rb3cmd3R


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on dbe6a23 in 25 seconds

More details
  • Looked at 22 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. engine/cli/src/deploy.rs:289
  • Draft comment:
    The use of shift_remove to remove "generators.baml" from baml_src is not explained. If the intention is to remove this specific file, ensure that it is present in the IndexMap before calling shift_remove. If not, this could lead to unexpected behavior.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_grq20tmiO3rp8VL2


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Incremental review on 40ccf24 in 56 seconds

More details
  • Looked at 119 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_XGdM7klFisTXHkrt


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

return Err(resp
.error_for_status()
.context("Failed to get or create project")
.unwrap_err());
Copy link

Choose a reason for hiding this comment

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

Using unwrap_err() here is unnecessary. You can directly use context to provide the error context without unwrapping the error.

Suggested change
.unwrap_err());
.context("Failed to get or create project")?

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 220a830 in 26 seconds

More details
  • Looked at 14 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. engine/cli/src/deploy.rs:109
  • Draft comment:
    Remove the commented-out code // env!("CARGO_PKG_VERSION") for clarity, as env!("CARGO_PKG_VERSION") is correctly used.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The use of env!("CARGO_PKG_VERSION") is correct and aligns with the intent to dynamically fetch the package version. However, the commented-out code should be removed for clarity.

Workflow ID: wflow_R6YrNaUVIJLghYGy


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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