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

Binary #2

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

Binary #2

wants to merge 12 commits into from

Conversation

mo-c4t
Copy link
Member

@mo-c4t mo-c4t commented Dec 17, 2024

  • Added building binary to ci workflow
  • upload release asset when release is published

Summary by CodeRabbit

  • New Features

    • Introduced a new job for building binaries in the CI workflow.
    • Added a binary build job in the release workflow that creates and uploads a compressed tarball upon release.
    • New service configuration for deploying the homeserver in docker-compose.yml.
  • Bug Fixes

    • Minor formatting adjustments made to existing jobs for better readability.
  • Chores

    • Updated package metadata, including authors, description, repository URL, and version incremented to 1.0.0.
    • Renamed output binary from conduit to camino-conduit in the Dockerfile.

Copy link

coderabbitai bot commented Dec 17, 2024

Warning

Rate limit exceeded

@mo-c4t has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 30 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 7826f84 and 541821c.

📒 Files selected for processing (1)
  • .github/workflows/release.yml (1 hunks)
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces modifications to two GitHub Actions workflow files: ci.yml and release.yml. A new job called build_binary has been added to both workflows, designed to build a binary using Cargo. The ci.yml workflow maintains its existing Docker image build functionality, while the release.yml workflow now includes steps to build and upload a binary during the release process. Additionally, the Cargo.toml file has been updated to reflect changes in authorship, description, repository URL, and versioning. The Dockerfile has been modified to rename the output binary, and a new docker-compose.yml file has been added to configure the deployment of the application.

Changes

File Change Summary
.github/workflows/ci.yml - Renamed workflow from build-docker-image to ci
- Added new build_binary job to build binary using Cargo
- Preserved existing build_docker job
.github/workflows/release.yml - Added new build_binary job triggered on release
- Job checks out repository, builds binary, creates tarball
- Uploads binary tarball using softprops/action-gh-release@v2
Cargo.toml - Updated authors from "timokoesters" to "evlekht"
- Expanded description to specify "Camino purposes"
- Changed repository URL to GitHub
- Incremented version from "0.8.0" to "1.0.0"
- Updated binary name in [[bin]] and asset name
Dockerfile - Changed binary output name from conduit to camino-conduit
- Updated references to the new binary name in build and copy commands
docker-compose.yml - Added configuration for homeserver service
- Defined volume for persistent storage
- Configured environment variables for the application

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant CI as GitHub Actions
    participant Repo as Repository
    
    Dev->>Repo: Trigger workflow
    Repo->>CI: Initiate workflow
    CI->>CI: Checkout repository
    CI->>CI: Build binary with Cargo
    CI->>Repo: Upload binary artifact
Loading

Poem

🐰 A Rabbit's Release Rhyme 🚀
With Cargo's might, we build and compile,
Workflows dancing in GitHub's style,
Binary packed, a digital delight,
Automation's magic takes its flight!
Release the code, let freedom ring! 🌈


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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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.

@mo-c4t mo-c4t requested a review from evlekht December 17, 2024 08:46
Copy link

@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.

Actionable comments posted: 3

🧹 Nitpick comments (2)
.github/workflows/ci.yml (1)

21-22: Fix trailing whitespace in Docker build step

The Docker build command looks correct, but there's unnecessary trailing whitespace.

-          docker build . -t ${{ env.docker_image }}:temp
-  
+          docker build . -t ${{ env.docker_image }}:temp
🧰 Tools
🪛 yamllint (1.35.1)

[error] 22-22: trailing spaces

(trailing-spaces)

.github/workflows/release.yml (1)

46-49: Enhance release asset upload security and documentation

The release asset upload should include checksums and basic documentation.

       - name: upload binary
         uses: softprops/action-gh-release@v2
         with:
