'Re-run of previously succeeded stages

I'm trying to figure out whether it's possible to re-run a previously succeeded stage without clearing all other dependent stages, which depends on the stage that I re-run.

Ex

A pipeline consist of three stages: QA, Staging, Prod.

All three stages have succeeded. Now, I want to redeploy QA, but then Staging and Prod is shown as they haven't been deployed.

https://developercommunity.visualstudio.com/t/rerun-earlier-stage-causes-later-stages-to-appear/1085693

There's a post on this. The supporter claims it's "by-design". Just wondering whether anyone have made effort circumventing this behaviour?

I've tried adding a if else statement around the dependsOn block to add an empty array, in case the previous step have succeeded and have been executed more than once - ge(System.StageAttempts, 1), but without success.

Thanks in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source