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

Init cmmand #1447

Closed
wants to merge 3 commits into from
Closed

Init cmmand #1447

wants to merge 3 commits into from

Conversation

neo773
Copy link
Contributor

@neo773 neo773 commented Mar 15, 2024

Summary:
Briefly describe the changes made in this PR.

Issue Reference(s):
Fixes #1446 1446

Build & Testing:

  • I ran cargo test successfully.
  • I have run ./lint.sh --mode=fix to fix all linting issues raised by ./lint.sh --mode=check.

Checklist:

  • I have added relevant unit & integration tests.
  • I have updated the documentation accordingly.
  • I have performed a self-review of my code.
  • PR follows the naming convention of <type>(<optional scope>): <title>

/claim #1446

Summary by CodeRabbit

  • Chores
    • Updated CI workflow to dynamically assign the APP_VERSION and modify image tagging accordingly.
  • Refactor
    • Changed the Docker base image to ubuntu:latest and optimized the installation process.
  • New Features
    • Enhanced CLI functionality with the ability to include and write to a JSON file based on specific conditions.

Copy link
Contributor

coderabbitai bot commented Mar 15, 2024

Walkthrough

This update introduces important changes across the CI/CD pipeline, Docker configuration, and the tailcall CLI tool. It ensures that the application versioning is dynamically managed within the CI workflow, refines Docker image creation with updated base images and installation processes, and enhances the tailcall CLI's initialization command to generate a necessary JSON file. These modifications aim to streamline development operations, improve deployment strategies, and fix a specific bug related to the tailcall init command.

Changes

File(s) Summary
.github/workflows/ci.yml Added dynamic APP_VERSION assignment and modified Docker image tagging.
Dockerfile Changed base image to ubuntu:latest and updated the installation process for tailcall.
src/cli/tc.rs Added JSON file creation in the tailcall init command.

Assessment against linked issues

Objective Addressed Explanation
#1446: tailcall init should create .tailcallrc.schema.json file

Poem

🐇 In the land of code and binary dreams,
Where the data flows like crystalline streams.
A rabbit hopped with a mission so keen,
To fix, to build, and to intervene.
🌟 With every commit, a new dawn arises,
Bugs flee as the sun crosses the horizons.
"To improve, to enhance," it softly whispers,
As the digital world listens and shimmers. 🚀

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-tests 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 tests 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 tests.
    • @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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@neo773 neo773 closed this Mar 15, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 3

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 78460e8 and 09df53a.
Files selected for processing (3)
  • .github/workflows/ci.yml (2 hunks)
  • Dockerfile (1 hunks)
  • src/cli/tc.rs (3 hunks)
Additional comments: 3
src/cli/tc.rs (2)
  • 20-20: The addition of JSON_FILE_NAME constant is clear and follows Rust naming conventions.
  • 90-100: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [77-97]

The logic to write the .tailcallrc.schema.json file during the init command execution is correctly implemented. However, consider adding error handling for the file operations (fs::write) to provide more informative error messages to the user in case of failure.

.github/workflows/ci.yml (1)
  • 462-470: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [440-467]

The introduction of the APP_VERSION environment variable and its use in image tagging, including the conditional logic for the latest tag, is well-implemented and follows best practices for version management in CI/CD pipelines.


ENV TAILCALL_LOG_LEVEL=error
CMD ["/bin/tailcall", "start", "jsonplaceholder.graphql"]
FROM ubuntu:latest
Copy link
Contributor

Choose a reason for hiding this comment

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

Switching to ubuntu:latest as the base image might introduce unpredictability over time as latest will always point to the newest version. Consider using a more specific version tag (e.g., ubuntu:20.04) to ensure reproducibility and stability of your Docker builds.

@@ -37,0 +1,4 @@
FROM ubuntu:latest
RUN apt-get update && apt-get install -y curl
RUN curl -sSL https://raw.githubusercontent.com/tailcallhq/tailcall/master/install.sh | bash -s -- v0.55.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Executing a script directly from a URL with curl | bash can be risky, especially without verifying the script's integrity. It's recommended to first download the script, inspect it, and then execute it. Alternatively, consider verifying the script's integrity using a checksum or a GPG signature if available.

FROM ubuntu:latest
RUN apt-get update && apt-get install -y curl
RUN curl -sSL https://raw.githubusercontent.com/tailcallhq/tailcall/master/install.sh | bash -s -- v0.55.0
ENV PATH="${PATH}:~/.tailcall/bin"
Copy link
Contributor

Choose a reason for hiding this comment

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

Setting the PATH environment variable directly in the Dockerfile with a hardcoded path might not be reliable if the installation script changes the installation location. Consider retrieving the installation path dynamically or ensuring that the script guarantees the installation path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: tailcall init command should create .tailcallrc.schema.json file
1 participant