Skip to content

Add --stacktrace to help triage CI flakiness - #3604

Merged
BraisGabin merged 1 commit into
detekt:mainfrom
picklebento:stacktrace
Mar 25, 2021
Merged

BraisGabin merged 1 commit into
detekt:mainfrom
picklebento:stacktrace

Conversation

@picklebento

Copy link
Copy Markdown
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

codecov Bot commented Mar 24, 2021

Copy link
Copy Markdown

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.

@BraisGabin BraisGabin left a comment

Copy link
Copy Markdown
Member

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?

@picklebento

Copy link
Copy Markdown
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
Copy Markdown
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

@picklebento

Copy link
Copy Markdown
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"
    }
}

@picklebento

Copy link
Copy Markdown
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
@picklebento picklebento 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