Skip to content

feat: Enhance email template, add RG owner tag, scalability input#249

Open
Vamshi-Microsoft wants to merge 1 commit into
devfrom
psl-workflowchanges
Open

feat: Enhance email template, add RG owner tag, scalability input#249
Vamshi-Microsoft wants to merge 1 commit into
devfrom
psl-workflowchanges

Conversation

@Vamshi-Microsoft
Copy link
Copy Markdown
Contributor

Purpose

This pull request introduces a new "Enable Scalability" option (for WAF deployments only) across all deployment-related GitHub Actions workflows. It also improves validation and parameter handling for this option, and adds minor improvements to notifications and resource group tagging. The most important changes are grouped below.

Enable Scalability Option for Deployments:

  • Added a new enable_scalability (or ENABLE_SCALABILITY) boolean input to all deployment workflows (deploy-orchestrator.yml, deploy-v2.yml, job-deploy.yml, job-deploy-linux.yml, and job-deploy-windows.yml). This allows users to optionally enable scalability features during WAF deployments. [1] [2] [3] [4] [5]
  • Updated workflow jobs to pass and validate the new scalability option throughout the deployment pipeline, including input validation to ensure only "true" or "false" are accepted. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]
  • In the Linux and Windows deployment jobs, updated the parameter file logic to inject the enableScalability value into main.parameters.json when WAF is enabled, with robust validation and error handling. [1] [2]

Resource Group Tagging Improvements:

  • Updated resource group creation and update steps to include an "Owner" tag with the GitHub actor's username for better traceability.

Workflow Input and Output Improvements:

  • Improved and clarified various input descriptions for deployment workflows, including Azure region, WAF, EXP, and Docker image build options, making them more user-friendly.

Notification Workflow Enhancement:

  • In the notification workflow, improved the cleanup status step to display a color-coded HTML "pill" for success, failure, or skipped status, enhancing the readability of notifications.
  • Minor: Fixed the workflow name encoding and added a section header for quota failure notifications. [1] [2]

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the deployment GitHub Actions workflow chain with a new WAF-only “Enable Scalability” input, improves RG traceability by tagging the RG owner, and refreshes the notification emails to use richer HTML formatting (including “pill” status badges).

Changes:

  • Added enable_scalability / ENABLE_SCALABILITY inputs across orchestrator + deployment workflows, with validation and propagation into Linux/Windows parameter handling (WAF path updates infra/main.parameters.json).
  • Updated RG creation/update logic to add an Owner tag (using the GitHub actor) for better resource traceability.
  • Reworked notification emails to send structured HTML (status “pills”, improved layout) instead of simple inline HTML strings.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
.github/workflows/job-send-notification.yml Replaces plain status strings with HTML “pill” rendering and sends richer HTML email payloads.
.github/workflows/job-deploy.yml Adds enable_scalability input + validation, propagates it to downstream jobs, and tags RGs with Owner.
.github/workflows/job-deploy-linux.yml When WAF is enabled, injects enableScalability into infra/main.parameters.json with validation.
.github/workflows/job-deploy-windows.yml Mirrors Linux behavior for WAF deployments by injecting enableScalability into parameters with validation.
.github/workflows/deploy-v2.yml Adds workflow-dispatch input + validation/output plumbing for enable_scalability and improves input descriptions/options.
.github/workflows/deploy-orchestrator.yml Propagates the new enable_scalability input through the orchestrator to the deploy job.
Comments suppressed due to low confidence (2)

.github/workflows/job-send-notification.yml:218

  • The deployment-failure email template injects RESOURCE_GROUP, ${{ github.actor }}, and ${{ env.BRANCH_NAME }} into HTML without escaping. RESOURCE_GROUP_NAME can come from workflow inputs; please HTML-escape these values to avoid HTML/attribute injection in notification emails.
                    <tr><td style="padding:8px 0; font-size:13px; color:#6b7280; width:140px;">Resource Group</td>
                        <td style="padding:8px 0; font-size:13px; color:#111827; font-family:'Cascadia Code','Courier New',monospace;">${RESOURCE_GROUP}</td></tr>
                    <tr><td style="padding:8px 0; font-size:13px; color:#6b7280;">Triggered By</td>
                        <td style="padding:8px 0; font-size:13px; color:#111827;">${{ github.actor }}</td></tr>
                    <tr><td style="padding:8px 0; font-size:13px; color:#6b7280;">Branch</td>
                        <td style="padding:8px 0; font-size:13px; color:#111827; font-family:'Cascadia Code','Courier New',monospace;">${{ env.BRANCH_NAME }}</td></tr>

.github/workflows/job-send-notification.yml:301

  • In the success notification, github.actor and env.BRANCH_NAME are still embedded into HTML without escaping even though other inputs are escaped. For consistency and to avoid HTML injection via branch names, please apply html_escape to these fields as well.
                    <tr><td style="padding:8px 0; font-size:13px; color:#6b7280;">Triggered By</td>
                        <td style="padding:8px 0; font-size:13px; color:#111827;">${{ github.actor }}</td></tr>
                    <tr><td style="padding:8px 0; font-size:13px; color:#6b7280;">Branch</td>
                        <td style="padding:8px 0; font-size:13px; color:#111827; font-family:'Cascadia Code','Courier New',monospace;">${{ env.BRANCH_NAME }}</td></tr>
                  </table>

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -1,4 +1,4 @@
name: Send Notification Job
name: Send Notification Job
Comment on lines +140 to +142
<td style="padding:8px 0; font-size:13px; color:#111827;">${{ github.actor }}</td></tr>
<tr><td style="padding:8px 0; font-size:13px; color:#6b7280;">Branch</td>
<td style="padding:8px 0; font-size:13px; color:#111827; font-family:'Cascadia Code','Courier New',monospace;">${{ env.BRANCH_NAME }}</td></tr>
Comment on lines +200 to +206
# Validate enable_scalability (boolean, opt-in, default false)
ENABLE_SCALABILITY_VALUE="${INPUT_ENABLE_SCALABILITY:-false}"
if [[ "$ENABLE_SCALABILITY_VALUE" != "true" && "$ENABLE_SCALABILITY_VALUE" != "false" ]]; then
echo "❌ ERROR: enable_scalability must be 'true' or 'false', got: '$ENABLE_SCALABILITY_VALUE'"
VALIDATION_FAILED=true
else
echo "✅ enable_scalability: '$ENABLE_SCALABILITY_VALUE' is valid"
VALIDATION_FAILED=true
else
echo "✅ enable_scalability: '$ENABLE_SCALABILITY' is valid"
fi
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