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

Add --stacktrace to help triage CI flakiness #3604

Merged
merged 1 commit into from
Mar 25, 2021

Conversation

chao2zhang
Copy link
Member

There seem to be a recent spike of CI random failures such as
https://github.com/detekt/detekt/pull/3595/checks?check_run_id=2178012720

I am adding --stacktrace to all gradle commands in CI to yield more debugging information in the CI failure.
(Some gradle commands already come with --stacktrace)
Meanwhile, I am also removing --parallel since we already have it set to true in gradle.properties.

@codecov
Copy link

codecov bot commented Mar 24, 2021

Codecov Report

Merging #3604 (5a0ca8e) into main (c16ecf6) will decrease coverage by 0.00%.
The diff coverage is 85.71%.

❗ Current head 5a0ca8e differs from pull request most recent head 35be194. Consider uploading reports for the commit 35be194 to get more accurate results
Impacted file tree graph

@@             Coverage Diff              @@
##               main    #3604      +/-   ##
============================================
- Coverage     77.53%   77.53%   -0.01%     
- Complexity     2835     2837       +2     
============================================
  Files           464      464              
  Lines          8779     8781       +2     
  Branches       1720     1720              
============================================
+ Hits           6807     6808       +1     
- Misses         1046     1047       +1     
  Partials        926      926              
Impacted Files Coverage Δ Complexity Δ
.../main/kotlin/io/gitlab/arturbosch/detekt/Detekt.kt 0.00% <ø> (ø) 0.00 <0.00> (ø)
...tlab/arturbosch/detekt/DetektCreateBaselineTask.kt 0.00% <ø> (ø) 0.00 <0.00> (ø)
...ab/arturbosch/detekt/extensions/DetektExtension.kt 0.00% <ø> (ø) 0.00 <0.00> (ø)
...otlin/io/gitlab/arturbosch/detekt/core/Analyzer.kt 80.26% <71.42%> (-0.82%) 9.00 <0.00> (ø)
...io/gitlab/arturbosch/detekt/core/rules/RuleSets.kt 100.00% <100.00%> (ø) 0.00 <0.00> (ø)
...bosch/detekt/rules/complexity/MethodOverloading.kt 91.66% <0.00%> (+0.23%) 5.00% <0.00%> (ø%)
...b/arturbosch/detekt/rules/style/UseCheckNotNull.kt 90.90% <0.00%> (+0.90%) 5.00% <0.00%> (+2.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c16ecf6...35be194. Read the comment docs.

Copy link
Member

@BraisGabin BraisGabin left a comment

Choose a reason for hiding this comment

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

Do we need this? Don't we upload all our builds to gradle scan?

@chao2zhang
Copy link
Member Author

I don't think we have build scan enabled in CI. Do you suggest adding --scan for gradle commands in CI?

@BraisGabin
Copy link
Member

I though that we had it by default. But we don't:

detekt/build.gradle.kts

Lines 14 to 17 in 4a89a25

allprojects {
group = "io.gitlab.arturbosch.detekt"
version = Versions.currentOrSnapshot()
}

We just enabled the permission

@chao2zhang
Copy link
Member Author

I think what you are suggesting is https://docs.gradle.com/enterprise/gradle-plugin/#publishing_every_build

gradleEnterprise {
    buildScan {
        publishOnFailure()
    }
}

However, I don't think we should have that block in the main repo - Be careful not to commit agreement to the terms of service into a project that may be built by others. We can conditionally apply the service agreement when running on CI. https://docs.gradle.com/enterprise/gradle-plugin/#connecting_to_scans_gradle_com

gradleEnterprise {
    buildScan {
        termsOfServiceUrl = "https://gradle.com/terms-of-service"
        termsOfServiceAgree = "yes"
    }
}

@chao2zhang
Copy link
Member Author

In short, there is still value by adding --stacktrace itself, because gradle build scans may get purged later.

@BraisGabin BraisGabin merged commit 619aa19 into detekt:main Mar 25, 2021
@chao2zhang chao2zhang added this to the 1.17.0 milestone Mar 27, 2021
@cortinico cortinico added the housekeeping Marker for housekeeping tasks and refactorings label May 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Marker for housekeeping tasks and refactorings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants