Skip to content

{AFD}add default value for content-types-to-compress #28301

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Ptnan7
Copy link
Member

@Ptnan7 Ptnan7 commented Jul 30, 2025

Description

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

@Copilot Copilot AI review requested due to automatic review settings July 30, 2025 05:01
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

Copy link
Contributor

@Copilot 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 adds default values for content-types-to-compress when compression is enabled in the Azure Front Door CDN route creation process. The main purpose is to enhance user experience by automatically providing a comprehensive list of MIME types for compression when users enable compression without specifying content types.

Key changes:

  • Added custom implementation for New-AzFrontDoorCdnRoute with default compression content types
  • Updated configuration to hide the auto-generated route creation command
  • Reset version numbers for the autorest module

Reviewed Changes

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

Show a summary per file
File Description
src/Cdn/Cdn.Autorest/custom/New-AzFrontDoorCdnRoute.ps1 Custom implementation that provides default MIME types when compression is enabled
src/Cdn/Cdn.Autorest/README.md Configuration to hide auto-generated New-AzFrontDoorCdnRoute command
src/Cdn/Cdn.Autorest/Properties/AssemblyInfo.cs Version reset to 0.1.0.0 for both file and assembly versions
src/Cdn/Cdn.Autorest/generate-info.json Removed generation metadata
src/Cdn/Cdn.Autorest/examples/README.md Added examples directory documentation


process {
if (${CompressionSettingIsCompressionEnabled}) {
if ($null -eq ${CompressionSettingContentTypesToCompress}) {
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider using -not ${CompressionSettingContentTypesToCompress} instead of $null -eq ${CompressionSettingContentTypesToCompress} for better PowerShell style and to handle empty arrays correctly.

Suggested change
if ($null -eq ${CompressionSettingContentTypesToCompress}) {
if (-not ${CompressionSettingContentTypesToCompress}) {

Copilot uses AI. Check for mistakes.

)

process {
if (${CompressionSettingIsCompressionEnabled}) {
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider using -eq $true explicitly or using the .IsPresent property for switch parameters to make the condition more explicit: if (${CompressionSettingIsCompressionEnabled}.IsPresent)

Suggested change
if (${CompressionSettingIsCompressionEnabled}) {
if (${CompressionSettingIsCompressionEnabled}.IsPresent) {

Copilot uses AI. Check for mistakes.

@NoriZC NoriZC self-assigned this Jul 30, 2025
@NoriZC
Copy link
Contributor

NoriZC commented Jul 30, 2025

/azp run

Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@Ptnan7
Copy link
Member Author

Ptnan7 commented Aug 3, 2025

@NoriZC Hi, could you retrigger the pipeline for validation?

@YanaXu
Copy link
Contributor

YanaXu commented Aug 4, 2025

/azp run

Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@NoriZC
Copy link
Contributor

NoriZC commented Aug 5, 2025

@Ptnan7 Could you help update the changelog

Copy link

github-actions bot commented Aug 5, 2025

This PR was labeled "needs-revision" because it has unresolved review comments or CI failures.
Please resolve all open review comments and make sure all CI checks are green. Refer to our guide to troubleshoot common CI failures.

@YanaXu
Copy link
Contributor

YanaXu commented Aug 8, 2025

/azp run

Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@Ptnan7
Copy link
Member Author

Ptnan7 commented Aug 13, 2025

@NoriZC Hi, could you review and approve this change?

@NoriZC
Copy link
Contributor

NoriZC commented Aug 13, 2025

/azp run

Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

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.

3 participants