-          files: camino-conduit-linux-amd64-${{ github.event.release.tag_name }}.tar.gz
+          files: |
+            camino-conduit-linux-amd64-${{ github.event.release.tag_name }}.tar.gz
+            conduit.sha256
+          body: |
+            ## Binary Checksums
+            ```
+            ${{ runner.os }} SHA256: $(cat conduit.sha256)
+            ```
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a950035 and c9c0822.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml (2 hunks)
  • .github/workflows/release.yml (1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/release.yml

[error] 33-33: trailing spaces

(trailing-spaces)


[error] 44-44: trailing spaces

(trailing-spaces)


[warning] 50-50: too many blank lines

(1 > 0) (empty-lines)

.github/workflows/ci.yml

[error] 22-22: trailing spaces

(trailing-spaces)


[error] 23-23: trailing spaces

(trailing-spaces)


[error] 32-32: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (1)
.github/workflows/release.yml (1)

Line range hint 1-50: Verify binary build consistency across workflows

Let's ensure the binary builds are consistent between CI and releases.

✅ Verification successful

Binary builds are consistent across workflows

The verification shows that both CI and release workflows:

  • Use identical build commands: cargo build --release
  • Run in the same environment: ubuntu-latest
  • Use the same checkout action version: actions@v4

The only difference is that the release workflow includes additional steps for packaging and publishing the binary, which is expected and correct.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any differences in build configurations between CI and release workflows
echo "Checking build configuration consistency..."
diff <(rg "cargo build" .github/workflows/ci.yml -A 2) <(rg "cargo build" .github/workflows/release.yml -A 2)

# Look for any conditional build flags or environment variables
echo "Checking for build conditions..."
rg "(cargo|CARGO|RUSTC)" .github/workflows/

Length of output: 558


Script:

#!/bin/bash
# Let's check the complete CI workflow file to understand the build context
echo "CI Workflow:"
cat .github/workflows/ci.yml

echo -e "\nRelease Workflow:"
cat .github/workflows/release.yml

# Check if there are any other workflow files that might affect the build
echo -e "\nOther workflow files:"
fd -e yml -e yaml . .github/workflows/

Length of output: 2107

🧰 Tools
🪛 yamllint (1.35.1)

[error] 33-33: trailing spaces

(trailing-spaces)


[error] 44-44: trailing spaces

(trailing-spaces)


[warning] 50-50: too many blank lines

(1 > 0) (empty-lines)

.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
Copy link

@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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/release.yml (1)

33-51: LGTM! Binary build and release process is well-structured.

The build_binary job correctly builds and uploads the release asset.

Consider fixing the trailing whitespace and extra blank lines:

   build_binary:    
     name: Build Binary
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v4

       - name: build binary
         run: |
           cd src
           cargo build --release
           ./target/release/conduit --version
-          tar -czvf camino-conduit-linux-amd64-${{ github.event.release.tag_name }}.tar.gz --directory=target/release conduit
-          
-
+          tar -czvf camino-conduit-linux-amd64-${{ github.event.release.tag_name }}.tar.gz --directory=target/release conduit

       - name: upload binary
         uses: softprops/action-gh-release@v2
         with:
-          files: camino-conduit-linux-amd64-${{ github.event.release.tag_name }}.tar.gz
-
-
+          files: camino-conduit-linux-amd64-${{ github.event.release.tag_name }}.tar.gz
🧰 Tools
🪛 yamllint (1.35.1)

[error] 33-33: trailing spaces

(trailing-spaces)


[error] 45-45: trailing spaces

(trailing-spaces)


[warning] 51-51: too many blank lines

(1 > 0) (empty-lines)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c9c0822 and 4508f9a.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • .github/workflows/ci.yml (1 hunks)
  • .github/workflows/release.yml (1 hunks)
  • Cargo.toml (1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/ci.yml

[warning] 7-7: wrong indentation: expected 6 but found 8

(indentation)


[error] 13-13: trailing spaces

(trailing-spaces)


[error] 22-22: trailing spaces

(trailing-spaces)


[error] 23-23: trailing spaces

(trailing-spaces)


[error] 33-33: no new line character at the end of file

(new-line-at-end-of-file)

.github/workflows/release.yml

[error] 33-33: trailing spaces

(trailing-spaces)


[error] 45-45: trailing spaces

(trailing-spaces)


[warning] 51-51: too many blank lines

(1 > 0) (empty-lines)

🔇 Additional comments (5)
.github/workflows/ci.yml (3)

1-11: LGTM! Well-structured workflow configuration.

The workflow configuration is clear and properly defines the triggers and environment variables.

🧰 Tools
🪛 yamllint (1.35.1)

[warning] 7-7: wrong indentation: expected 6 but found 8

(indentation)


12-22: LGTM! Docker build job is well-configured.

The build_docker job follows best practices and is properly structured.

🧰 Tools
🪛 yamllint (1.35.1)

[error] 13-13: trailing spaces

(trailing-spaces)


[error] 22-22: trailing spaces

(trailing-spaces)


23-33: 🛠️ Refactor suggestion

Enhance the binary build job with proper Rust toolchain setup and caching.

The binary build job needs improvements for better reliability and efficiency.

Apply this diff:

   build_binary:    
     name: Build Binary
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v4
+
+      - name: Install Rust toolchain
+        uses: actions-rs/toolchain@v1
+        with:
+          toolchain: stable
+          profile: minimal
+
+      - name: Cache Cargo dependencies
+        uses: actions/cache@v3
+        with:
+          path: |
+            ~/.cargo/registry
+            ~/.cargo/git
+            target
+          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
 
       - name: build binary
         run: |
           cd src
           cargo build --release
-          ./target/release/conduit --version
+          ./target/release/conduit --version || true
+
+      - name: Upload binary artifact
+        uses: actions/upload-artifact@v3
+        with:
+          name: conduit-binary
+          path: src/target/release/conduit

Likely invalid or redundant comment.

🧰 Tools
🪛 yamllint (1.35.1)

[error] 23-23: trailing spaces

(trailing-spaces)


[error] 33-33: no new line character at the end of file

(new-line-at-end-of-file)

.github/workflows/release.yml (1)

30-32: LGTM! Proper Docker image tagging.

The Docker image tagging strategy correctly includes both latest and release tags.

Cargo.toml (1)

11-12: LGTM! Updated package metadata.

The author and description updates accurately reflect the project's current state.

Cargo.toml Show resolved Hide resolved
Copy link

@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.

Actionable comments posted: 2

🧹 Nitpick comments (2)
.github/workflows/ci.yml (1)

13-22: Fix YAML formatting issues

There are trailing spaces in the YAML file that should be removed.

Apply this diff to fix the formatting:

-  build_docker:    
+  build_docker:
     name: Build Docker
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v4

       - name: build docker image
         run: |
           docker build . -t ${{ env.docker_image }}:temp
-  
+
🧰 Tools
🪛 yamllint (1.35.1)

[error] 13-13: trailing spaces

(trailing-spaces)


[error] 22-22: trailing spaces

(trailing-spaces)

.github/workflows/release.yml (1)

47-50: Validate release tag before upload

The release tag should be validated before being used in the artifact name.

Add a validation step before the upload:

+      - name: Validate release tag
+        run: |
+          [[ "${{ github.event.release.tag_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit 1
+
       - name: upload binary
         uses: softprops/action-gh-release@v2
         with:
           files: camino-conduit-linux-amd64-${{ github.event.release.tag_name }}.tar.gz
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4508f9a and 88a5ad3.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml (1 hunks)
  • .github/workflows/release.yml (1 hunks)
  • Dockerfile (1 hunks)
🧰 Additional context used
📓 Learnings (1)
.github/workflows/release.yml (1)
Learnt from: mo-c4t
PR: chain4travel/camino-conduit#2
File: .github/workflows/release.yml:41-43
Timestamp: 2024-12-17T10:51:12.144Z
Learning: In the Camino Conduit project, do not suggest adding checksum generation and binary verification steps to the GitHub Actions workflows in `.github/workflows/release.yml` unless requested.
🪛 yamllint (1.35.1)
.github/workflows/ci.yml

[warning] 7-7: wrong indentation: expected 6 but found 8

(indentation)


[error] 13-13: trailing spaces

(trailing-spaces)


[error] 22-22: trailing spaces

(trailing-spaces)


[error] 23-23: trailing spaces

(trailing-spaces)


[error] 33-33: no new line character at the end of file

(new-line-at-end-of-file)

.github/workflows/release.yml

[error] 33-33: trailing spaces

(trailing-spaces)


[error] 45-45: trailing spaces

(trailing-spaces)


[warning] 51-51: too many blank lines

(1 > 0) (empty-lines)

🔇 Additional comments (1)
.github/workflows/ci.yml (1)

23-33: 🛠️ Refactor suggestion

Enhance the binary build job with best practices

The binary build job needs several improvements:

  1. Missing Rust toolchain setup
  2. No caching mechanism for faster builds
  3. Binary name inconsistency with Dockerfile (using conduit vs camino-conduit)

Apply this diff to improve the job:

   build_binary:    
     name: Build Binary
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v4
+      
+      - name: Install Rust toolchain
+        uses: actions-rs/toolchain@v1
+        with:
+          toolchain: stable
+          profile: minimal
+
+      - name: Cache Cargo dependencies
+        uses: actions/cache@v3
+        with:
+          path: |
+            ~/.cargo/registry
+            ~/.cargo/git
+            target
+          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
 
       - name: build binary
         run: |
           cd src
           cargo build --release
-          ./target/release/conduit --version
+          ./target/release/camino-conduit --version || exit 1

Likely invalid or redundant comment.

🧰 Tools
🪛 yamllint (1.35.1)

[error] 23-23: trailing spaces

(trailing-spaces)


[error] 33-33: no new line character at the end of file

(new-line-at-end-of-file)

.github/workflows/release.yml Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Copy link

@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.

Actionable comments posted: 3

🧹 Nitpick comments (4)
Cargo.toml (1)

Line range hint 134-135: Review dependency management strategy

The project now depends on forked versions of critical dependencies:

  1. avalanche-types from Chain4Travel's fork
  2. ruma from Chain4Travel's fork

Consider:

  1. Documenting the reasons for maintaining forks
  2. Setting up automated dependency updates
  3. Planning for upstream synchronization

Regular synchronization with upstream repositories will help maintain security patches and feature updates. Consider implementing automated checks for new upstream releases.

Also applies to: 147-150

docker-compose.yml (3)

20-25: Consider volume configuration improvements and fix formatting

  1. The non-standard internal port (6167) should be documented.
  2. Consider adding explicit volume configuration for better control over data persistence.
  3. Remove trailing spaces.
     ports:
-        - 8008:6167
+        # Standard Matrix port (8008) mapped to custom internal port (6167)
+        - "8008:6167"
     volumes:
-      #  - ./db/:/var/lib/matrix-conduit/
-      - db:/var/lib/matrix-conduit/
-          
+        - db:/var/lib/matrix-conduit/

And at the bottom of the file:

 volumes:
   db:
+    driver: local
+    driver_opts:
+      type: none
+      device: ${PWD}/data
+      o: bind
🧰 Tools
🪛 yamllint (1.35.1)

[warning] 24-24: wrong indentation: expected 12 but found 10

(indentation)


[error] 25-25: trailing spaces

(trailing-spaces)


43-55: Enhance Element-web configuration documentation

The commented Element-web configuration provides good reference, but consider adding:

  1. Example configuration file
  2. Security considerations for Element-web deployment
  3. Instructions for SSL/TLS setup

Would you like me to provide an example element_config.json template and deployment guide?


57-58: Fix indentation in volumes section

The volumes section has incorrect indentation.

 volumes:
-  db:
+    db:
🧰 Tools
🪛 yamllint (1.35.1)

[warning] 58-58: wrong indentation: expected 4 but found 2

(indentation)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 88a5ad3 and 9115c5b.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • Cargo.toml (3 hunks)
  • docker-compose.yml (1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
docker-compose.yml

[warning] 13-13: wrong indentation: expected 12 but found 10

(indentation)


[warning] 24-24: wrong indentation: expected 12 but found 10

(indentation)


[error] 25-25: trailing spaces

(trailing-spaces)


[warning] 58-58: wrong indentation: expected 4 but found 2

(indentation)

🔇 Additional comments (1)
Cargo.toml (1)

11-19: Consider documenting breaking changes for version 1.0.0

The package metadata changes reflect the project's transfer to Chain4Travel and integration with Camino. However, the version bump to 1.0.0 suggests a stable API. Please ensure:

  1. All breaking changes are documented in CHANGELOG.md
  2. The API is indeed stable and ready for production use
  3. Semantic versioning principles are followed

Cargo.toml Show resolved Hide resolved
docker-compose.yml Show resolved Hide resolved
docker-compose.yml Show resolved Hide resolved
Copy link

@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.

Actionable comments posted: 1

♻️ Duplicate comments (1)
.github/workflows/ci.yml (1)

23-33: 🛠️ Refactor suggestion

Enhance binary build job with best practices

The binary build job needs several improvements for better efficiency and reliability:

  1. Add Rust toolchain setup
  2. Implement Cargo caching
  3. Fix binary path in verification step
  4. Preserve the built binary as an artifact
  build_binary:    
    name: Build Binary
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

+      - name: Install Rust toolchain
+        uses: actions-rs/toolchain@v1
+        with:
+          toolchain: stable
+          profile: minimal
+
+      - name: Cache Cargo dependencies
+        uses: actions/cache@v3
+        with:
+          path: |
+            ~/.cargo/registry
+            ~/.cargo/git
+            target
+          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

      - name: build binary
        run: |
          cd src
          cargo build --release
-          ../target/release/camino-conduit --version
+          cargo run --release -- --version
+
+      - name: Upload binary artifact
+        uses: actions/upload-artifact@v3
+        with:
+          name: camino-conduit
+          path: target/release/camino-conduit
🧰 Tools
🪛 yamllint (1.35.1)

[error] 23-23: trailing spaces

(trailing-spaces)


[error] 33-33: no new line character at the end of file

(new-line-at-end-of-file)

🧹 Nitpick comments (2)
.github/workflows/ci.yml (2)

7-8: Fix indentation in branch list

The indentation for the branches should be consistent with YAML best practices.

    branches:
-        - c4t
-        - dev
+      - c4t
+      - dev
🧰 Tools
🪛 yamllint (1.35.1)

[warning] 7-7: wrong indentation: expected 6 but found 8

(indentation)


33-33: Add newline at end of file

Add a newline character at the end of the file to follow YAML best practices.

          cargo build --release
-          ../target/release/camino-conduit --version
+          ../target/release/camino-conduit --version
+
🧰 Tools
🪛 yamllint (1.35.1)

[error] 33-33: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2091207 and 22e762e.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml (1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/ci.yml

[warning] 7-7: wrong indentation: expected 6 but found 8

(indentation)


[error] 13-13: trailing spaces

(trailing-spaces)


[error] 22-22: trailing spaces

(trailing-spaces)


[error] 23-23: trailing spaces

(trailing-spaces)


[error] 33-33: no new line character at the end of file

(new-line-at-end-of-file)

.github/workflows/ci.yml Outdated Show resolved Hide resolved
Copy link

@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.

Actionable comments posted: 3

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

7-8: Fix YAML indentation

The branch names under branches are over-indented.

Apply this diff to fix the indentation:

    branches:
-        - c4t
-        - dev
+      - c4t
+      - dev
🧰 Tools
🪛 yamllint (1.35.1)

[warning] 7-7: wrong indentation: expected 6 but found 8

(indentation)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 22e762e and 116d234.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml (1 hunks)
  • .github/workflows/release.yml (1 hunks)
🧰 Additional context used
📓 Learnings (1)
.github/workflows/release.yml (1)
Learnt from: mo-c4t
PR: chain4travel/camino-conduit#2
File: .github/workflows/release.yml:41-43
Timestamp: 2024-12-17T10:51:12.144Z
Learning: In the Camino Conduit project, do not suggest adding checksum generation and binary verification steps to the GitHub Actions workflows in `.github/workflows/release.yml` unless requested.
🪛 actionlint (1.7.4)
.github/workflows/ci.yml

23-23: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


52-52: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 yamllint (1.35.1)
.github/workflows/ci.yml

[warning] 7-7: wrong indentation: expected 6 but found 8

(indentation)


[error] 13-13: trailing spaces

(trailing-spaces)


[error] 44-44: trailing spaces

(trailing-spaces)


[error] 45-45: trailing spaces

(trailing-spaces)


[error] 64-64: no new line character at the end of file

(new-line-at-end-of-file)

.github/workflows/release.yml

[error] 33-33: trailing spaces

(trailing-spaces)


[error] 45-45: trailing spaces

(trailing-spaces)


[warning] 51-51: too many blank lines

(1 > 0) (empty-lines)

🔇 Additional comments (3)
.github/workflows/release.yml (3)

30-32: LGTM!

The formatting changes to the Docker build job are clean and don't affect functionality.


47-50: 🛠️ Refactor suggestion

Verify release asset upload configuration

The release asset upload step needs to account for the working directory change.

Apply this diff to fix the asset path:

  - name: upload binary
    uses: softprops/action-gh-release@v2
    with:
-     files: camino-conduit-linux-amd64-${{ github.event.release.tag_name }}.tar.gz
+     files: src/camino-conduit-linux-amd64-${{ github.event.release.tag_name }}.tar.gz
✅ Verification successful

Let me check where the tarball is being created in the workflow by examining the build steps.


The release asset path is incorrect and needs to be updated

The workflow shows that the tarball is created in the src directory with this command:

cd src
tar -czvf camino-conduit-linux-amd64-${{ github.event.release.tag_name }}.tar.gz --directory=target/release camino-conduit

Since the cd src command changes the working directory, and the tarball is created there, the upload step needs to use the path relative to the repository root: src/camino-conduit-linux-amd64-${{ github.event.release.tag_name }}.tar.gz

The suggested fix in the review comment is correct:

  - name: upload binary
    uses: softprops/action-gh-release@v2
    with:
-     files: camino-conduit-linux-amd64-${{ github.event.release.tag_name }}.tar.gz
+     files: src/camino-conduit-linux-amd64-${{ github.event.release.tag_name }}.tar.gz
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the release asset path is correct relative to the working directory

# Test: Check if the tarball is created in the correct location
cd src
ls camino-conduit-linux-amd64-*.tar.gz || echo "Tarball not found in src directory"
cd ..
ls camino-conduit-linux-amd64-*.tar.gz || echo "Tarball not found in root directory"

Length of output: 428


Script:

#!/bin/bash
# Check the workflow file to see where the tarball is being created
cat .github/workflows/release.yml

Length of output: 1315


41-44: ⚠️ Potential issue

Fix binary build and verification steps

There are several issues with the build steps:

  1. The binary path in the version check is incorrect (using ../target when already in src)
  2. Working directory inconsistency between build and tar commands

Apply this diff to fix the issues:

  run: |
    cd src
    cargo build --release
-   ../target/release/camino-conduit --version
-   tar -czvf camino-conduit-linux-amd64-${{ github.event.release.tag_name }}.tar.gz --directory=target/release camino-conduit
+   ./target/release/camino-conduit --version
+   tar -czvf camino-conduit-linux-amd64-${{ github.event.release.tag_name }}.tar.gz --directory=./target/release camino-conduit

Likely invalid or redundant comment.

.github/workflows/ci.yml Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Show resolved Hide resolved
Copy link

@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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
.github/workflows/ci.yml (2)

13-34: Fix trailing spaces in YAML

The Docker build job implementation is solid, using modern practices and proper caching. However, there are trailing spaces that should be removed.

Apply this diff to fix the formatting:

-  build_docker:    
+  build_docker:
🧰 Tools
🪛 yamllint (1.35.1)

[error] 13-13: trailing spaces

(trailing-spaces)


55-55: Add newline at end of file

Add a newline character at the end of the file to follow POSIX standards.

🧰 Tools
🪛 yamllint (1.35.1)

[error] 55-55: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 116d234 and 66bdce0.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/ci.yml

43-43: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 yamllint (1.35.1)
.github/workflows/ci.yml

[warning] 7-7: wrong indentation: expected 6 but found 8

(indentation)


[error] 13-13: trailing spaces

(trailing-spaces)


[error] 35-35: trailing spaces

(trailing-spaces)


[error] 36-36: trailing spaces

(trailing-spaces)


[error] 55-55: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (1)
.github/workflows/ci.yml (1)

1-11: LGTM: Workflow configuration is well-structured

The workflow configuration follows best practices with clear triggers and environment variables.

🧰 Tools
🪛 yamllint (1.35.1)

[warning] 7-7: wrong indentation: expected 6 but found 8

(indentation)

.github/workflows/ci.yml Show resolved Hide resolved
Copy link

@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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

13-35: Fix YAML formatting issues.

There are some minor YAML formatting issues that should be fixed:

  • Remove trailing spaces after build_docker: on line 13
  • Fix indentation of branch names under branches:
    branches:
-        - c4t
-        - dev
+      - c4t
+      - dev
🧰 Tools
🪛 yamllint (1.35.1)

[error] 13-13: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 66bdce0 and 7826f84.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/ci.yml

44-44: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 yamllint (1.35.1)
.github/workflows/ci.yml

[warning] 7-7: wrong indentation: expected 6 but found 8

(indentation)


[error] 13-13: trailing spaces

(trailing-spaces)


[error] 36-36: trailing spaces

(trailing-spaces)


[error] 37-37: trailing spaces

(trailing-spaces)


[error] 56-56: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (3)
.github/workflows/ci.yml (3)

1-11: LGTM! Workflow configuration is well structured.

The workflow triggers and environment variables are properly configured.

🧰 Tools
🪛 yamllint (1.35.1)

[warning] 7-7: wrong indentation: expected 6 but found 8

(indentation)


37-56: ⚠️ Potential issue

Add explicit Rust toolchain setup for reliable builds.

The binary build job is missing explicit Rust toolchain setup, which is critical for consistent and reliable builds across different environments.

Add these steps before the cache step:

  steps:
    - uses: actions/checkout@v4

+   - name: Install Rust toolchain
+     uses: actions-rs/toolchain@v1
+     with:
+       toolchain: stable
+       profile: minimal
+       target: x86_64-unknown-linux-gnu

Likely invalid or redundant comment.

🧰 Tools
🪛 actionlint (1.7.4)

44-44: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 yamllint (1.35.1)

[error] 37-37: trailing spaces

(trailing-spaces)


[error] 56-56: no new line character at the end of file

(new-line-at-end-of-file)


52-56: ⚠️ Potential issue

Fix binary verification path and add newline.

The binary verification step needs adjustment:

  1. The path to the binary should be relative to the working directory
  2. Add a newline at the end of the file
  - name: build binary
    run: |
      cd src
      cargo build --release
-     ../target/release/camino-conduit --version
+     ./target/release/camino-conduit --version
+

Likely invalid or redundant comment.

🧰 Tools
🪛 yamllint (1.35.1)

[error] 56-56: no new line character at the end of file

(new-line-at-end-of-file)

CONDUIT_PORT: 6167
CONDUIT_MAX_REQUEST_SIZE: 200_000_000 # in bytes, ~200 MB
CONDUIT_ALLOW_REGISTRATION: 'false'
CONDUIT_ALLOW_FEDERATION: 'true'
Copy link
Member

Choose a reason for hiding this comment

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

forbid federation, we will not use them

Copy link
Member

Choose a reason for hiding this comment

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

why changes in dependencies?

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