-
Notifications
You must be signed in to change notification settings - Fork 200
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
fix: changing environment call for argo app action #2814
Conversation
|
WalkthroughThe pull request introduces modifications to the Changes
Possibly related PRs
Suggested reviewers
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
CodeRabbit Configuration File (
|
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: 1
🧹 Outside diff range and nitpick comments (1)
.github/workflows/db-ops.yaml (1)
Line range hint
89-103
: Improve the YAML file check implementation.The current implementation has a few areas for improvement:
- The debug echo statements for hash values aren't captured or logged properly
- The fallback to dev-custom-values.yaml could be more explicit
Consider this improved implementation:
- name: Check if values yaml file exists id: update_helm_check shell: bash run: | + echo "Checking for file: kubernetes/helm/wf-service/${{ env.MIGRATION_ENV }}-custom-values.yaml" if [ -f "kubernetes/helm/wf-service/${{ env.MIGRATION_ENV }}-custom-values.yaml" ]; then echo "file_name=${{ env.MIGRATION_ENV }}-custom-values.yaml" >> "$GITHUB_OUTPUT" - echo ${{ env.SHORT_HASH }}-${{ needs.build-and-push-ee-image.outputs.SUBMODULE_SHORT_HASH }} + echo "Using image tag: ${{ env.SHORT_HASH }}-${{ needs.build-and-push-ee-image.outputs.SUBMODULE_SHORT_HASH }}" else + echo "Environment-specific values file not found, falling back to dev-custom-values.yaml" echo "file_name=dev-custom-values.yaml" >> "$GITHUB_OUTPUT" - echo ${{ env.SHORT_HASH }}-${{ needs.build-and-push-ee-image.outputs.SUBMODULE_SHORT_HASH }} + echo "Using image tag: ${{ env.SHORT_HASH }}-${{ needs.build-and-push-ee-image.outputs.SUBMODULE_SHORT_HASH }}" fi
environment: ${{ github.event.client_payload.environment }} | ||
env: | ||
stage: ${{ github.env.MIGRATION_ENV }} | ||
stage: ${{ github.event.client_payload.environment }} |
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.
Add environment validation for security.
Direct use of github.event.client_payload.environment
without validation could potentially allow deployment to unintended environments through the repository dispatch event.
Consider adding environment validation:
environment: ${{ github.event.client_payload.environment }}
env:
+ ALLOWED_ENVIRONMENTS: 'dev,sb,prod'
stage: ${{ github.event.client_payload.environment }}
+ if: contains(env.ALLOWED_ENVIRONMENTS, github.event.client_payload.environment)
Also, consider adding a step to validate the environment:
steps:
- name: Validate environment
run: |
if [[ ! "${{ github.event.client_payload.environment }}" =~ ^(dev|sb|prod)$ ]]; then
echo "Invalid environment specified"
exit 1
fi
To test this change it needs to be added in the default branch
Summary by CodeRabbit