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

[repo] Always execute build-test step #2054

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

Kielek
Copy link
Contributor

@Kielek Kielek commented Sep 10, 2024

Changes

Always execute build-tests step. It is used to determine if all steps passed.
Before changes there were possibility to merge changes even if previous steps were failing.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • [ ] Unit tests added/updated
  • [ ] Appropriate CHANGELOG.md files updated for non-trivial changes
  • [ ] Changes in public API reviewed (if applicable)

@github-actions github-actions bot added the infra Infra work - CI/CD, code coverage, linters label Sep 10, 2024
Copy link

codecov bot commented Sep 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.47%. Comparing base (71655ce) to head (81e7327).
Report is 426 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2054      +/-   ##
==========================================
- Coverage   73.91%   72.47%   -1.44%     
==========================================
  Files         267      314      +47     
  Lines        9615    11827    +2212     
==========================================
+ Hits         7107     8572    +1465     
- Misses       2508     3255     +747     
Flag Coverage Δ
unittests-Exporter.Geneva 53.26% <ø> (?)
unittests-Exporter.InfluxDB 95.88% <ø> (?)
unittests-Exporter.Instana 71.24% <ø> (?)
unittests-Exporter.OneCollector 94.19% <ø> (?)
unittests-Exporter.Stackdriver 75.73% <ø> (?)
unittests-Extensions 88.57% <ø> (?)
unittests-Extensions.AWS 83.41% <ø> (?)
unittests-Extensions.Enrichment 100.00% <ø> (?)
unittests-Instrumentation.AWS 84.78% <ø> (?)
unittests-Instrumentation.AWSLambda 88.92% <ø> (?)
unittests-Instrumentation.AspNet 76.73% <ø> (?)
unittests-Instrumentation.AspNetCore 85.27% <ø> (?)
unittests-Instrumentation.ElasticsearchClient 79.87% <ø> (?)
unittests-Instrumentation.EntityFrameworkCore 55.49% <ø> (?)
unittests-Instrumentation.EventCounters 76.36% <ø> (?)
unittests-Instrumentation.GrpcNetClient 79.61% <ø> (?)
unittests-Instrumentation.Hangfire 93.58% <ø> (?)
unittests-Instrumentation.Http 82.05% <ø> (?)
unittests-Instrumentation.Owin 85.79% <ø> (?)
unittests-Instrumentation.Process 100.00% <ø> (?)
unittests-Instrumentation.Quartz 78.94% <ø> (?)
unittests-Instrumentation.Runtime 100.00% <ø> (?)
unittests-Instrumentation.SqlClient 90.90% <ø> (?)
unittests-Instrumentation.StackExchangeRedis 67.02% <ø> (?)
unittests-Instrumentation.Wcf 48.91% <ø> (?)
unittests-PersistentStorage 65.78% <ø> (?)
unittests-Resources.AWS 77.93% <ø> (?)
unittests-Resources.Azure 82.35% <ø> (?)
unittests-Resources.Container 72.41% <ø> (?)
unittests-Resources.Gcp 72.54% <ø> (?)
unittests-Resources.Host 73.94% <ø> (?)
unittests-Resources.OperatingSystem 77.20% <ø> (?)
unittests-Resources.Process 100.00% <ø> (?)
unittests-Resources.ProcessRuntime 77.08% <ø> (?)
unittests-Sampler.AWS 87.74% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 341 files with indirect coverage changes

@Kielek Kielek force-pushed the always-execute-build-test branch 6 times, most recently from 3a3426c to e2a31c0 Compare September 10, 2024 06:57
@Kielek Kielek marked this pull request as ready for review September 10, 2024 07:21
@Kielek Kielek requested a review from a team September 10, 2024 07:21
Comment on lines +637 to +641
if: always() && !cancelled()
runs-on: ubuntu-latest
steps:
- run: echo 'build complete ✓'
- run: |
if ( ${{ contains(needs.*.result, 'failure') }} == true ); then echo 'build failed ✗'; exit 1; else echo 'build complete ✓'; fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kielek I'm kind of confused by this 😄 build-test is a required status. If it doesn't run (because something failed), that should block the merge by design. Having it run always seems like it would pass the status check even when there was a failure?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current config for main*:

image

Copy link
Contributor Author

@Kielek Kielek Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current status:
When ${{ contains(needs.*.result, 'failure') is true (one of the required step is failing) build-status step is not executed. It has skipped status. For some reasons in this case, GitHub unblocks Merge button. Eg. #2052 there were possibility to merge traditional way, without forcing it.

After changes:
build-test is always executed, but when ${{ contains(needs.*.result, 'failure') is true it calls exit 1. It means that step is failing. The merge should be not possible. I was testing it, and seems it is working correctly.

I agree that the GitHub behavior is odd.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the plan. Same for auto-instrumentation repo.

Copy link
Member

@CodeBlanch CodeBlanch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Kielek
Copy link
Contributor Author

Kielek commented Sep 12, 2024

Some random fail in this PR. Works as expected:
image

@Kielek Kielek merged commit f3b4c2f into open-telemetry:main Sep 12, 2024
212 checks passed
@Kielek Kielek deleted the always-execute-build-test branch September 12, 2024 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra Infra work - CI/CD, code coverage, linters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants