TykTechnologies / tyk

Tyk Open Source API Gateway written in Go, supporting REST, GraphQL, TCP and gRPC protocols
Other
9.51k stars 1.07k forks source link

[SYSE-370 release-5.3] June template application #6408

Closed ermirizio closed 1 month ago

ermirizio commented 1 month ago
github-actions[bot] commented 1 month ago

PR Reviewer Guide 🔍

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Key issues to review

**Possible Clarity Issue:** The consolidation of multiple lines into a single line in the `run` command might reduce readability and maintainability. While it simplifies the script, it could make it harder for other developers to understand or modify the script in the future.
github-actions[bot] commented 1 month ago

API Changes

no api changes detected
github-actions[bot] commented 1 month ago

PR Code Suggestions ✨

CategorySuggestion                                                                                                                                    Score
Maintainability
Split the complex run command into multiple steps for clarity and maintainability ___ **Split the complex run command into multiple steps for better readability and
maintainability. This will make it easier to understand and modify individual parts
of the deployment process.** [.github/workflows/release.yml [284]](https://github.com/TykTechnologies/tyk/pull/6408/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34R284-R284) ```diff -run: "match_tag=${{steps.ecr.outputs.registry}}/$REPO:$BASE_REF\ntags=(${{ needs.goreleaser.outputs.tags }}) \ndocker run -q --rm -v ~/.docker/config.json:/root/.docker/config.json tykio/gromit policy match ${tags[0]} ${match_tag} 2>versions.env\necho '# alfa and beta have to come after the override\ntyk_alfa_image=$tyk_image\ntyk_beta_image=$tyk_image\nECR=${{steps.ecr.outputs.registry}}\ntyk_pump_image=${{matrix.pump}}\ntyk_sink_image=${{matrix.sink}}\nconfs_dir=./pro-ha\nenv_file=local-${{ matrix.envfiles.db }}.env' >> versions.env\necho \"::group::versions\"\ncat versions.env\necho \"::endgroup::\"\n# Add Tyk component config variations to $env_file\ncat confs/${{ matrix.envfiles.config }}.env >> local-${{ matrix.envfiles.db }}.env\n# bring up env, the project name is important\ndocker compose -p auto -f pro-ha.yml -f deps_pro-ha.yml -f ${{ matrix.envfiles.db }}.yml -f ${{ matrix.envfiles.cache }}.yml --env-file versions.env --profile master-datacenter up --quiet-pull -d\n./dash-bootstrap.sh http://localhost:3000\ndocker compose -p auto -f pro-ha.yml -f deps_pro-ha.yml -f ${{ matrix.envfiles.db }}.yml -f ${{ matrix.envfiles.cache }}.yml --env-file versions.env --profile slave-datacenter up --quiet-pull -d\n" +- name: Prepare environment variables + run: | + match_tag=${{steps.ecr.outputs.registry}}/$REPO:$BASE_REF + tags=(${{ needs.goreleaser.outputs.tags }}) + echo "match_tag and tags prepared." +- name: Run docker policy match + run: | + docker run -q --rm -v ~/.docker/config.json:/root/.docker/config.json tykio/gromit policy match ${tags[0]} ${match_tag} 2>versions.env +- name: Setup version environment + run: | + echo '# alfa and beta have to come after the override\ntyk_alfa_image=$tyk_image\ntyk_beta_image=$tyk_image\nECR=${{steps.ecr.outputs.registry}}\ntyk_pump_image=${{matrix.pump}}\ntyk_sink_image=${{matrix.sink}}\nconfs_dir=./pro-ha\nenv_file=local-${{ matrix.envfiles.db }}.env' >> versions.env + echo "::group::versions" + cat versions.env + echo "::endgroup::" +- name: Update configuration and deploy + run: | + cat confs/${{ matrix.envfiles.config }}.env >> local-${{ matrix.envfiles.db }}.env + docker compose -p auto -f pro-ha.yml -f deps_pro-ha.yml -f ${{ matrix.envfiles.db }}.yml -f ${{ matrix.envfiles.cache }}.yml --env-file versions.env --profile master-datacenter up --quiet-pull -d + ./dash-bootstrap.sh http://localhost:3000 + docker compose -p auto -f pro-ha.yml -f deps_pro-ha.yml -f ${{ matrix.envfiles.db }}.yml -f ${{ matrix.envfiles.cache }}.yml --env-file versions.env --profile slave-datacenter up --quiet-pull -d ```
Suggestion importance[1-10]: 9 Why: The suggestion significantly improves readability and maintainability by breaking down a complex, multiline command into smaller, more manageable steps. This makes it easier to understand and modify individual parts of the deployment process.
9
github-actions[bot] commented 1 month ago

:boom: CI tests failed :see_no_evil:

git-state

all ok

Please look at the run or in the Checks tab.

github-actions[bot] commented 1 month ago

:boom: CI tests failed :see_no_evil:

git-state

all ok

Please look at the run or in the Checks tab.

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud