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

Better error message on class uniqueness lock file failure #1452

Merged

Conversation

CRogers
Copy link
Contributor

@CRogers CRogers commented Jul 9, 2020

Before this PR

Trying to diagnose a problem with an internal project where circle says that checkClassUniqueness but locally checkClassUniqueness --write-locks does nothing. Very hard to diagnose as it doesn't show the expected difference. Currently looks like:

baseline-class-uniqueness.lock is out of date, please run `./gradlew checkClassUniqueness --write-locks` to update this file

After this PR

==COMMIT_MSG==
When checkClassUniqueness fails, it will show the difference between the actual and expected lock file.
==COMMIT_MSG==

This will make it easier to debug. Now looks like:

baseline-class-uniqueness.lock is out of date, please run `./gradlew checkClassUniqueness --write-locks` to update this file. The diff moving from on disk to what baseline expects is:
  
  --- on disk
  +++ expected
  @@ -1,1 +1,32 @@
  -blah
  +# Danger! Multiple jars contain identically named classes. This may cause different behaviour depending on classpath ordering.
  +# Run ./gradlew checkClassUniqueness --write-locks to update this file
  +
  +## runtimeClasspath
  +[javax.el:javax.el-api, javax.servlet.jsp:jsp-api]
  +  - javax.el.ArrayELResolver
  +  - javax.el.BeanELResolver
  +
  
  On disk was:
  
  blah
  
  Expected was:
  # Danger! Multiple jars contain identically named classes. This may cause different behaviour depending on classpath ordering.
  # Run ./gradlew checkClassUniqueness --write-locks to update this file
  
  ## runtimeClasspath
  [javax.el:javax.el-api, javax.servlet.jsp:jsp-api]
    - javax.el.ArrayELResolver
    - javax.el.BeanELResolver

Possible downsides?

None I can think of.

@changelog-app
Copy link

changelog-app bot commented Jul 9, 2020

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

When checkClassUniqueness fails, it will show the difference between the actual and expected lock file.

Check the box to generate changelog(s)

  • Generate changelog entry

@policy-bot policy-bot bot requested a review from ferozco July 9, 2020 10:25
@bulldozer-bot bulldozer-bot bot merged commit fcf5975 into develop Jul 9, 2020
@bulldozer-bot bulldozer-bot bot deleted the callumr/better-class-uniqueness-error-messages branch July 9, 2020 17:09
@svc-autorelease
Copy link
Collaborator

Released 3.35.0

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.

3 participants