Add option to opt-out from pull request completion
Fix https://github.com/Azure/AzOps/issues/741
Introducing a new variable AZOPS_SKIP_PR_COMPLETION ~~AZOPS_COMPLETE_PULL_REQUEST~~ that can be set to true ~~false~~ to opt-out from pull request completion should your workflow require mandatory pull request reviews.
Also converted two more steps to PowerShell following the work done in #120.
Need to test this some more - it's a start for possible feedback. A bit unsure about the behaviour in case things go wrong as handled by > /dev/null 2>&1 in bash.
Need to test this some more - it's a start for possible feedback. A bit unsure about the behaviour in case things go wrong as handled by
> /dev/null 2>&1in bash.
From my initial tests I suppose this output is what would be hidden via the previous redirect but I need to verify this:
The test cases included no variable (default) as well as switching the value between runs and with/without an existing 'automated' branch.
@SimonWahlin did you have the chance to look at this one?
@daltondhcp I did, but I see now that my review is still in pending state :(
I had some comments on using --query on the az commands but that is now solved with ConvertTo-Json which is absolutely fine.
Otherwise I think it looks good, but I have not had the opportunity to do any testing.
We could consider trying to do a stream redirect of the error message from AZ CLI and exit more gracefully if we fail to complete the PR, but it's a bit of an edge case so I would be happy with the "PowerShell exited with code '1'" error message.
I have some very minor adjustments on its way. I've done some basic testing for the default pipeline here but on a daily basis I use a variation of this with the pull pipeline split into two jobs instead of a single one.
Also, as far as I understand this is not needed with GitHub Actions, right?
Finally - here is a sample edge case - could possibly output some info on what to do next, but that might be for the wiki instead

@jsandquist Ping me when you are satisfied and I'll do some tests on my side as well
@SimonWahlin Finally updated it so ready for some tests on your side now hopefully. I refrained from splitting the pull pipeline into two jobs named 'pull' and 'merge' respectively - that might be another Pull Request at some point but complicates the setup somewhat.
Finally sat down and tested this (sorry for the delay).
It still sets the PR to auto-complete and will have no effect unless there is a branch policy requiring for example reviews. Maybe we should consider naming the setting AZOPS_SKIP_PR_POLICYBYPASS, or at least mention that in the comment in vars.yml.
Other than that, it works as expected, setting the variable to true will not bypass branch policy, setting it to anything else than true or not setting it at all will still bypass any policies.
AZOPS_SKIP_PR_POLICYBYPASS
Good proposal. I'll adjust the code.