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

Added automatic version updates with bump #284

Merged
merged 4 commits into from
Oct 7, 2024
Merged

Added automatic version updates with bump #284

merged 4 commits into from
Oct 7, 2024

Conversation

MartelliEnrico
Copy link
Contributor

@MartelliEnrico MartelliEnrico commented Oct 1, 2024

A new secret BUMP_TOKEN must be created to run workflows on the PRs openend by bump. See https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#triggering-a-workflow-from-a-workflow

Closes #270

Summary by CodeRabbit

  • New Features

    • Introduced an automated workflow for updating dependencies, scheduled to run daily.
    • Added a new shell script for updating SHA256 hashes based on URL templates.
  • Improvements

    • Enhanced Dockerfile for better handling of the libwebp library with versioning and checksum verification.
    • Updated unit test workflow to specify a new version of FFmpeg.
    • Added entries to .dockerignore to exclude specific files during the Docker build process.

Copy link
Contributor

coderabbitai bot commented Oct 1, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces a new automated workflow for updating dependencies, specifically for the libwebp library, along with a Dockerfile for building the application. A shell script named hashupdate is also added to facilitate the updating of SHA256 hashes for specified files. These changes enhance the management of dependencies and improve the reliability of the build process.

Changes

Files Change Summary
.github/workflows/bump.yaml New workflow for automated dependency updates, triggered daily and manually, using wader/bump/action@master for updating dependencies.
.github/workflows/unit-test.yml Updated FFmpeg version to '7.0.2' in the Setup FFmpeg step.
Dockerfile Updated to handle libwebp library with versioning and checksum verification. Introduced new arguments for version, URL, and SHA256 checksum, and modified download and extraction commands accordingly.
hashupdate New shell script for updating SHA256 hashes based on a URL template, ensuring error handling and automating the hash update process.

Assessment against linked issues

