autonomys / astral

Home of our Block Explorer
https://explorer.subspace.network
11 stars 9 forks source link

Docker tag no default value and add missing .env.prod and .env.dev #902

Closed marc-aurele-besner closed 1 week ago

marc-aurele-besner commented 1 week ago

User description

Docker tag no default value and add missing .env.prod and .env.dev


PR Type

enhancement, configuration changes


Description


Changes walkthrough ๐Ÿ“

Relevant files
Configuration changes
.env
Update environment variables for Docker configuration       

.env
  • Added NODE_DOCKER_TAG with a default value.
  • Removed DOCKER_TAG.
  • +2/-1     
    .env.dev
    Add development environment variables file                             

    .env.dev - Created `.env.dev` file for development environment variables.
    +1/-0     
    .env.prod
    Add production environment variables file                               

    .env.prod - Created `.env.prod` file for production environment variables.
    +1/-0     
    docker-compose.yml
    Update Docker image tag reference                                               

    docker-compose.yml - Updated Docker image tag to use `NODE_DOCKER_TAG`.
    +1/-1     
    Enhancement
    package.json
    Update scripts for environment variable handling                 

    indexers/package.json
  • Modified scripts to include .env and environment-specific overrides.
  • +2/-2     

    ๐Ÿ’ก PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    netlify[bot] commented 1 week ago

    Deploy Preview for dev-astral canceled.

    Name Link
    Latest commit 36f6def90cacdaf32b8e3278049ce6b0ac60309d
    Latest deploy log https://app.netlify.com/sites/dev-astral/deploys/6724b7e9ba1c1e0008d82c45
    github-actions[bot] commented 1 week 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

    Configuration Consistency
    Ensure that the new environment variable `NODE_DOCKER_TAG` is consistently used across all deployment scripts and configurations to avoid potential runtime errors. Image Tagging
    Verify that the new `NODE_DOCKER_TAG` environment variable does not introduce any issues with Docker image tagging and deployment, especially in environments where `DOCKER_TAG` was previously used.
    socket-security[bot] commented 1 week ago

    New and removed dependencies detected. Learn more about Socket for GitHub โ†—๏ธŽ

    Package New capabilities Transitives Size Publisher

    ๐Ÿšฎ Removed packages: npm/@babel/helper-validator-identifier@7.25.7, npm/@babel/highlight@7.25.7, npm/@emnapi/core@1.3.1, npm/@emnapi/runtime@1.3.1, npm/@emnapi/wasi-threads@1.0.1, npm/@hutson/parse-repository-url@3.0.2, npm/@isaacs/string-locale-compare@1.1.0, npm/@jest/schemas@29.6.3, npm/@lerna/create@8.1.8, npm/@napi-rs/wasm-runtime@0.2.4, npm/@npmcli/agent@2.2.2, npm/@npmcli/arborist@7.5.4, npm/@npmcli/fs@3.1.1, npm/@npmcli/git@5.0.8, npm/@npmcli/installed-package-contents@2.1.0, npm/@npmcli/map-workspaces@3.0.6, npm/@npmcli/metavuln-calculator@7.1.1, npm/@npmcli/name-from-folder@2.0.0, npm/@npmcli/node-gyp@3.0.0, npm/@npmcli/package-json@5.2.0, npm/@npmcli/promise-spawn@7.0.2, npm/@npmcli/query@3.1.0, npm/@npmcli/redact@2.0.1, npm/@nrwl/devkit@19.8.6, npm/@nrwl/tao@19.8.6, npm/@nx/devkit@19.8.6, npm/@nx/nx-darwin-arm64@19.8.6, npm/@nx/nx-darwin-x64@19.8.6, npm/@nx/nx-freebsd-x64@19.8.6, npm/@nx/nx-linux-arm-gnueabihf@19.8.6, npm/@nx/nx-linux-arm64-gnu@19.8.6, npm/@nx/nx-linux-arm64-musl@19.8.6, npm/@nx/nx-linux-x64-gnu@19.8.6, npm/@nx/nx-linux-x64-musl@19.8.6, npm/@nx/nx-win32-arm64-msvc@19.8.6, npm/@nx/nx-win32-x64-msvc@19.8.6, npm/@octokit/auth-token@3.0.4, npm/@octokit/core@4.2.4, npm/@octokit/endpoint@7.0.6, npm/@octokit/graphql@5.0.6, npm/@octokit/openapi-types@18.1.1, npm/@octokit/plugin-enterprise-rest@6.0.1, npm/@octokit/plugin-paginate-rest@6.1.2, npm/@octokit/plugin-request-log@1.0.4, npm/@octokit/plugin-rest-endpoint-methods@7.2.3, npm/@octokit/request-error@3.0.3, npm/@octokit/request@6.2.8, npm/@octokit/rest@19.0.11, npm/@octokit/tsconfig@1.0.2, npm/@sigstore/bundle@2.3.2, npm/@sigstore/core@1.1.0, npm/@sigstore/protobuf-specs@0.3.2, npm/@sigstore/sign@2.3.2, npm/@sigstore/tuf@2.3.4, npm/@sigstore/verify@1.2.1, npm/@sinclair/typebox@0.27.8, npm/@tufjs/canonical-json@2.0.0, npm/@tufjs/models@2.0.1, npm/@tybys/wasm-util@0.9.0, npm/@types/minimatch@3.0.5, npm/@types/minimist@1.2.5, npm/@types/normalize-package-data@2.4.4, npm/@yarnpkg/lockfile@1.1.0, npm/@yarnpkg/parsers@3.0.0-rc.46, npm/@zkochan/js-yaml@0.0.7, npm/abbrev@2.0.0, npm/add-stream@1.0.0, npm/agent-base@7.1.1, npm/aggregate-error@3.1.0, npm/ansi-colors@4.1.3, npm/aproba@2.0.0, npm/array-differ@3.0.0, npm/array-ify@1.0.0, npm/arrify@2.0.1, npm/axios@1.7.7, npm/before-after-hook@2.2.3, npm/bin-links@4.0.4, npm/byte-size@8.1.1, npm/cacache@18.0.4, npm/callsites@3.1.0, npm/camelcase-keys@6.2.2, npm/camelcase@5.3.1, npm/chalk@4.1.0, npm/chownr@2.0.0, npm/ci-info@3.9.0, npm/clean-stack@2.2.0, npm/cli-spinners@2.6.1, npm/cli-width@3.0.0, npm/cliui@8.0.1, npm/cmd-shim@6.0.3, npm/color-support@1.1.3, npm/columnify@1.6.0, npm/common-ancestor-path@1.0.1, npm/compare-func@2.0.0, npm/concat-stream@2.0.0, npm/console-control-strings@1.1.0, npm/conventional-changelog-angular@7.0.0, npm/conventional-changelog-core@5.0.1, npm/conventional-changelog-preset-loader@3.0.0, npm/conventional-changelog-writer@6.0.1, npm/conventional-commits-filter@3.0.0, npm/conventional-commits-parser@4.0.0, npm/conventional-recommended-bump@7.0.1, npm/core-util-is@1.0.3, npm/cosmiconfig@8.3.6, npm/cssesc@3.0.0, npm/dargs@7.0.0, npm/dateformat@3.0.3, npm/decamelize-keys@1.1.1, npm/decamelize@1.2.0, npm/dedent@1.5.3, npm/define-lazy-prop@2.0.0, npm/deprecation@2.3.1, npm/detect-indent@5.0.0, npm/diff-sequences@29.6.3, npm/dotenv-expand@11.0.6, npm/duplexer@0.1.2, npm/encoding@0.1.13, npm/enquirer@2.3.6, npm/env-paths@2.2.1, npm/envinfo@7.13.0, npm/err-code@2.0.3, npm/error-ex@1.3.2, npm/escape-string-regexp@1.0.5, npm/ethers@6.13.4, npm/eventemitter3@4.0.7, npm/execa@5.0.0, npm/exponential-backoff@3.1.1, npm/figures@3.2.0, npm/find-up@2.1.0, npm/front-matter@4.0.2, npm/fs-constants@1.0.0, npm/fs-minipass@3.0.3, npm/fs.realpath@1.0.0, npm/function-bind@1.1.2, npm/get-caller-file@2.0.5, npm/get-pkg-repo@4.2.1, npm/get-port@5.1.1, npm/get-stream@6.0.0, npm/git-raw-commits@3.0.0, npm/git-remote-origin-url@2.0.0, npm/git-semver-tags@5.0.1, npm/git-up@7.0.0, npm/git-url-parse@14.0.0, npm/gitconfiglocal@1.0.0, npm/glob-parent@6.0.2, npm/handlebars@4.7.8, npm/hard-rejection@2.1.0, npm/has-unicode@2.0.1, npm/hasown@2.0.2, npm/http-proxy-agent@7.0.2, npm/https-proxy-agent@7.0.5, npm/human-signals@2.1.0, npm/ignore-walk@6.0.5, npm/import-fresh@3.3.0, npm/import-local@3.1.0, npm/init-package-json@6.0.3, npm/inquirer@8.2.6, npm/ip-address@9.0.5, npm/is-arrayish@0.2.1, npm/is-ci@3.0.1, npm/is-core-module@2.15.1, npm/is-lambda@1.0.1, npm/is-plain-obj@1.1.0, npm/is-ssh@1.4.0, npm/is-stream@2.0.0, npm/is-text-path@1.0.1, npm/isarray@1.0.0, npm/isexe@3.1.1, npm/jest-diff@29.7.0, npm/jest-get-type@29.6.3, npm/js-tokens@4.0.0, npm/jsbn@1.1.0, npm/json-parse-better-errors@1.0.2, npm/json-stringify-nice@1.1.4, npm/jsonc-parser@3.2.0, npm/jsonparse@1.3.1, npm/jsonstream@1.3.5, npm/just-diff-apply@5.5.0, npm/just-diff@6.0.2, npm/lerna@8.1.8, npm/libnpmaccess@8.0.6, npm/libnpmpublish@9.0.9, npm/lines-and-columns@2.0.3, npm/load-json-file@6.2.0, npm/locate-path@2.0.0, npm/lodash.ismatch@4.4.0, npm/make-dir@4.0.0, npm/make-fetch-happen@13.0.1, npm/map-obj@4.3.0, npm/meow@8.1.2, npm/min-indent@1.0.1, npm/minimatch@3.0.5, npm/minimist-options@4.1.0, npm/minipass-collect@2.0.1, npm/minipass-fetch@3.0.5, npm/minipass-flush@1.0.5, npm/minipass-pipeline@1.2.4, npm/minipass-sized@1.0.3, npm/minizlib@2.1.2, npm/mkdirp@1.0.4, npm/modify-values@1.0.1, npm/multimatch@5.0.0, npm/mute-stream@0.0.8, npm/negotiator@0.6.3, npm/node-fetch@2.6.7, npm/node-gyp@10.2.0, npm/node-machine-id@1.1.12, npm/nopt@7.2.1, npm/npm-bundled@3.0.1, npm/npm-install-checks@6.3.0, npm/npm-normalize-package-bin@3.0.1, npm/npm-package-arg@11.0.2, npm/npm-packlist@8.0.2, npm/npm-pick-manifest@9.1.0, npm/npm-run-path@4.0.1, npm/nx@19.8.6, npm/open@8.4.2, npm/p-finally@1.0.0, npm/p-limit@1.3.0, npm/p-locate@2.0.0, npm/p-map-series@2.1.0, npm/p-map@4.0.0, npm/p-pipe@3.1.0, npm/p-queue@6.6.2, npm/p-timeout@3.2.0, npm/p-try@1.0.0, npm/p-waterfall@2.1.1, npm/pacote@18.0.6, npm/parent-module@1.0.1, npm/parse-conflict-json@3.0.1, npm/parse-path@7.0.0, npm/parse-url@8.1.0, npm/path-exists@4.0.0, npm/path-parse@1.0.7, npm/pify@5.0.0, npm/pkg-dir@4.2.0, npm/postcss-selector-parser@6.1.2, npm/pretty-format@29.7.0, npm/process-nextick-args@2.0.1, npm/proggy@2.0.0, npm/promise-all-reject-late@1.0.1, npm/promise-call-limit@3.0.2, npm/promise-inflight@1.0.1, npm/promise-retry@2.0.1, npm/promzard@1.0.2, npm/protocols@2.0.1, npm/quick-lru@4.0.1, npm/react-is@18.3.1, npm/read-cmd-shim@4.0.0, npm/read-pkg-up@3.0.0, npm/read-pkg@3.0.0, npm/read@3.0.1, npm/redent@3.0.0, npm/require-directory@2.1.1, npm/resolve-cwd@3.0.0, npm/resolve-from@5.0.0, npm/resolve@1.22.8, npm/retry@0.12.0, npm/rimraf@4.4.1, npm/run-async@2.4.1, npm/safe-buffer@5.1.2, npm/set-blocking@2.0.0, npm/sigstore@2.3.1, npm/smart-buffer@4.2.0, npm/socks-proxy-agent@8.0.4, npm/socks@2.8.3, npm/sort-keys@2.0.0, npm/spdx-correct@3.2.0, npm/spdx-exceptions@2.5.0, npm/spdx-expression-parse@3.0.1, npm/spdx-license-ids@3.0.20, npm/split2@3.2.2, npm/split@1.0.1, npm/string-width-cjs@4.2.3, npm/strip-ansi-cjs@6.0.1, npm/strip-bom@4.0.0, npm/strip-final-newline@2.0.0, npm/strip-indent@3.0.0, npm/supports-preserve-symlinks-flag@1.0.0, npm/tar-stream@2.2.0, npm/temp-dir@1.0.0, npm/text-extensions@1.9.0, npm/through2@2.0.5, npm/tmp@0.2.3, npm/treeverse@3.0.0, npm/trim-newlines@3.0.1, npm/tsconfig-paths@4.2.0, npm/tslib@2.8.0, npm/tuf-js@2.2.1, npm/type-fest@0.6.0, npm/typedarray@0.0.6, npm/uglify-js@3.19.3, npm/unique-filename@3.0.0, npm/unique-slug@4.0.0, npm/universal-user-agent@6.0.1, npm/upath@2.0.1, npm/uuid@10.0.0, npm/walk-up-path@3.0.1, npm/which@4.0.0, npm/wide-align@1.1.5, npm/wrap-ansi-cjs@7.0.0, npm/write-file-atomic@5.0.1, npm/write-json-file@3.2.0, npm/write-pkg@4.0.0, npm/xtend@4.0.2, npm/y18n@5.0.8, npm/yallist@4.0.0, npm/yargs-parser@21.1.1

    View full reportโ†—๏ธŽ

    github-actions[bot] commented 1 week ago

    PR Code Suggestions โœจ

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Add a default value to the NODE_DOCKER_TAG environment variable to ensure stability ___ **Ensure that the environment variable NODE_DOCKER_TAG is defined with a default value
    in the Docker Compose file to prevent potential runtime errors if the variable is
    not set in the environment.** [docker-compose.yml [34]](https://github.com/autonomys/astral/pull/902/files#diff-e45e45baeda1c1e73482975a664062aa56f20c03dd9d64a827aba57775bed0d3R34-R34) ```diff -image: ghcr.io/autonomys/node:${NODE_DOCKER_TAG} +image: ghcr.io/autonomys/node:${NODE_DOCKER_TAG:-latest} ```
    Suggestion importance[1-10]: 8 Why: The suggestion to add a default value for `NODE_DOCKER_TAG` in the Docker Compose file is valuable as it prevents potential runtime errors if the environment variable is not set. This enhances the robustness and stability of the deployment process.
    8