Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(build-test-tidy): introduce success condition jobs #9769

Merged
merged 15 commits into from
Dec 24, 2024

Conversation

xmfcx
Copy link
Contributor

@xmfcx xmfcx commented Dec 24, 2024

Description

I had initially made this change a part of the previous PR:

But we removed it to allow a simpler structure.

But I think we cannot avoid it due to how we add things to Status checks that are required from rulesets menu.

Problem

Issue is, you add the required "jobs" to this list.

image

You cannot add workflows here, only jobs. And if jobs are within jobs as in reusable workflows, you need to include both names.

For example, for build-and-test-differential job, here is the list of allowed jobs currently available in this repo:
image

Add build-and-test-differential to list

❌ We end up with:
image
image

In a workflow. If we check more closely:
image

It actually needs build-and-test-differential / build-and-test-differential to complete.

Add build-and-test-differential / build-and-test-differential to list

image

It is solved ✅

This was to demonstrate how it works. But now I will share the problem part.

Add build-and-test-differential-cuda / build-and-test-differential

Success

image

It works if it is not skipped ✅

Skipping

❌ We end up with:
image
image

This happened because it was skipped. And sub-workflow did not execute at all.

image

Add build-and-test-differential-cuda to the list

Success

❌ We end up with:
image
image

Because the full job name is not in the list.

Skipping

image

It works if it is skipped ✅

Solution

This means, we cannot rely on skipping counted as success with reusable workflows.

So I'm bringing back these jobs that will run at all times and notify you about the success condition.

Related links

Tested PRs:

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

This reverts commit 054831fff8dfa825ce45a4111fcea88aff5bc287.
@github-actions github-actions bot added the type:ci Continuous Integration (CI) processes and testing. (auto-assigned) label Dec 24, 2024
@xmfcx xmfcx requested a review from mitsudome-r December 24, 2024 12:47
Copy link

github-actions bot commented Dec 24, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@xmfcx xmfcx added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Dec 24, 2024
@xmfcx xmfcx self-assigned this Dec 24, 2024
@xmfcx xmfcx marked this pull request as ready for review December 24, 2024 12:49
@xmfcx xmfcx marked this pull request as draft December 24, 2024 14:16
@xmfcx
Copy link
Contributor Author

xmfcx commented Dec 24, 2024

I'll improve the readability of the results.

Signed-off-by: M. Fatih Cırıt <[email protected]>
Signed-off-by: M. Fatih Cırıt <[email protected]>
Signed-off-by: M. Fatih Cırıt <[email protected]>
@xmfcx xmfcx force-pushed the ci/build-test-tidy-success branch from 6708788 to 0489dca Compare December 24, 2024 14:39
xmfcx and others added 6 commits December 24, 2024 18:05
Signed-off-by: M. Fatih Cırıt <[email protected]>
Signed-off-by: M. Fatih Cırıt <[email protected]>
Signed-off-by: M. Fatih Cırıt <[email protected]>
Signed-off-by: M. Fatih Cırıt <[email protected]>
Signed-off-by: M. Fatih Cırıt <[email protected]>
Signed-off-by: M. Fatih Cırıt <[email protected]>
@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Dec 24, 2024
Copy link

codecov bot commented Dec 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.65%. Comparing base (24bcd0e) to head (eac42cf).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9769      +/-   ##
==========================================
- Coverage   29.65%   29.65%   -0.01%     
==========================================
  Files        1450     1450              
  Lines      108837   108846       +9     
  Branches    42740    42744       +4     
==========================================
  Hits        32279    32279              
- Misses      73387    73396       +9     
  Partials     3171     3171              
Flag Coverage Δ *Carryforward flag
differential 0.00% <ø> (?)
differential-cuda 0.00% <ø> (?) Carriedforward from b6e4711
total 29.65% <ø> (ø) Carriedforward from b6e4711

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: M. Fatih Cırıt <[email protected]>
Signed-off-by: M. Fatih Cırıt <[email protected]>
@github-actions github-actions bot removed the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Dec 24, 2024
@xmfcx xmfcx removed the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Dec 24, 2024
Signed-off-by: M. Fatih Cırıt <[email protected]>
@xmfcx xmfcx added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Dec 24, 2024
@xmfcx xmfcx marked this pull request as ready for review December 24, 2024 16:42
@xmfcx xmfcx enabled auto-merge (squash) December 24, 2024 16:54
Signed-off-by: M. Fatih Cırıt <[email protected]>
@xmfcx xmfcx disabled auto-merge December 24, 2024 17:06
@xmfcx xmfcx merged commit 421ec7d into main Dec 24, 2024
27 of 28 checks passed
@xmfcx xmfcx deleted the ci/build-test-tidy-success branch December 24, 2024 17:07
mitsudome-r added a commit to mitsudome-r/autoware.universe that referenced this pull request Dec 24, 2024
@mitsudome-r
Copy link
Member

mitsudome-r commented Dec 24, 2024

@xmfcx
Thanks for the fix. I was curious so I took a little look at this.

It seems like another workaround is to just pass the if condition to the reusable workflow as an argument, and skip the job inside the reusable workflow. This way, you will always have the result from the sub-workflow, and the required status check won't stop at "expected" even if it is skipped. (I've created a test PR on my fork here mitsudome-r#10 if you want to take a look)

This keeps the workflow code simpler, and developers would have similar user experience to check failed conditions as before. However, it is a bit of hacky way to solve the issue because we have to unnecessarily pass the condition as an argument so I'm okay with your solution as well.

Maybe we can wait for developers' reactions, and if they feel uncomfortable with the current fix, we can consider using this approach.

image
image
image

@xmfcx
Copy link
Contributor Author

xmfcx commented Dec 24, 2024

@mitsudome-r In my opinion, counting skipping as a success condition hides intention and confuses even more. It's better to make things explicit than implicit. For example, cuda workflows are marked as required but they can be skipped and it just passes, this, to me is confusing. But if this build-test-pr is marked as required, we explicitly report our success condition to developers.

Right now, if the workflow fails, they can click on the failed workflow and they will be pointed to where to look.

I've checked your solution and yes, it would solve this problem too. And with much less code.
Still, I feel it hides the success condition by allowing skipped items counted as suceeded implicitly.

If you really want to keep it the old way with the small fix, I understand too, we can apply your solution. 👍

@xmfcx
Copy link
Contributor Author

xmfcx commented Dec 24, 2024

By the way, the reason we have to deal with these complicated success conditions is that we started running CUDA jobs conditionally. Due to this, clang-tidy also branched into 2. It is the most efficient way to use limited compute resources. I think it's unavoidable to have this complicated structure as long as we aim to support CUDA and non-CUDA builds in a large codebase that has large parts that explicitly doesn't require CUDA.

@mitsudome-r
Copy link
Member

mitsudome-r commented Dec 24, 2024

@xmfcx Thanks for your comment.
I agree that GitHub's specification of treating skipped workflow as success condition is confusing.

I just created the PR to the upstream just in case if we want to apply the modification: #9771.
Maybe we can come back and discuss this in the next Software WG call.

kminoda pushed a commit to kminoda/autoware.universe that referenced this pull request Dec 25, 2024
kyoichi-sugahara pushed a commit to kyoichi-sugahara/autoware.universe that referenced this pull request Dec 25, 2024
xmfcx pushed a commit to mitsudome-r/autoware.universe that referenced this pull request Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) type:ci Continuous Integration (CI) processes and testing. (auto-assigned)
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants