-
Notifications
You must be signed in to change notification settings - Fork 4k
{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
base: main
Are you sure you want to change the base?
Conversation
Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
There was a problem hiding this 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}) { |
There was a problem hiding this comment.
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.
if ($null -eq ${CompressionSettingContentTypesToCompress}) { | |
if (-not ${CompressionSettingContentTypesToCompress}) { |
Copilot uses AI. Check for mistakes.
) | ||
|
||
process { | ||
if (${CompressionSettingIsCompressionEnabled}) { |
There was a problem hiding this comment.
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)
if (${CompressionSettingIsCompressionEnabled}) { | |
if (${CompressionSettingIsCompressionEnabled}.IsPresent) { |
Copilot uses AI. Check for mistakes.
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
@NoriZC Hi, could you retrigger the pipeline for validation? |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
This PR was labeled "needs-revision" because it has unresolved review comments or CI failures. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
@NoriZC Hi, could you review and approve this change? |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Description
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.md
and reviewed the following information:ChangeLog.md
file(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
.## Upcoming Release
header in the past tense.ChangeLog.md
if no new release is required, such as fixing test case only.