Skip to content

feature: Add more logs during deployments and scaling#246

Merged
machadoit merged 1 commit into
masterfrom
add-logs-scaling
Jun 18, 2026
Merged

feature: Add more logs during deployments and scaling#246
machadoit merged 1 commit into
masterfrom
add-logs-scaling

Conversation

@machadoit

@machadoit machadoit commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Adding logs to avoid misleading logs. Usually before something blowing up, you have the name of the previous deployment

@machadoit machadoit requested review from a team, CallMeLeopoldo, jorgebraz, kendrickcurtis, lolgab, nfcodacy and ricardobernardino2024 and removed request for a team June 18, 2026 09:51

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request adds logging statements to the deployment scaling loop in src/jobs/helm_aws.yml to output the targeted deployment and the target replica count. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

The PR successfully introduces descriptive logging for Helm/AWS deployment and scaling operations, which will improve observability. However, the implementation in src/jobs/helm_aws.yml contains a logic inefficiency: it executes helm get manifest repeatedly inside a loop, which can result in unnecessary overhead and potential Kubernetes API throttling.

Furthermore, there is a lack of validation for the REPLICA_COUNT variable; if the manifest retrieval fails or returns unexpected data, the scaling command will fail with a syntax error. Despite the Codacy grade being up to standards, these robustness and performance issues should be addressed. Finally, the PR lacks automated test scenarios to verify that the newly added logs are correctly formatted and emitted during different execution paths.

Test suggestions

  • Verify that targeting logs (deployment, release, namespace) are printed to stdout during the job execution.
  • Verify that scaling logs (deployment name, replica count) are printed correctly for both scale-down and reset paths.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that targeting logs (deployment, release, namespace) are printed to stdout during the job execution.
2. Verify that scaling logs (deployment name, replica count) are printed correctly for both scale-down and reset paths.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

Comment thread src/jobs/helm_aws.yml
if [ << parameters.scale_environment_down >> = true ]; then
REPLICA_COUNT=0
else
REPLICA_COUNT=$(helm get manifest -n $NAMESPACE $RELEASE | yq eval -o json | jq -r ". | select( (.kind == \"Deployment\") and (.metadata.name ==\"$DEPLOYMENT\") ) | .spec.replicas" )

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 MEDIUM RISK

Suggestion: The helm get manifest command is called repeatedly inside the loop. To improve performance and robustness, consider fetching the manifest once per release and storing it in a variable. Additionally, you should verify that REPLICA_COUNT is a valid integer before executing the kubectl scale command to prevent runtime errors (e.g., syntax errors if the variable is empty).

@machadoit machadoit enabled auto-merge June 18, 2026 09:57
@machadoit machadoit merged commit 956f91a into master Jun 18, 2026
6 checks passed
@lolgab lolgab deleted the add-logs-scaling branch June 18, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants