leonardocustodio / polkadart

Polkadart provides developers the ability to query a node and interact with the Polkadot based chains using Dart.
https://polkadart.dev
Apache License 2.0
39 stars 16 forks source link

Remove docker-compose #495

Closed leonardocustodio closed 2 weeks ago

leonardocustodio commented 2 weeks ago

PR Type

enhancement, configuration changes


Description


Changes walkthrough 📝

Relevant files
Enhancement
Dockerfile
Add Dockerfile for Dart environment setup and testing       

Dockerfile
  • Added a new Dockerfile for building a Dart environment.
  • Installed necessary packages and dependencies.
  • Activated melos and set up the environment path.
  • Included commands to fetch dependencies and run tests.
  • +15/-1   
    pubspec.yaml
    Update Dart dependencies in pubspec.yaml                                 

    pubspec.yaml
  • Updated coverage dependency version to ^1.10.0.
  • Updated melos dependency version to ^6.2.0.
  • +2/-2     
    Configuration changes
    docker-compose.yml
    Remove docker-compose configuration                                           

    docker-compose.yml - Removed the `docker-compose.yml` file.
    +0/-7     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    github-actions[bot] commented 2 weeks ago

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Layer Optimization
    The Dockerfile contains multiple RUN commands which can be combined to reduce the number of layers created, improving the build performance and the size of the final image. Dependency Management
    The commands for installing dependencies and running tests are not using any caching mechanism which could lead to longer build times during development.
    github-actions[bot] commented 2 weeks ago

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Security
    Ensure updated packages are used by combining update and install commands ___ **Ensure that the apt-get update is followed by apt-get install in the same RUN
    command to avoid using outdated packages, which can lead to potential security
    vulnerabilities.** [Dockerfile [3-5]](https://github.com/leonardocustodio/polkadart/pull/495/files#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557R3-R5) ```diff -RUN apt-get update -RUN apt-get install -y curl git wget unzip libglu1-mesa +RUN apt-get update && apt-get install -y curl git wget unzip libglu1-mesa ```
    Suggestion importance[1-10]: 9 Why: This suggestion is crucial for security and performance, ensuring that the latest packages are used by combining the update and install commands into a single RUN command.
    9
    Performance
    Reduce Docker image layers by combining RUN commands ___ **Combine the multiple RUN commands into a single RUN command to reduce the number of
    layers in the Docker image, which can help in reducing the overall size and
    improving the build performance.** [Dockerfile [3-5]](https://github.com/leonardocustodio/polkadart/pull/495/files#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557R3-R5) ```diff -RUN apt-get update -RUN apt-get clean -RUN apt-get install -y curl git wget unzip libglu1-mesa +RUN apt-get update && apt-get clean && apt-get install -y curl git wget unzip libglu1-mesa ```
    Suggestion importance[1-10]: 8 Why: Combining RUN commands into a single line reduces the number of layers in the Docker image, improving build performance and reducing size, which is a significant enhancement.
    8
    Minimize Docker image size by avoiding unnecessary packages ___ **Add the --no-install-recommends option to apt-get install to avoid installing
    unnecessary packages, which can help to minimize the Docker image size.** [Dockerfile [5]](https://github.com/leonardocustodio/polkadart/pull/495/files#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557R5-R5) ```diff -RUN apt-get install -y curl git wget unzip libglu1-mesa +RUN apt-get install -y --no-install-recommends curl git wget unzip libglu1-mesa ```
    Suggestion importance[1-10]: 7 Why: Adding `--no-install-recommends` minimizes the Docker image size by avoiding unnecessary packages, which is beneficial for performance and efficiency.
    7
    Reduce Docker image size by clearing the apt cache ___ **Clear the apt cache by adding rm -rf /var/lib/apt/lists/* at the end of the RUN
    command which installs packages to reduce the Docker image size.** [Dockerfile [5]](https://github.com/leonardocustodio/polkadart/pull/495/files#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557R5-R5) ```diff -RUN apt-get update && apt-get install -y curl git wget unzip libglu1-mesa +RUN apt-get update && apt-get install -y curl git wget unzip libglu1-mesa && rm -rf /var/lib/apt/lists/* ```
    Suggestion importance[1-10]: 7 Why: Clearing the apt cache after package installation reduces the Docker image size, which is an effective practice for optimizing Docker build layers.
    7
    codecov[bot] commented 2 weeks ago

    Codecov Report

    All modified and coverable lines are covered by tests :white_check_mark:

    Project coverage is 52.95%. Comparing base (96f3fc1) to head (bc1fe20). Report is 1 commits behind head on main.

    Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/leonardocustodio/polkadart/pull/495/graphs/tree.svg?width=650&height=150&src=pr&token=HG3K4LW5UN&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Leonardo+Custodio)](https://app.codecov.io/gh/leonardocustodio/polkadart/pull/495?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Leonardo+Custodio) ```diff @@ Coverage Diff @@ ## main #495 +/- ## ========================================== + Coverage 48.48% 52.95% +4.46% ========================================== Files 181 146 -35 Lines 9588 8082 -1506 ========================================== - Hits 4649 4280 -369 + Misses 4939 3802 -1137 ``` | [Flag](https://app.codecov.io/gh/leonardocustodio/polkadart/pull/495/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Leonardo+Custodio) | Coverage Δ | | |---|---|---| | [polkadart](https://app.codecov.io/gh/leonardocustodio/polkadart/pull/495/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Leonardo+Custodio) | `?` | | | [polkadart_cli](https://app.codecov.io/gh/leonardocustodio/polkadart/pull/495/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Leonardo+Custodio) | `12.04% <ø> (ø)` | | | [polkadart_keyring](https://app.codecov.io/gh/leonardocustodio/polkadart/pull/495/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Leonardo+Custodio) | `65.24% <ø> (ø)` | | | [polkadart_scale_codec](https://app.codecov.io/gh/leonardocustodio/polkadart/pull/495/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Leonardo+Custodio) | `54.93% <ø> (ø)` | | | [secp256k1_ecdsa](https://app.codecov.io/gh/leonardocustodio/polkadart/pull/495/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Leonardo+Custodio) | `89.60% <ø> (ø)` | | | [sr25519](https://app.codecov.io/gh/leonardocustodio/polkadart/pull/495/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Leonardo+Custodio) | `85.91% <ø> (ø)` | | | [ss58](https://app.codecov.io/gh/leonardocustodio/polkadart/pull/495/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Leonardo+Custodio) | `?` | | | [substrate_bip39](https://app.codecov.io/gh/leonardocustodio/polkadart/pull/495/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Leonardo+Custodio) | `56.37% <ø> (ø)` | | | [substrate_metadata](https://app.codecov.io/gh/leonardocustodio/polkadart/pull/495/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Leonardo+Custodio) | `87.72% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Leonardo+Custodio#carryforward-flags-in-the-pull-request-comment) to find out more. [see 35 files with indirect coverage changes](https://app.codecov.io/gh/leonardocustodio/polkadart/pull/495/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Leonardo+Custodio)