Skip to content

chore: Bicep Parameter validation email format change#576

Open
NirajC-Microsoft wants to merge 2 commits intomicrosoft:devfrom
NirajC-Microsoft:dev
Open

chore: Bicep Parameter validation email format change#576
NirajC-Microsoft wants to merge 2 commits intomicrosoft:devfrom
NirajC-Microsoft:dev

Conversation

@NirajC-Microsoft
Copy link
Copy Markdown
Contributor

Purpose

This pull request enhances the Bicep parameter validation workflow by introducing a structured HTML email report, improving the notification process, and adding new options to the validation script and workflow. The changes make the validation results easier to read and more professional, especially in automated emails sent to the team.

Key improvements include:

HTML Email Reporting

  • Added a new generate_html_report function in infra/scripts/validate_bicep_params.py to create a detailed, well-formatted HTML report of validation results, including error/warning counts, per-file summaries, and workflow run links.
  • Introduced CLI arguments --html-output, --accelerator-name, and --run-url to support HTML report generation and customization.

Workflow and Notification Updates

  • Updated .github/workflows/validate-bicep-params.yml to generate and archive the HTML report (email_body.html) as part of the validation job. [1] [2]
  • Modified notification steps to send the HTML report as the email body, improving readability and professionalism of automated alerts. [1] [2]

Script Output Handling

  • Updated the main function in validate_bicep_params.py to write the HTML report when requested, ensuring the report is generated alongside the existing JSON output.

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

This comment was marked as resolved.

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

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

Comment on lines +79 to +84
EMAIL_BODY=$(cat email_body.html)

jq -n \
--arg name "${ACCELERATOR_NAME}" \
--arg infra "$INFRA_OUTPUT" \
--arg url "$RUN_URL" \
'{subject: ("Bicep Parameter Validation Report - " + $name + " - Issues Detected"), body: ("<p>Dear Team,</p><p>The scheduled <strong>Bicep Parameter Validation</strong> for <strong>" + $name + "</strong> has detected parameter mapping errors.</p><p><strong>infra/ Results:</strong></p><pre>" + $infra + "</pre><p><strong>Run URL:</strong> <a href=\"" + $url + "\">" + $url + "</a></p><p>Please fix the parameter mapping issues at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>")}' \
--arg body "$EMAIL_BODY" \
'{subject: ("Bicep Parameter Validation Report - " + $name + " - Issues Detected"), body: $body}' \
Comment on lines +95 to +100
EMAIL_BODY=$(cat email_body.html)

jq -n \
--arg name "${ACCELERATOR_NAME}" \
--arg infra "$INFRA_OUTPUT" \
--arg url "$RUN_URL" \
'{subject: ("Bicep Parameter Validation Report - " + $name + " - Passed"), body: ("<p>Dear Team,</p><p>The scheduled <strong>Bicep Parameter Validation</strong> for <strong>" + $name + "</strong> has completed successfully. All parameter mappings are valid.</p><p><strong>infra/ Results:</strong></p><pre>" + $infra + "</pre><p><strong>Run URL:</strong> <a href=\"" + $url + "\">" + $url + "</a></p><p>Best regards,<br>Your Automation Team</p>")}' \
--arg body "$EMAIL_BODY" \
'{subject: ("Bicep Parameter Validation Report - " + $name + " - Passed"), body: $body}' \
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