Closed Xitric closed 6 months ago
Hi @Xitric, no good deed goes unpunished ;). I can reproduce the issue and agree this is not how we want it to behave.
The reason for the un-expected outcome is basically a consequence of how deletion is handled by "re-creating" the file during module processing based on pipeline input to temporarily handle template content processing for deletion. Due to that the file suddenly exists, during that time the module identifies the file as a friend to the main template and thus join the deployment effort.
We will look into compensating factors to overcome this undesired state.
Describe the bug
AzOps version: 2.6.2
Using Azure DevOps pipelines from the AzOps accelerator, given
AllowMultipleTemplateParameterFiles
andDeployAllMultipleTemplateParameterFiles
are enabled, when we merge a pull requests which both 1) modifies a Bicep template and 2) deletes one or more parameter files associated with that Bicep template, then a deployment is performed for each of the deleted parameter files. This is surprising since:If we run the redeploy pipeline against the Bicep template on the same commit that the push pipeline was executed on, only the parameter files that actually exist in the git repository are deployed, as we would expect. The parameter files that were removed in that commit are not deployed.
Steps to reproduce
AllowMultipleTemplateParameterFiles
andDeployAllMultipleTemplateParameterFiles
Screenshots
The diff stage generates the following output:
The deployment stage then outputs:
Both of these deployments are unexpected, since the parameter files were deleted.
Workaround
Use separate pull requests for deleting parameter files and updating Bicep templates. If the pull request only contains deleted parameter files, no effort is made to deploy anything: