Skip to content

Sync eng/common directory with azure-sdk-tools for PR 16674 - #48536

Merged
azure-sdk-automation[bot] merged 2 commits into
mainfrom
sync-eng-common-weikanglim/pr-job-batch-size-by-pool-16674
Aug 12, 2026
Merged

Sync eng/common directory with azure-sdk-tools for PR 16674#48536
azure-sdk-automation[bot] merged 2 commits into
mainfrom
sync-eng-common-weikanglim/pr-job-batch-size-by-pool-16674

Conversation

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#16674 See eng/common workflow

Copilot AI balanced review requested due to automatic review settings August 11, 2026 18:06
@azure-sdk-automation
azure-sdk-automation Bot requested a review from a team as a code owner August 11, 2026 18:06
@azure-sdk-automation azure-sdk-automation Bot added EngSys This issue is impacting the engineering system. Central-EngSys This issue is owned by the Engineering System team. labels Aug 11, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
9 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.

Adds per-agent-pool overrides for PR job batching when generating the PR matrix, allowing different pools to process different numbers of PackageInfo entries per job.

Changes:

  • Introduced PRJobBatchSizeByPool parameter to specify per-pool PackagesPerPRJob overrides (including runtime macro support).
  • Added PowerShell logic to resolve/validate the effective batch size per pool and pass it into Create-PrJobMatrix.ps1.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread eng/common/pipelines/templates/jobs/generate-job-matrix.yml
Comment thread eng/common/pipelines/templates/jobs/generate-job-matrix.yml

@weikanglim Wei Lim (weikanglim) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The synchronized eng/common change is ready. Required checks are passing and all review threads have been addressed.

Wei Lim (weikanglim) and others added 2 commits August 12, 2026 20:38
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 12, 2026 20:38
@azure-sdk-automation
azure-sdk-automation Bot force-pushed the sync-eng-common-weikanglim/pr-job-batch-size-by-pool-16674 branch from ee3a11b to 78ad766 Compare August 12, 2026 20:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (2)

eng/common/pipelines/templates/jobs/generate-job-matrix.yml:166

  • Casting with [int] will accept some unintended formats (e.g., '1.9' becomes 1, and strings with leading/trailing whitespace may parse). If the intent is to require a strict positive integer, validate with a full numeric regex (e.g., ^[1-9]\\d*$) before converting, and throw if it doesn’t match.
              if (-not [string]::IsNullOrWhiteSpace($overrideValue) -and $overrideValue -notmatch '^\$\(.+\)$') {
                try {
                  $batchSize = [int]$overrideValue
                }
                catch {
                  throw "PR job batch size override for ${{ pool.name }} must be an integer, got '$overrideValue'."
                }

eng/common/pipelines/templates/jobs/generate-job-matrix.yml:159

  • This can be simplified and made easier to follow by directly indexing the property (e.g., reading $overrides.'poolName') instead of enumerating PSObject.Properties and filtering. Direct access avoids extra pipeline steps and makes it clearer what key is being used for the lookup.
            $overrides = '${{ convertToJson(parameters.PRJobBatchSizeByPool) }}' | ConvertFrom-Json
            $poolOverride = $overrides.PSObject.Properties |
              Where-Object { $_.Name -eq '${{ pool.name }}' } |
              Select-Object -First 1

Copilot AI review requested due to automatic review settings August 12, 2026 20:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (4)

eng/common/pipelines/templates/jobs/generate-job-matrix.yml:62

  • The new comments at lines 56–57 and 61–62 are not indented to the same level as the surrounding parameters list items. While YAML parsers typically ignore comment indentation, keeping comments aligned with nearby nodes improves readability and reduces the chance of future indentation mistakes during edits. Consider indenting these comment lines to match the adjacent - name: entries.
# Default number of PackageInfo entries assigned to each PR job.
# Used when a pool-specific override is absent or its runtime variable is unset.
- name: PRJobBatchSize
  type: number
  default: 10
# Optional map of pool names to per-job batch-size overrides.
# Values may be numbers or runtime variables populated by PreGenerationSteps.
- name: PRJobBatchSizeByPool
  type: object
  default: {}

eng/common/pipelines/templates/jobs/generate-job-matrix.yml:153

  • Embedding JSON into a single-quoted PowerShell string can break if the JSON ever contains a single quote character (e.g., a pool key/value containing '), producing invalid PowerShell and failing ConvertFrom-Json. To make this robust, avoid single-quoted embedding and instead use an escaped/here-string approach (or write the JSON to a file and read it) so the JSON is passed to PowerShell without being affected by quoting rules.
            $batchSize = ${{ parameters.PRJobBatchSize }}
            $overrides = '${{ convertToJson(parameters.PRJobBatchSizeByPool) }}' | ConvertFrom-Json

eng/common/pipelines/templates/jobs/generate-job-matrix.yml:152

  • PRJobBatchSize is defined as a YAML number, but -PackagesPerPRJob conceptually requires an integer (and overrides are explicitly validated/cast to [int]). To keep behavior consistent and fail fast, consider applying the same integer validation/cast to the default $batchSize as well (e.g., reject non-integer values rather than allowing a decimal through to Create-PrJobMatrix.ps1).
            $batchSize = ${{ parameters.PRJobBatchSize }}

eng/common/pipelines/templates/jobs/generate-job-matrix.yml:172

  • PRJobBatchSize is defined as a YAML number, but -PackagesPerPRJob conceptually requires an integer (and overrides are explicitly validated/cast to [int]). To keep behavior consistent and fail fast, consider applying the same integer validation/cast to the default $batchSize as well (e.g., reject non-integer values rather than allowing a decimal through to Create-PrJobMatrix.ps1).
            if ($batchSize -le 0) {
              throw "PR job batch size for ${{ pool.name }} must be greater than zero."
            }

@azure-sdk-automation
azure-sdk-automation Bot merged commit e7bc0f7 into main Aug 12, 2026
17 checks passed
@azure-sdk-automation
azure-sdk-automation Bot deleted the sync-eng-common-weikanglim/pr-job-batch-size-by-pool-16674 branch August 12, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Central-EngSys This issue is owned by the Engineering System team. EngSys This issue is impacting the engineering system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants