Skip to content

[Pipeline]Fix the issue that test job and checkout code job can't be cancelled#12436

Merged
yejianquan merged 1 commit intosonic-net:masterfrom
yejianquan:jianquanye/test_cancel
Oct 19, 2022
Merged

[Pipeline]Fix the issue that test job and checkout code job can't be cancelled#12436
yejianquan merged 1 commit intosonic-net:masterfrom
yejianquan:jianquanye/test_cancel

Conversation

@yejianquan
Copy link
Contributor

@yejianquan yejianquan commented Oct 18, 2022

Why I did it

Now, checkout code step and KVM test job can't be cancelled even though the whole build is cancelled.
That's because by using Azure Pipeline Conditions, we customized the running condition, and we need to react to the Cancel action explicitly by asserting 'succeeded'
https://learn.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops#succeeded
https://learn.microsoft.com/en-us/azure/devops/pipelines/process/conditions?view=azure-devops&tabs=yaml#ive-got-a-conditional-step-that-runs-even-when-a-job-is-canceled-how-do-i-manage-to-cancel-all-jobs-at-once

How I did it

Assert 'succeeded' condition explicitly.

How to verify it

Verified by cancelling and rerunning the azure pipeline.

Which release branch to backport (provide reason below if selected)

@yejianquan yejianquan requested a review from lguohan as a code owner October 18, 2022 10:06
@yejianquan yejianquan marked this pull request as draft October 18, 2022 10:06
@yejianquan
Copy link
Contributor Author

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yejianquan yejianquan force-pushed the jianquanye/test_cancel branch from f030d26 to ad499a3 Compare October 18, 2022 10:19
@yejianquan
Copy link
Contributor Author

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yejianquan yejianquan force-pushed the jianquanye/test_cancel branch 3 times, most recently from e712255 to ad499a3 Compare October 18, 2022 10:39
@yejianquan yejianquan force-pushed the jianquanye/test_cancel branch from ad499a3 to af93714 Compare October 18, 2022 10:40
@yejianquan yejianquan changed the title [Draft]test cancel behavior [Pipeline]Fix the issue that test job and checkout code job can't be cancelled Oct 18, 2022
@yejianquan yejianquan marked this pull request as ready for review October 18, 2022 10:52
@yejianquan yejianquan requested a review from wangxin October 19, 2022 02:51
@yejianquan yejianquan merged commit 2bf2e02 into sonic-net:master Oct 19, 2022
qiluo-msft pushed a commit that referenced this pull request Oct 19, 2022
co-authorized by: [email protected]

Why I did it
Now, checkout code step and KVM test job can't be cancelled even though the whole build is cancelled.
That's because by using Azure Pipeline Conditions, we customized the running condition, and we need to react to the Cancel action explicitly by asserting 'succeeded'
https://learn.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops#succeeded
https://learn.microsoft.com/en-us/azure/devops/pipelines/process/conditions?view=azure-devops&tabs=yaml#ive-got-a-conditional-step-that-runs-even-when-a-job-is-canceled-how-do-i-manage-to-cancel-all-jobs-at-once

How I did it
Assert 'succeeded' condition explicitly.

How to verify it
Verified by cancelling and rerunning the azure pipeline.
yxieca pushed a commit that referenced this pull request Oct 25, 2022
co-authorized by: [email protected]

Why I did it
Now, checkout code step and KVM test job can't be cancelled even though the whole build is cancelled.
That's because by using Azure Pipeline Conditions, we customized the running condition, and we need to react to the Cancel action explicitly by asserting 'succeeded'
https://learn.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops#succeeded
https://learn.microsoft.com/en-us/azure/devops/pipelines/process/conditions?view=azure-devops&tabs=yaml#ive-got-a-conditional-step-that-runs-even-when-a-job-is-canceled-how-do-i-manage-to-cancel-all-jobs-at-once

How I did it
Assert 'succeeded' condition explicitly.

How to verify it
Verified by cancelling and rerunning the azure pipeline.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants