Validate pipeline fails for PR with custom sorting
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- powershell
- Domain
- ci-cd
Research direction
Start with .scripts/customSorting.ps1 at lines 26-28 and trace how a diff containing only a .order file is handled by the CustomSorting step. Reproduce with AZOPS_CUSTOM_SORT_ORDER=true and an order-only pull request, then run the Validate pipeline. Done means the diff passed to Invoke-AzOpsPush is usable and validation no longer fails.
Written by the indexing model from the issue text.
Description
Describe the bug
In an AzOps repository, with the configuration AZOPS_CUSTOM_SORT_ORDER=true, i.e. custom sorting is enabled.
The Validate pipeline fails for pull-requests where the change set only consists of modifications to a .order file.
This happens because the CustomSorting step of the pipeline modifies the /tmp/diff.txt file to be empty, when there is only a change to the .order file.
Relevant script: https://github.com/Azure/AzOps-Accelerator/blob/main/.scripts/customSorting.ps1#L26C1-L28C6
Steps to reproduce
- Create an AzOps Accelerator repository, to track Azure resources at any level
- Enable custom sorting, by setting environment variable
AZOPS_CUSTOM_SORT_ORDER=true - Create a PR, modifying only a
.orderfile, at any tracked level in the AzOps repository - Execute the Validate pipeline for the PR
Pipeline outputs:
CustomSorting pipeline step:
Files found in diff:
M root/my management group (00000000-0000-0000-0000-000000000000)/my subscription (00000000-0000-0000-0000-000000000000)/.order
Sorted files:
Validate pipeline step error:
Cannot bind argument to parameter 'ChangeSet' because it is null.
At /__w/_temp/52355258-7ba8-4086-8efb-8bdca5da3788.ps1:15 char:31
+ Invoke-AzOpsPush -ChangeSet $diff -WhatIf:$RunWhatIf -CustomSortOrd …
+ ~~~~~
##[error]PowerShell exited with code '1'.
- Dominant language
- PowerShell
- Stars
- 420
- Forks
- 174
- Avg merge
- 16d 18h
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/AzOps
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
Difficulty 4/5 3-5 days Newbie friendliness 28/100
-
triage
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
repo:raw-data
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
hotosm/raw-data-api#316 · 1 comment ·
-
agentic-workflows cascade-suspected
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
willow
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
openedx/openedx-authz#460 ·