Skip to content

chore: resolve Copilot review comments from PR #579#598

Merged
Prajwal-Microsoft merged 1 commit into
devfrom
psl-sw/pr579-review-fixes
May 20, 2026
Merged

chore: resolve Copilot review comments from PR #579#598
Prajwal-Microsoft merged 1 commit into
devfrom
psl-sw/pr579-review-fixes

Conversation

@Shreyas-Microsoft
Copy link
Copy Markdown
Collaborator

Purpose

Resolves the three Copilot reviewer comments left on PR #579 (which is itself the devmain merge PR). Lands the fixes on a fresh branch off dev so they flow naturally into the next merge upstream.

Changes

  1. .github/workflows/validate-bicep-params.yml – Replace the hard-coded https://github.com/... RUN_URL with the GitHub Actions context (server_url / repository / run_id). Email notifications will now link to the correct run on GitHub Enterprise Server too.
  2. infra/scripts/validate_bicep_params.py – Replace the bespoke _html_escape with a thin wrapper around the stdlib html.escape(text, quote=True), so single quotes are also escaped and the escaping rules stay correct (and easy to maintain) as the email template evolves.
  3. src/ContentProcessor/src/libs/azure_helper/content_understanding.pyget_image_from_analyze_operation is now clearly documented as JPEG/image-specific (matching its image_id parameter and the image/jpeg Content-Type assertion). Return type is annotated as Optional[bytes], the ValueError/AssertionError it can raise are documented, and the failure branch now logs through the class logger instead of using print().

Related

Resolves review comments on PR #579:

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • No runtime behavior changes for primary workflows; only docs / logging / escaping / CI context improvements.

Deployment Validation

  • validate_bicep_params.py smoke-tested locally (--dir infra produced HTML report written to ..., exit code 0).

Addresses three Copilot reviewer comments on PR #579:

- validate-bicep-params.yml: replace hard-coded GitHub.com run URL with
  GitHub Actions context (server_url/repository/run_id) so the email
  notification links work correctly on GitHub Enterprise Server.
- validate_bicep_params.py: replace the bespoke _html_escape with a thin
  wrapper around stdlib html.escape(text, quote=True) so single quotes
  are also escaped and the escaping rules stay correct as the template
  evolves.
- content_understanding.get_image_from_analyze_operation: tighten the
  docstring/return type to reflect that the helper is intentionally
  JPEG/image-specific (matches the image_id parameter and the
  image/jpeg Content-Type assertion), return Optional[bytes], document
  the ValueError/AssertionError it can raise, and switch the failure
  branch from print() to the class logger.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

Coverage

Coverage Report •
FileStmtsMissCoverMissing
TOTAL121716186% 
report-only-changed-files is enabled. No files were changed during this commit :)

Tests Skipped Failures Errors Time
244 0 💤 0 ❌ 0 🔥 4.659s ⏱️

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 addresses prior Copilot review feedback from PR #579 by improving workflow portability (GitHub.com vs GHES), hardening HTML escaping in CI-generated email content, and clarifying/cleaning up a Content Understanding helper’s contract and logging.

Changes:

  • Update the Bicep param validation workflow to derive the run URL from GitHub Actions context (server/repo/run ID) rather than hard-coding github.com.
  • Replace custom HTML escaping with html.escape(..., quote=True) in the Bicep params validation report generator.
  • Improve documentation and logging behavior for get_image_from_analyze_operation in the Content Understanding helper.

Reviewed changes

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

File Description
.github/workflows/validate-bicep-params.yml Build RUN_URL from Actions context for GHES-compatible email links.
infra/scripts/validate_bicep_params.py Delegate HTML escaping to stdlib html.escape with quote escaping enabled.
src/ContentProcessor/src/libs/azure_helper/content_understanding.py Clarify JPEG-only helper contract and switch failure reporting from print() to structured logging.

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

Comment thread src/ContentProcessor/src/libs/azure_helper/content_understanding.py
Comment thread src/ContentProcessor/src/libs/azure_helper/content_understanding.py
@Prajwal-Microsoft Prajwal-Microsoft merged commit 57774f2 into dev May 20, 2026
14 checks passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.0.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants