gitlab-plugin icon indicating copy to clipboard operation
gitlab-plugin copied to clipboard

Prepare GitLab for core Guava upgrade

Open basil opened this issue 2 years ago • 0 comments

See JENKINS-65988. Jenkins core is using Guava 11.0.1, which was released on January 9, 2012. Jenkins core would like to upgrade to Guava 30.1.1, which was released on March 19, 2021. Plugins must be prepared to be compatible with both Guava 11.0.1 and Guava 30.1.1 in advance of this core transition.

In particular, this plugin has been identified as using the com.google.common.cache.Cache#get(K key) API, which has been removed between Guava 11.0.1 and latest. The removal took place in Guava 12.0.

To facilitate the Jenkins core transition, this plugin must be prepared and released such that it works with both Guava 11.0.1 and latest. The recommendation is for plugins to migrate from Guava's cache to Caffeine via the Jenkins Caffeine API plugin.

For the most part, the migration is a trivial matter of replacing imports of com.google.common.cache.Cache with imports of com.github.benmanes.caffeine.cache.Cache and imports of com.google.common.cache.CacheBuilder with imports of com.github.benmanes.caffeine.cache.Caffeine. For examples of how to do this, see these existing PRs:

  • jenkinsci/active-directory-plugin#109
  • jenkinsci/azure-ad-plugin#125
  • jenkinsci/configuration-as-code-plugin#1596
  • jenkinsci/kubernetes-plugin#991
  • jenkinsci/lockable-resources-plugin#242
  • jenkinsci/role-strategy-plugin#150

basil avatar Aug 07 '21 16:08 basil