Objective Addressed Explanation
Use bump to keep libwebp up to date (#270)

🐰 In the garden where bunnies play,
New workflows bloom, brightening the day.
With hashes updated and libraries neat,
Our code hops forward, a joyful feat!
Dependencies managed, all in a row,
Thanks to the changes, watch our project grow! 🌼


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

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.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (7)
.github/workflows/bump.yaml (2)

1-6: LGTM! Consider adding a comment for the cron schedule.

The workflow name and triggers are well-defined. The daily schedule at 9 AM is suitable for version updates, and the manual trigger provides flexibility.

To improve readability, consider adding a comment explaining the cron schedule:

on:
  schedule:
    # Run daily at 9 AM UTC
    - cron: '0 9 * * *'

8-18: LGTM! Consider pinning the bump action version.

The job structure and steps are well-defined. The use of actions/checkout@v4 ensures we're using a recent version for checking out the repository.

For improved stability and reproducibility, consider pinning the wader/bump/action to a specific version instead of using master:

      - name: Update dependencies
        uses: wader/bump/action@v1 # Replace with the latest stable version
hashupdate (3)

4-5: Good documentation, but consider adding more details.

The script provides clear usage instructions and attributes the source, which is commendable. However, consider adding a brief description of what the script does to enhance its usability.

You could add a comment like:

# This script updates the SHA256 hash of a specified file based on a given URL template.

6-7: Efficient URL extraction and construction, but consider error handling.

The URL extraction and construction logic is efficient and correct. However, it assumes a specific format in the input file. Consider adding error handling for cases where the expected pattern is not found.

You could add a check like this:

if [ -z "$URL_TEMPLATE" ]; then
    echo "Error: Could not find URL template for $2 in $1" >&2
    exit 1
fi

8-9: Correct hash computation and file update, but could be more robust.

The hash computation and file update logic are correct. However, consider adding error handling for the curl command and validating the computed hash.

You could improve the robustness with something like:

if ! SHA256=$(curl -sSL "$URL" | sha256sum | cut -d ' ' -f 1); then
    echo "Error: Failed to download or compute hash for $URL" >&2
    exit 1
fi

if [ ${#SHA256} -ne 64 ]; then
    echo "Error: Invalid SHA256 hash computed" >&2
    exit 1
fi

sed -i -E "s/$2_SHA256=.*/$2_SHA256=$SHA256/" "$1" || {
    echo "Error: Failed to update hash in $1" >&2
    exit 1
}
Dockerfile (2)

3-6: Excellent addition of bump comments and version argument!

The bump comments align perfectly with the PR objectives to keep libwebp up to date. The explicit version definition enhances reproducibility. Well done!

A minor suggestion: Consider adding a comment explaining the purpose of LIBWEBP_VERSION for better documentation.


11-13: Excellent improvements to the download and extraction process!

The use of LIBWEBP_URL, SHA256 verification, and the updated extraction command significantly enhance security and control. These changes align perfectly with the PR objectives.

A minor suggestion: Consider adding error handling to the curl command, such as the -f flag, to fail on server errors. This could prevent silent failures in the build process.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 12d5562 and 8b6216d.

📒 Files selected for processing (4)
  • .github/workflows/bump.yaml (1 hunks)
  • Bumpfile (1 hunks)
  • Dockerfile (2 hunks)
  • hashupdate (1 hunks)
🔇 Additional comments (7)
Bumpfile (1)

1-1: LGTM! The Bumpfile has been added successfully.

The addition of this Bumpfile aligns with the PR objective of implementing automatic version updates using the "bump" tool. It appears to be configured to monitor and update the Dockerfile.

However, the actual Dockerfile is not provided in this review. To ensure completeness, please run the following script to verify the existence and contents of the Dockerfile:

✅ Verification successful

LGTM! The Bumpfile and Dockerfile have been verified successfully.

The Bumpfile has been added and correctly references the Dockerfile, which exists and is properly configured to work with the bump tool for automatic version updates.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence and contents of the Dockerfile

# Test 1: Check if Dockerfile exists
if [ -f "Dockerfile" ]; then
    echo "Dockerfile exists."
    # Test 2: Display the contents of the Dockerfile
    echo "Contents of Dockerfile:"
    cat Dockerfile
else
    echo "Dockerfile not found. Please ensure it has been added to the repository."
fi

Length of output: 1542

.github/workflows/bump.yaml (1)

18-18: Verify the existence of the BUMP_TOKEN secret.

The workflow correctly uses the BUMP_TOKEN secret as specified in the PR objectives. However, we should ensure that this secret has been properly set up in the repository settings.

Run the following script to verify the existence of the BUMP_TOKEN secret:

If the secret is not found, please add it to the repository secrets as described in the PR objectives.

hashupdate (1)

1-2: Good use of error handling and portable shebang.

The script uses /bin/sh for broad compatibility and set -eu for strict error handling, which are both good practices in shell scripting.

Dockerfile (4)

7-8: Excellent security enhancement with URL and SHA256 arguments!

The addition of LIBWEBP_URL with a dynamic version and LIBWEBP_SHA256 for integrity verification significantly improves the security and reliability of the download process. This aligns perfectly with best practices for handling external dependencies.


24-24: Correct update to the cwebp copy command!

The change in the source path for copying cwebp is consistent with the earlier modifications to the extraction process. This ensures that the correct binary is copied to the final image, maintaining the integrity of the build process.


25-25: Correct update to the dwebp copy command!

The change in the source path for copying dwebp is consistent with the earlier modifications to the extraction process and the change made for cwebp. This ensures that the correct binary is copied to the final image, maintaining the integrity of the build process.


Line range hint 1-29: Excellent work on implementing automatic version updates for libwebp!

This PR successfully addresses the objectives outlined in issue #270. The changes introduce robust version management for libwebp, enhance security through SHA256 verification, and improve the overall reliability of the build process. The use of bump comments aligns perfectly with the goal of keeping libwebp up to date automatically.

A few minor suggestions have been made to further improve documentation and error handling. Overall, this is a significant enhancement to the project's dependency management and build process.

Great job on this implementation!

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.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (3)
Bumpfile (1)

1-2: LGTM! The Bumpfile is correctly structured for automatic updates.

The Bumpfile is properly configured to target the unit test workflow and the Dockerfile for automatic updates. This aligns well with the PR objective of implementing automatic version updates using the bump tool.

A few points to note:

  1. Ensure that the .github/workflows/unit-test.yml file exists and is correctly set up to handle version updates.
  2. The inclusion of the Dockerfile suggests that Docker image builds will be part of the automatic update process, which is a good practice for maintaining consistency across environments.

Consider documenting the purpose of this Bumpfile in your project's README or a separate CONTRIBUTING.md file to help other developers understand its role in the automated update process.

Dockerfile (2)

3-7: Excellent use of ARG instructions and 'bump' comments

The addition of separate ARG instructions for the libwebp version, URL, and SHA256 hash greatly improves the maintainability and security of the Dockerfile. The 'bump' comments facilitate automatic version updates, which aligns well with the PR objectives.

One minor suggestion: Consider using a multi-line format for the LIBWEBP_URL for improved readability.

You could format the LIBWEBP_URL as follows:

-ARG LIBWEBP_URL="https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-$LIBWEBP_VERSION-linux-x86-64.tar.gz"
+ARG LIBWEBP_URL="https://storage.googleapis.com/downloads.webmproject.org/releases/webp/\
+libwebp-$LIBWEBP_VERSION-linux-x86-64.tar.gz"

23-23: Effective inclusion of FFmpeg binary

The addition of the COPY instruction for the FFmpeg binary from a separate image is an excellent approach. It ensures version consistency and simplifies the build process by avoiding the need to compile FFmpeg from source.

A minor suggestion to improve clarity:

Consider adding a comment explaining why this specific version of FFmpeg is being used. For example:

+# Using FFmpeg 7.0.2 for improved WebM support and performance
COPY --from=mwader/static-ffmpeg:7.0.2 /ffmpeg /usr/local/bin/
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 8b6216d and 0fc6810.

📒 Files selected for processing (5)
  • .github/workflows/bump.yaml (1 hunks)
  • .github/workflows/unit-test.yml (1 hunks)
  • Bumpfile (1 hunks)
  • Dockerfile (2 hunks)
  • hashupdate (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/bump.yaml
  • hashupdate
🔇 Additional comments (5)
Dockerfile (4)

10-12: Robust download and verification process

The implementation of the download and verification process for libwebp is commendable. The use of curl to download the file and the subsequent SHA256 hash verification ensures both efficiency and security. This approach aligns well with best practices for handling external dependencies in Dockerfiles.


22-22: Good addition of FFmpeg version bump comment

The inclusion of the 'bump' comment for FFmpeg is a positive step towards maintaining up-to-date dependencies. This aligns well with the PR's objective of implementing automatic version updates and will help ensure that the project uses the latest compatible version of FFmpeg.


28-29: Correct update of cwebp and dwebp binary paths

The COPY instructions for the cwebp and dwebp binaries have been appropriately updated to reflect the new extraction path of libwebp. This ensures that the correct binaries are included in the final image, maintaining the functionality of the application.


Line range hint 1-32: Comprehensive improvements to dependency management and build process

The changes made to this Dockerfile significantly enhance the handling of dependencies, particularly libwebp and FFmpeg. The introduction of ARG instructions and 'bump' comments facilitates easier updates and improves overall maintainability. The addition of SHA256 hash verification for libwebp enhances security.

These modifications align well with the PR objectives of implementing automatic version updates and keeping dependencies up-to-date. The changes should contribute to improved performance, security, and compatibility of the project.

Well done on these improvements!

.github/workflows/unit-test.yml (1)

29-30: Approve FFmpeg version update and suggest verification

The FFmpeg version has been updated to 7.0.2, which aligns with the PR objective of keeping dependencies up-to-date. The added comment facilitates automated updates using the 'bump' tool.

To ensure the update doesn't introduce any compatibility issues, please run the following verification script:

This script triggers the workflow and checks its conclusion. If it returns 'success', the new FFmpeg version is compatible with the existing setup.

Bumpfile Outdated Show resolved Hide resolved
.github/workflows/bump.yaml Outdated Show resolved Hide resolved
.github/workflows/bump.yaml Show resolved Hide resolved
.github/workflows/bump.yaml Show resolved Hide resolved
@rob93c rob93c added dependencies Pull requests that update a dependency file docker This marks issues revolving around Docker cicd The change affects CI/CD flows hacktoberfest The issue is suitable for Hacktoberfest labels Oct 5, 2024
@MartelliEnrico MartelliEnrico requested a review from rob93c October 7, 2024 09:14
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.

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (2)
Dockerfile (2)

3-7: Excellent use of ARG instructions and 'bump' tool comments.

The addition of separate ARG instructions for the libwebp version, URL, and SHA256 checksum improves flexibility and maintainability. The 'bump' tool comments facilitate automatic version updates, which aligns well with the PR objectives.

One minor suggestion:

Consider adding a comment explaining the purpose of the LIBWEBP_SHA256 argument for better code documentation. For example:

+# SHA256 checksum for verifying the integrity of the downloaded libwebp file
ARG LIBWEBP_SHA256=94ac053be5f8cb47a493d7a56b2b1b7328bab9cff24ecb89fa642284330d8dff

23-23: Good addition of ffmpeg binary.

Using a pre-built ffmpeg binary from a trusted source (mwader/static-ffmpeg) with a pinned version is an excellent practice for ensuring reproducibility and security.

A minor suggestion for improvement:

Consider adding a comment explaining the purpose of this ffmpeg binary in your project. This would enhance code readability and maintainability. For example:

+# Copy ffmpeg binary for video processing capabilities
COPY --from=mwader/static-ffmpeg:7.0.2 /ffmpeg /usr/local/bin/
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 0fc6810 and 2efaaa7.

📒 Files selected for processing (4)
  • .dockerignore (1 hunks)
  • .github/workflows/bump.yaml (1 hunks)
  • .github/workflows/unit-test.yml (1 hunks)
  • Dockerfile (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .dockerignore
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/bump.yaml
  • .github/workflows/unit-test.yml
🧰 Additional context used
🔇 Additional comments (2)
Dockerfile (2)

Line range hint 1-32: Overall, excellent improvements to the Dockerfile.

The changes in this Dockerfile align well with the PR objectives of implementing automatic version updates and improving dependency management. Key improvements include:

  1. Introduction of ARG instructions for better flexibility in managing libwebp versions.
  2. Implementation of checksum verification for enhanced security.
  3. Addition of 'bump' tool comments to facilitate automatic updates for both libwebp and ffmpeg.
  4. Integration of the ffmpeg binary from a trusted source.

These modifications contribute to a more maintainable, secure, and up-to-date build process. The use of version pinning and integrity checks ensures reproducibility and security of the build.

Great work on enhancing the Dockerfile! The changes effectively address the goals outlined in the PR objectives and linked issue #270.


28-29: Correct update to cwebp and dwebp binary paths.

The change in the source paths for cwebp and dwebp binaries is consistent with the earlier modification in the libwebp extraction process. This ensures that the correct binaries are copied to the final image.

To ensure full consistency, let's verify that the extraction path in the earlier part of the Dockerfile matches these copy instructions:

This will help confirm that the extraction path and these copy instructions are using the same directory structure.

✅ Verification successful

Path Consistency Verified for libwebp Binaries

The extraction path for libwebp in the Dockerfile aligns with the copy instructions for cwebp and dwebp binaries. This ensures that the correct binaries are being copied to the final image.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check the extraction path for libwebp
rg --type dockerfile "tar -xzf libwebp.tar.gz" -A 1

Length of output: 88


Script:

#!/bin/bash
# Locate all Dockerfiles and search for the libwebp extraction command
fd --type f --exact-filename 'Dockerfile' | xargs rg "tar -xzf libwebp.tar.gz" -A 1

Length of output: 457

Dockerfile Outdated
Comment on lines 10 to 12
RUN curl "$LIBWEBP_URL" -o libwebp.tar.gz
RUN echo "$LIBWEBP_SHA256 libwebp.tar.gz" | sha256sum -c -
RUN tar -xzf libwebp.tar.gz --one-top-level=libwebp --strip-components=1
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Good implementation of download and checksum verification.

The use of the LIBWEBP_URL variable for downloading and the addition of SHA256 checksum verification are excellent practices that enhance security and consistency.

A minor suggestion for improvement:

Consider adding error handling to the download command. This can be achieved by using the -f (fail) option with curl:

-RUN curl "$LIBWEBP_URL" -o libwebp.tar.gz
+RUN curl -f "$LIBWEBP_URL" -o libwebp.tar.gz || (echo "Download failed"; exit 1)

This change will cause the build to fail explicitly if the download encounters an error, making troubleshooting easier.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
RUN curl "$LIBWEBP_URL" -o libwebp.tar.gz
RUN echo "$LIBWEBP_SHA256 libwebp.tar.gz" | sha256sum -c -
RUN tar -xzf libwebp.tar.gz --one-top-level=libwebp --strip-components=1
RUN curl -f "$LIBWEBP_URL" -o libwebp.tar.gz || (echo "Download failed"; exit 1)
RUN echo "$LIBWEBP_SHA256 libwebp.tar.gz" | sha256sum -c -
RUN tar -xzf libwebp.tar.gz --one-top-level=libwebp --strip-components=1

COPY --from=builder /tmp/libwebp/bin/cwebp /usr/local/bin/
COPY --from=builder /tmp/libwebp/bin/dwebp /usr/local/bin/

# bump: ffmpeg /static-ffmpeg:([\d.]+)/ docker:mwader/static-ffmpeg|~7.0
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Bump comments syntax inconsistency identified.

While reviewing the 'bump' comments, it has been observed that the syntax used for ffmpeg differs from that of libwebp. Please confirm if this variation is intentional due to different update mechanisms or if standardisation across the project is required.

  • File: Dockerfile
    • Line: 22
    • Current syntax: # bump: ffmpeg /static-ffmpeg:([\d.]+)/ docker:mwader/static-ffmpeg|~7.0
    • libwebp syntax example: # bump: libwebp /LIBWEBP_VERSION=([\d.]+)/ git:https://chromium.googlesource.com/webm/libwebp.git|*
🔗 Analysis chain

Good addition of 'bump' comment for ffmpeg.

The inclusion of a 'bump' tool comment for ffmpeg is consistent with the PR objectives of implementing automatic version updates.

Could you please clarify why the syntax for this 'bump' comment differs from the one used for libwebp? Is this intentional due to different update mechanisms?

To assist in verifying the consistency of 'bump' comments across the project, you can run the following command:

This will help ensure that the different syntaxes are used consistently where appropriate.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for all 'bump' comments in the project
rg --type dockerfile --type shell "# bump:" -A 2

Length of output: 85


Script:

#!/bin/bash
# Find all Dockerfile names and search for '# bump:' comments
fd --type f -iname 'Dockerfile' | xargs rg '# bump:' -A 2

Length of output: 864

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.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (1)
Dockerfile (1)

3-7: Well-structured libwebp version management

The explicit definition of the libwebp version, URL, and SHA256 hash using ARG instructions is a good practice. It enhances maintainability and security.

A minor suggestion for improvement:
Consider adding a comment explaining the purpose of the ./hashupdate command in the bump comment. This would provide clarity for future maintainers.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 2efaaa7 and 3753a7f.

📒 Files selected for processing (2)
  • .github/workflows/bump.yaml (1 hunks)
  • Dockerfile (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/bump.yaml
🧰 Additional context used
🔇 Additional comments (3)
Dockerfile (3)

10-12: Secure download and verification process

The implementation of the libwebp download and verification process is excellent. The use of curl for download, SHA256 for integrity verification, and appropriate tar extraction flags enhances security and reliability.


26-29: Proper placement of built artifacts and libwebp binaries

The copying of the built JRE, JAR file, and libwebp binaries is well-structured. Placing the libwebp binaries in /usr/local/bin/ ensures they're easily accessible in the system PATH, which is a good practice.


Line range hint 32-32: Appropriate CMD instruction with necessary system property

The CMD instruction is well-constructed, running the Java application with the correct JAR file. The inclusion of the system property to specify the webp binary directory is a thoughtful addition, ensuring the application can locate the necessary binaries.

Dockerfile Show resolved Hide resolved
Copy link
Member

@rob93c rob93c left a comment

Choose a reason for hiding this comment

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

Great job @MartelliEnrico! Thank you for helping the project once more 🥇

@rob93c rob93c merged commit 3b11998 into main Oct 7, 2024
6 checks passed
@rob93c rob93c deleted the bump branch October 7, 2024 10:41
URL_TEMPLATE=$(grep "$2_URL=" "$1" | sed -E 's/.*="(.*)"/\1/' | tr -d '\r')
URL=$(echo "$URL_TEMPLATE" | sed "s/\$$2_VERSION/$3/g")
SHA256=$(curl -sL "$URL" | sha256sum | sed -e 's/ -//g')
sed -i -E "s/$2_SHA256=.*/$2_SHA256=$SHA256/" "$1"
Copy link

Choose a reason for hiding this comment

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

Sorry for the mess 😬

(was searching if someone except is using bump 😄)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cicd The change affects CI/CD flows dependencies Pull requests that update a dependency file docker This marks issues revolving around Docker hacktoberfest The issue is suitable for Hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use bump to keep libwebp up to date
3 participants