commented aws for rag_ingestion action#269
Conversation
📝 WalkthroughWalkthroughThis change disables AWS ECR publishing functionality in the GitHub Actions workflow by commenting out AWS-related environment variables and corresponding build, push, and cleanup steps. GCP Artifact Registry and Azure ACR operations remain unchanged and active. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.github/workflows/build-rag-ingestion-develop.yaml (2)
12-14: Prefer an explicit AWS publish toggle over commented env keys.Using commented env entries makes the workflow harder to reason about. Keep env keys active and gate behavior with a boolean flag.
♻️ Proposed refactor
env: PROJECT_ID: aesy-330511 GCP_REGION: asia-south1 GAR_LOCATION: asia-south1-docker.pkg.dev/aesy-330511/root-hub IMAGE_NAME: auraflo-rag-ingestion - - # AWS_REGION: ap-south-1 - # ECR_REGISTRY: 025066241490.dkr.ecr.ap-south-1.amazonaws.com - # ECR_REPOSITORY: rootflo/auraflo-rag-ingestion + ENABLE_AWS_ECR_PUBLISH: "false" + AWS_REGION: ap-south-1 + ECR_REGISTRY: 025066241490.dkr.ecr.ap-south-1.amazonaws.com + ECR_REPOSITORY: rootflo/auraflo-rag-ingestion🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/build-rag-ingestion-develop.yaml around lines 12 - 14, Replace the commented AWS env keys with an explicit boolean toggle and gate publish steps on it: add an env var PUBLISH_TO_AWS (default "false") alongside active AWS_REGION, ECR_REGISTRY and ECR_REPOSITORY entries, and update the publish job/step condition to run only when PUBLISH_TO_AWS == "true" (use the GitHub Actions if: condition referencing env.PUBLISH_TO_AWS). Ensure the AWS_* variables are present in the env scope used by the publish steps and remove the commented lines to avoid confusion.
72-86: Use conditional steps instead of commented-out AWS publish/cleanup blocks.Commented executable steps become stale quickly. Keep the steps live and guard them with
if:so AWS can be toggled safely per env.♻️ Proposed refactor
- # - name: Configure AWS credentials - # uses: aws-actions/configure-aws-credentials@v1 - # with: - # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # aws-region: ${{ env.AWS_REGION }} + - name: Configure AWS credentials + if: env.ENABLE_AWS_ECR_PUBLISH == 'true' + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ env.AWS_REGION }} - # - name: Login to Amazon ECR - # id: login-ecr - # uses: aws-actions/amazon-ecr-login@v1 + - name: Login to Amazon ECR + if: env.ENABLE_AWS_ECR_PUBLISH == 'true' + id: login-ecr + uses: aws-actions/amazon-ecr-login@v1 - # - name: Tag and push image to Amazon ECR - # run: | - # docker tag rootflo:${{ env.IMAGE_TAG }} ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} - # docker push ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} + - name: Tag and push image to Amazon ECR + if: env.ENABLE_AWS_ECR_PUBLISH == 'true' + run: | + docker tag rootflo:${{ env.IMAGE_TAG }} ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} + docker push ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} - # docker rmi ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} || true + if [ "${{ env.ENABLE_AWS_ECR_PUBLISH }}" = "true" ]; then + docker rmi ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} || true + fiAlso applies to: 106-106
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/build-rag-ingestion-develop.yaml around lines 72 - 86, Un-comment the three AWS-related steps and convert them into conditional steps guarded by an `if:` expression (e.g., `if: env.AWS_PUBLISH == 'true'`) so they only run when publishing is desired; specifically update the steps named "Configure AWS credentials", "Login to Amazon ECR", and "Tag and push image to Amazon ECR" to remove the comment markers and add the `if:` guard, keep the original `with:` keys (aws-access-key-id, aws-secret-access-key, aws-region) and the docker tag/push commands intact, and ensure the workflow uses the `aws-actions/configure-aws-credentials@v1` and `aws-actions/amazon-ecr-login@v1` actions as before so toggling via the AWS_PUBLISH env variable enables/disables publishing without leaving commented-out code.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/build-rag-ingestion-develop.yaml:
- Around line 12-14: Replace the commented AWS env keys with an explicit boolean
toggle and gate publish steps on it: add an env var PUBLISH_TO_AWS (default
"false") alongside active AWS_REGION, ECR_REGISTRY and ECR_REPOSITORY entries,
and update the publish job/step condition to run only when PUBLISH_TO_AWS ==
"true" (use the GitHub Actions if: condition referencing env.PUBLISH_TO_AWS).
Ensure the AWS_* variables are present in the env scope used by the publish
steps and remove the commented lines to avoid confusion.
- Around line 72-86: Un-comment the three AWS-related steps and convert them
into conditional steps guarded by an `if:` expression (e.g., `if:
env.AWS_PUBLISH == 'true'`) so they only run when publishing is desired;
specifically update the steps named "Configure AWS credentials", "Login to
Amazon ECR", and "Tag and push image to Amazon ECR" to remove the comment
markers and add the `if:` guard, keep the original `with:` keys
(aws-access-key-id, aws-secret-access-key, aws-region) and the docker tag/push
commands intact, and ensure the workflow uses the
`aws-actions/configure-aws-credentials@v1` and `aws-actions/amazon-ecr-login@v1`
actions as before so toggling via the AWS_PUBLISH env variable enables/disables
publishing without leaving commented-out code.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: abaeae29-2ef6-45c4-9319-04ff197193c4
📒 Files selected for processing (1)
.github/workflows/build-rag-ingestion-develop.yaml
Summary by CodeRabbit