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

Upgrade Error Prone 2.18.0 -> 2.19.1 #621

Merged
merged 7 commits into from
May 14, 2023

Conversation

Picnic-Bot
Copy link
Contributor

This PR contains the following updates:

Package Type Update Change
com.google.errorprone:error_prone_annotations (source) compile minor 2.18.0 -> 2.19.0
com.google.errorprone:error_prone_core (source) minor 2.18.0 -> 2.19.0
com.google.errorprone:error_prone_test_helpers (source) compile minor 2.18.0 -> 2.19.0
com.google.errorprone:error_prone_core (source) compile minor 2.18.0 -> 2.19.0
com.google.errorprone:error_prone_check_api (source) compile minor 2.18.0 -> 2.19.0
com.google.errorprone:error_prone_annotation (source) compile minor 2.18.0 -> 2.19.0

Release Notes

google/error-prone

v2.19.0: Error Prone 2.19.0

Compare Source

New Checkers:

Fixes issues: #​956, #​3504, #​3654, #​3703, #​3731, #​3737, #​3760, #​3779, #​3796, #​3809, #​3813

Full Changelog: google/error-prone@v2.18.0...v2.19.0


  • If you want to rebase/retry this PR, check this box

@Picnic-Bot
Copy link
Contributor Author

Picnic-Bot commented May 10, 2023

Suggested commit message:

Upgrade Error Prone 2.18.0 -> 2.19.1 (#621)

Resolves #622.

See:
- https://github.com/google/error-prone/releases/tag/v2.19.0
- https://github.com/google/error-prone/releases/tag/v2.19.1
- https://github.com/google/error-prone/compare/v2.18.0...v2.19.1
- https://github.com/PicnicSupermarket/error-prone/compare/v2.18.0-picnic-1...v2.19.1-picnic-1

Copy link
Member

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

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

I'll have a look at updating the fork. Locally I fixed the compilation issues, though there are some test failures to look into. Lastly, we should also drop StringCaseLocaleUsage.

@rickie
Copy link
Member

rickie commented May 10, 2023

Lastly, we should also drop StringCaseLocaleUsage.

I'll create a PR for that :).

@Stephan202
Copy link
Member

I'll create a PR for that :).

Doesn't it belong in this PR? 🤔

@rickie
Copy link
Member

rickie commented May 10, 2023

Lol, for some reason I thought I clicked the PSM PR, but yes we should haha.

Copy link
Member

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

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

Added one more commit. I created a new release of the fork, and the build now passes with -DskipTests on JDK 17. There are still test issues, which I'll look into next.

Comment on lines -31 to -34
// XXX: Also flag `String::toLowerCase` and `String::toUpperCase` method references. For these cases
// the suggested fix should introduce a lambda expression with a parameter of which the name does
// not coincide with the name of an existing variable name. Such functionality should likely be
// introduced in a utility class.
Copy link
Member

Choose a reason for hiding this comment

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

I added an entry to my local list; ideally we do still pick this up.

@github-actions
Copy link

  • Surviving mutants in this change: 1
  • Killed mutants in this change: 1
class surviving killed
🧟tech.picnic.errorprone.refaster.AnnotatedCompositeCodeTransformer 1 0
🎉tech.picnic.errorprone.refaster.runner.Refaster 0 1

Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

Copy link
Member

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

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

Added a commit. The build and tests now pass on JDK 17 and 20, but the JDK 11 is broken due to google/error-prone#3895.

@github-actions
Copy link

  • Surviving mutants in this change: 1
  • Killed mutants in this change: 1
class surviving killed
🧟tech.picnic.errorprone.refaster.AnnotatedCompositeCodeTransformer 1 0
🎉tech.picnic.errorprone.refaster.runner.Refaster 0 1

Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

1 similar comment
@github-actions
Copy link

  • Surviving mutants in this change: 1
  • Killed mutants in this change: 1
class surviving killed
🧟tech.picnic.errorprone.refaster.AnnotatedCompositeCodeTransformer 1 0
🎉tech.picnic.errorprone.refaster.runner.Refaster 0 1

Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

Copy link
Member

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

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

Added a commit to fix the JDK 11 build. But given that these changes will break Refaster template compatibility with Error Prone 2.18.0 (due to serialization format changes), while users may not upgrade to Error Prone 2.19.0 due to google/error-prone#3895, I'm somewhat torn about the speed with which we should merge this PR 🤔

Comment on lines 28 to 32
@AfterTemplate
@CanIgnoreReturnValue
BugCheckerRefactoringTestHelper after(BugCheckerRefactoringTestHelper helper) {
return helper;
}
Copy link
Member

Choose a reason for hiding this comment

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

It might be nice to open a PR upstream to skip suggesting @CanIgnoreReturnValue on @AfterTemplate. After all, such methods are not really meant to be invoked.

Copy link
Member

Choose a reason for hiding this comment

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

I'm totally up for that, will create it tomorrow morning 🦺.

Copy link
Member

Choose a reason for hiding this comment

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

Consider first checking the internal upgrade PR; as I mention there, there are a bunch of other (non-Refaster) cases in which adding @CanIgnoreReturnValue also doesn't really make sense.

getDescription(delegate))
.overrideSeverity(overrideSeverity(getSeverity(delegate), context))
Copy link
Member

