-
Notifications
You must be signed in to change notification settings - Fork 0
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
Ci/add pipelines #48
Ci/add pipelines #48
Conversation
Warning Rate limit exceeded@werlleyg has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 53 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. WalkthroughForam introduzidos novos arquivos de workflow do GitHub Actions para automatizar processos de integração contínua e verificação de versão em pull requests. O arquivo Changes
Poem
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
🧹 Outside diff range and nitpick comments (3)
.github/workflows/main-pr.yaml (1)
30-46
: Especificar a versão exata do Node.jsPara garantir maior consistência e reprodutibilidade, é recomendável especificar a versão exata do Node.js ao invés de usar apenas "18".
Sugestão de correção:
- name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: "18" + node-version: "18.x".github/workflows/main-version.yaml (2)
44-69
: Aprimorar a lógica de comparação de versõesA lógica de comparação atual, embora funcional, pode ser melhorada para maior clareza e manutenibilidade.
Sugestão de refatoração:
- name: Compare versions id: compare_versions run: | - echo "Comparing versions..." - VERSION=${{ env.VERSION }} - LATEST_TAG=${{ env.LATEST_TAG }} - VERSION_PADDED=$(printf "%s\n" "$VERSION" | awk -F. '{printf("%04d%04d%04d", $1, $2, $3)}') - LATEST_TAG_PADDED=$(printf "%s\n" "$LATEST_TAG" | awk -F. '{printf("%04d%04d%04d", $1, $2, $3)}') - echo "Padded Project version: $VERSION_PADDED" - echo "Padded Latest tag version: $LATEST_TAG_PADDED" - if [ "$VERSION_PADDED" -gt "$LATEST_TAG_PADDED" ]; then - echo "Project version $VERSION is greater than latest tag $LATEST_TAG" - echo "::set-output name=create_tag::true" - else - echo "Project version $VERSION is not greater than latest tag $LATEST_TAG" - echo "::set-output name=create_tag::false" - exit 1 - fi + VERSION="${{ env.VERSION }}" + LATEST_TAG="${{ env.LATEST_TAG }}" + + # Função para converter versão em número para comparação + version_to_number() { + echo "$1" | awk -F. '{ printf("%04d%04d%04d", $1, $2, $3) }' + } + + VERSION_NUM=$(version_to_number "$VERSION") + LATEST_TAG_NUM=$(version_to_number "$LATEST_TAG") + + echo "Comparando versões:" + echo "Versão do projeto: $VERSION -> $VERSION_NUM" + echo "Última tag: $LATEST_TAG -> $LATEST_TAG_NUM" + + if [ "$VERSION_NUM" -gt "$LATEST_TAG_NUM" ]; then + echo "create_tag=true" >> $GITHUB_OUTPUT + else + echo "create_tag=false" >> $GITHUB_OUTPUT + exit 1 + fi🧰 Tools
🪛 actionlint
46-46: workflow command "set-output" was deprecated. use
echo "{name}={value}" >> $GITHUB_OUTPUT
instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions(deprecated-commands)
46-46: workflow command "set-output" was deprecated. use
echo "{name}={value}" >> $GITHUB_OUTPUT
instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions(deprecated-commands)
70-93
: Adicionar tratamento de erros na criação de tagsA lógica de criação de tags está correta, mas pode se beneficiar de tratamento de erros adicional.
Sugestão de melhoria:
- name: Create and push tag env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | TAG="v${{ needs.check_version.outputs.version }}" + + # Verificar se a tag já existe localmente + if git rev-parse "$TAG" >/dev/null 2>&1; then + echo "Tag $TAG já existe localmente" + exit 1 + fi + + # Verificar se a tag existe remotamente + if git ls-remote --tags origin "refs/tags/$TAG" | grep -q "$TAG"; then + echo "Tag $TAG já existe no repositório remoto" + exit 1 + fi # Create a new tag - git tag $TAG + git tag "$TAG" || { + echo "Erro ao criar a tag $TAG" + exit 1 + } # Push the tag to the remote repository - git push origin $TAG + git push origin "$TAG" || { + echo "Erro ao enviar a tag $TAG para o repositório remoto" + git tag -d "$TAG" + exit 1 + }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
⛔ Files ignored due to path filters (2)
package-lock.json
is excluded by!**/package-lock.json
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (5)
.github/workflows/develop-pr.yaml
(1 hunks).github/workflows/main-pr.yaml
(1 hunks).github/workflows/main-version.yaml
(1 hunks)package.json
(1 hunks)src/main/config/environment.ts
(0 hunks)
💤 Files with no reviewable changes (1)
- src/main/config/environment.ts
✅ Files skipped from review due to trivial changes (2)
- .github/workflows/develop-pr.yaml
- package.json
🧰 Additional context used
🪛 actionlint
.github/workflows/main-pr.yaml
49-49: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting
(shellcheck)
49-49: shellcheck reported issue in this script: SC2086:info:3:27: Double quote to prevent globbing and word splitting
(shellcheck)
56-56: shellcheck reported issue in this script: SC2001:style:6:13: See if you can use ${variable//search/replace} instead
(shellcheck)
56-56: shellcheck reported issue in this script: SC2086:info:6:18: Double quote to prevent globbing and word splitting
(shellcheck)
56-56: shellcheck reported issue in this script: SC2086:info:7:33: Double quote to prevent globbing and word splitting
(shellcheck)
56-56: shellcheck reported issue in this script: SC2086:info:8:32: Double quote to prevent globbing and word splitting
(shellcheck)
68-68: shellcheck reported issue in this script: SC2086:info:17:29: Double quote to prevent globbing and word splitting
(shellcheck)
68-68: shellcheck reported issue in this script: SC2086:info:20:30: Double quote to prevent globbing and word splitting
(shellcheck)
.github/workflows/main-version.yaml
27-27: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting
(shellcheck)
27-27: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT
instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
(deprecated-commands)
34-34: shellcheck reported issue in this script: SC2001:style:6:13: See if you can use ${variable//search/replace} instead
(shellcheck)
34-34: shellcheck reported issue in this script: SC2086:info:6:18: Double quote to prevent globbing and word splitting
(shellcheck)
34-34: shellcheck reported issue in this script: SC2086:info:7:33: Double quote to prevent globbing and word splitting
(shellcheck)
34-34: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT
instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
(deprecated-commands)
46-46: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT
instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
(deprecated-commands)
46-46: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT
instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
(deprecated-commands)
🪛 yamllint
.github/workflows/main-pr.yaml
[error] 89-89: trailing spaces
(trailing-spaces)
🔇 Additional comments (2)
.github/workflows/main-pr.yaml (1)
1-7
: Configuração do workflow aprovada!
A configuração do gatilho está correta, acionando o workflow apenas para pull requests direcionados ao branch main.
.github/workflows/main-version.yaml (1)
1-7
: Configuração do workflow aprovada!
A configuração do gatilho está correta para execução apenas no branch main, o que é apropriado para gerenciamento de versões.
Summary by CodeRabbit
Novos Recursos
Develop PR Check
valida pull requests para o branchdevelop
.Main PR Check
automatiza testes e comparação de versões para pull requests no branchmain
.Version Check and Create Tag
cria tags automaticamente com base na versão do projeto.Correções de Bugs
"0.1.0"
para"0.0.1"
.Melhorias
debounceTime
agora garante que o valor seja sempre numérico, melhorando a consistência do tipo.