Skip to content

Conversation

@VeryEarly
Copy link
Collaborator

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 AI review requested due to automatic review settings May 22, 2025 02:34
@azure-client-tools-bot-prd
Copy link

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

Copy link
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 corrects parameter set handling in the Publish-RMModules function and standardizes tooling versions.

  • Added advanced function binding and a formal param() block to Get-ApiKey
  • Included the $ApiKey parameter in the “ByName” parameter set and guarded against empty values
  • Bumped Node.js versions in multiple Azure pipeline YAMLs from 18.20.7/14.17.1 to 18.20.8

Reviewed Changes

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

File Description
tools/ModulePublisher.psm1 Formalized Get-ApiKey as an advanced function; expanded parameter sets in Publish-RMModules and added empty-value guard for $ApiKey
.azure-pipelines/windows-powershell.yml Updated NodeTool versionSpec entries to 18.20.8
.azure-pipelines/powershell-core.yml Updated NodeTool versionSpec entries to 18.20.8
.azure-pipelines/azure-powershell-ci.yml Updated NodeTool versionSpec entries to 18.20.8

$RepoLocation,

[Parameter(ParameterSetName="ByLocation", Mandatory=$true)]
[Parameter(ParameterSetName="ByName", Mandatory=$false)]
Copy link

Copilot AI May 22, 2025

Choose a reason for hiding this comment

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

[nitpick] Since parameters default to non-mandatory, you can omit Mandatory=$false here to reduce redundancy and clarify that $ApiKey is optional in this set.

Suggested change
[Parameter(ParameterSetName="ByName", Mandatory=$false)]
[Parameter(ParameterSetName="ByName")]

Copilot uses AI. Check for mistakes.
{
$RepoLocation = (Get-RepoLocation -repoName $RepoName)
$ApiKey = (Get-ApiKey -repoName $RepoName)
if ($null -eq $ApiKey -Or "" -eq $ApiKey) {
Copy link

Copilot AI May 22, 2025

Choose a reason for hiding this comment

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

To simplify and standardize null/empty checks, consider using [string]::IsNullOrEmpty($ApiKey) instead of separate comparisons.

Suggested change
if ($null -eq $ApiKey -Or "" -eq $ApiKey) {
if ([string]::IsNullOrEmpty($ApiKey)) {

Copilot uses AI. Check for mistakes.
displayName: Install Autorest
inputs:
versionSpec: '18.20.7'
versionSpec: '18.20.8'
Copy link

Copilot AI May 22, 2025

Choose a reason for hiding this comment

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

[nitpick] These literal version specs are duplicated across multiple pipeline files—extracting the Node.js version into a shared variable or template can reduce drift and simplify future updates.

Suggested change
versionSpec: '18.20.8'
versionSpec: ${{ variables.NodeJsVersion }}

Copilot uses AI. Check for mistakes.
@VeryEarly VeryEarly enabled auto-merge (squash) May 22, 2025 03:18
@VeryEarly VeryEarly merged commit e9d718b into main May 22, 2025
12 checks passed
@VeryEarly VeryEarly deleted the yabo/psgallery-publish branch May 22, 2025 03:27
msJinLei pushed a commit to msJinLei/azure-powershell that referenced this pull request May 23, 2025
msJinLei pushed a commit to msJinLei/azure-powershell that referenced this pull request May 23, 2025
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.

3 participants