Choose a reason for hiding this comment

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

PItest warns about this call not being covered, but that's because the tests are in another module. If I drop this line then RefasterTest does fail.

@Stephan202 Stephan202 changed the title Upgrade version.error-prone-orig 2.18.0 -> 2.19.0 Upgrade version.error-prone-orig 2.18.0 -> 2.19.1 May 10, 2023
@Stephan202 Stephan202 added this to the 0.11.0 milestone May 10, 2023
Copy link
Member

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

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

Added a commit to upgrade to Error Prone 2.19.1, which comes with a fix for google/error-prone#3895.

One thing we should perhaps do (in a separate PR) is document that Error Prone Support's Refaster rules are only compatible with the version of Error Prone against which they're compiled. Ideally we document that version on the website. 🤔

@github-actions
Copy link

  • Surviving mutants in this change: 1
  • Killed mutants in this change: 1
class surviving killed
🧟tech.picnic.errorprone.refaster.AnnotatedCompositeCodeTransformer 1 0
🎉tech.picnic.errorprone.refaster.runner.Refaster 0 1

Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@Picnic-Bot
Copy link
Contributor Author

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

Warning: custom changes will be lost.

@rickie rickie force-pushed the renovate/version.error-prone-orig branch from 3d79983 to 0c7dbca Compare May 12, 2023 07:33
@github-actions
Copy link

  • Surviving mutants in this change: 1
  • Killed mutants in this change: 1
class surviving killed
🧟tech.picnic.errorprone.refaster.AnnotatedCompositeCodeTransformer 1 0
🎉tech.picnic.errorprone.refaster.runner.Refaster 0 1

Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

Copy link
Member

@rickie rickie left a comment

Choose a reason for hiding this comment

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

Nice changes! Besides the introduced CanIgnoreReturnValue it LGTM. Have code working for excluding Refaster rules but will definitely first check the internal PR.

@rickie
Copy link
Member

rickie commented May 12, 2023

Should we add one of the keywords like Closes or Fixes #622 to the commit message?

@rickie
Copy link
Member

rickie commented May 13, 2023

Filed: PicnicSupermarket/error-prone#60.

Do we add XXX references when I open the PR upstream and merge then? WDYT?

@rickie rickie force-pushed the renovate/version.error-prone-orig branch from 0c7dbca to 8e97904 Compare May 13, 2023 15:46
@github-actions
Copy link

  • Surviving mutants in this change: 1
  • Killed mutants in this change: 1
class surviving killed
🧟tech.picnic.errorprone.refaster.AnnotatedCompositeCodeTransformer 1 0
🎉tech.picnic.errorprone.refaster.runner.Refaster 0 1

Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@Stephan202 Stephan202 force-pushed the renovate/version.error-prone-orig branch from 8e97904 to 78264c3 Compare May 14, 2023 14:49
@Stephan202
Copy link
Member

Rebased. Will merge once built. Decided to leave the @CanIgnoreReturnValue as-is, in favour of a @Suppresswarning. We should not forget to drop them if/when an upstream PR to skip Refaster template methods is merged and released.

@github-actions
Copy link

  • Surviving mutants in this change: 1
  • Killed mutants in this change: 1
class surviving killed
🧟tech.picnic.errorprone.refaster.AnnotatedCompositeCodeTransformer 1 0
🎉tech.picnic.errorprone.refaster.runner.Refaster 0 1

Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@Stephan202 Stephan202 merged commit 08e55fd into master May 14, 2023
@Stephan202 Stephan202 deleted the renovate/version.error-prone-orig branch May 14, 2023 15:01
@Stephan202 Stephan202 changed the title Upgrade version.error-prone-orig 2.18.0 -> 2.19.1 Upgrade Error Prone 2.18.0 -> 2.19.1 May 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants