Sync eng/common directory with azure-sdk-tools for PR 16621 - #50033
Open
azure-sdk-automation[bot] wants to merge 2 commits into
Open
Sync eng/common directory with azure-sdk-tools for PR 16621#50033azure-sdk-automation[bot] wants to merge 2 commits into
azure-sdk-automation[bot] wants to merge 2 commits into
Conversation
Split-Items computed the number of oversized groups as $itemCount % $itemsPerGroup instead of $itemCount % $JobCount. Since $itemsPerGroup is the group size and not the group count, the remainder is taken over the wrong quantity, and whenever $itemCount % $itemsPerGroup -lt $itemCount % $JobCount too few groups are widened. The generated groups then hold fewer items than were passed in, and the trailing items are silently omitted from the matrix. Nothing fails, so those packages simply never get regenerated. The azure-sdk-for-net mgmt regeneration pipeline hits this: 230 packages across 18 jobs produces groups summing to 218, dropping the last 12 packages including Azure.ResourceManager.AppService. This is visible in the emitted job keys, where the final key is se_st_17 (ending at "storagediscovery") rather than st_wo_17. The bug was easy to miss because the worked example in the comment above the function, 22 items into 5 jobs, happens to give the same answer under both formulas: 22 % 4 and 22 % 5 are both 2. Verified over all item counts 1..300 against job counts 1..30 (9000 combinations): before the fix 408 combinations lost items, after it none do, every input item appears exactly once, and group sizes still differ by at most one. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Both parameters are used as divisors when splitting items, so passing 0 or a negative value failed with "Attempted to divide by zero" or "Arithmetic operation resulted in an overflow" from inside Split-Items rather than with a message naming the bad parameter. Use ValidateRange so the failure happens at parameter binding, matching the declarative validation attributes already used across these scripts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
azure-sdk-automation
Bot
requested review from
Wei Hu (live1206)
and
a lite review from Copilot
August 5, 2026 03:33
Contributor
There was a problem hiding this comment.
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.
This PR improves the matrix regeneration script by preventing invalid parameter values and correcting the job-splitting remainder calculation to avoid dropping items.
Changes:
- Added parameter validation to reject zero/negative values for
$JobCountand$MinimumPerJob. - Fixed remainder calculation when splitting items across jobs to prevent silently dropped trailing items.
- Added inline comments explaining the failure mode and the corrected logic.
|
Azure Pipelines: Successfully started running 1 pipeline(s). 34 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#16621 See eng/common workflow