Skip to content

Conversation

@cleot
Copy link
Contributor

@cleot cleot commented Jun 18, 2025

PR Type

Bug fix


Description

• Fixed CI workflow deployment logic for manual dispatch
• Removed conditional job execution that prevented manual deployments
• Updated production deployment condition to check environment input


Changes walkthrough 📝

Relevant files
Bug fix
deploy-wildcat-docker.yml
Fix workflow manual dispatch execution logic                         

.github/workflows/deploy-wildcat-docker.yml

• Removed job-level conditional that blocked manual dispatch execution

• Updated production deployment condition to validate environment
input
• Cleaned up comments and formatting

+1/-9     

Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • @qodo-code-review
    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Logic Issue

    The workflow now runs all matrix environments on every trigger, but production deployment only occurs for the selected environment on manual dispatch. This could lead to unnecessary job executions and resource waste when multiple environments are processed but only one is actually deployed.

    strategy:
      matrix:
        include:
          - environment: 'wildcat-dev-docker'
            project_name: ${{ vars.CLOUDFLARE_PROJECT_DEV_DOCKER }}
            vite_api_base_url: ${{ vars.VITE_API_BASE_URL_DEV_DOCKER }}
            vite_keycloak_url: ${{ vars.VITE_KEYCLOAK_URL_DEV_DOCKER }}
            vite_keycloak_realm: 'dev'
            vite_keycloak_client_id: 'bff-dashboard'
          - environment: 'wildcat-docker'
            project_name: ${{ vars.CLOUDFLARE_PROJECT_DOCKER }}
            vite_api_base_url: ${{ vars.VITE_API_BASE_URL_DOCKER }}
            vite_keycloak_url: ${{ vars.VITE_KEYCLOAK_URL_DOCKER }}
            vite_keycloak_realm: 'dev'
            vite_keycloak_client_id: 'bff-dashboard'
    Missing Validation

    The production deployment condition assumes github.event.inputs.environment exists and is valid, but there's no validation to ensure the input matches one of the defined matrix environments, which could cause silent failures or unexpected behavior.

    if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == matrix.environment
    uses: cloudflare/wrangler-action@v3

    @qodo-code-review
    Copy link

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Include push events for production

    The condition should also handle push events to tags for production deployment.
    Without this, tagged releases won't trigger production deployments
    automatically.

    .github/workflows/deploy-wildcat-docker.yml [90]

    -if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == matrix.environment
    +if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == matrix.environment)
    • Apply / Chat
    Suggestion importance[1-10]: 9

    __

    Why: The PR removed a job-level if condition that triggered deployments on push events. The new step-level condition for production deployment only accounts for workflow_dispatch, which is a regression. The suggestion correctly identifies this and restores the original, critical functionality for automatic deployments on tag pushes.

    High
    • More

    @codecov
    Copy link

    codecov bot commented Jun 18, 2025

    Codecov Report

    All modified and coverable lines are covered by tests ✅

    📢 Thoughts on this report? Let us know!

    @cleot cleot merged commit 28bdf0c into master Jun 19, 2025
    6 checks passed
    @cleot cleot deleted the cleot/fix-workflow-2 branch June 20, 2025 12:31
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants