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

Deprecate CaffeineCacheStats.registerCache #2003

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

Conversation

ash211
Copy link
Contributor

@ash211 ash211 commented Aug 29, 2024

Before this PR

We added an improved mechanism for registering stats on a cache in #1897, with a few FLUPs (linked at the bottom of that PR). The new method is also documented in the tritium README here.

However, existing code is still using the old mechanism, and callers who forgot to call .recordStats() are still being found (we noticed several this week).

After this PR

==COMMIT_MSG==
Deprecate CaffeineCacheStats.registerCache
==COMMIT_MSG==

By marking this method as deprecated, we nudge developers who see these warnings in their IDE towards the preferred pattern.

Possible downsides?

Repos that have opted into making deprecations fail builds and are using these now-deprecated methods won't be able to take the upgrade automatically. However, this something those repos have opted into and should expect as a result of that choice.

@changelog-app
Copy link

changelog-app bot commented Aug 29, 2024

Generate changelog in changelog/@unreleased

What do the change types mean?
  • feature: A new feature of the service.
  • improvement: An incremental improvement in the functionality or operation of the service.
  • fix: Remedies the incorrect behaviour of a component of the service in a backwards-compatible way.
  • break: Has the potential to break consumers of this service's API, inclusive of both Palantir services
    and external consumers of the service's API (e.g. customer-written software or integrations).
  • deprecation: Advertises the intention to remove service functionality without any change to the
    operation of the service itself.
  • manualTask: Requires the possibility of manual intervention (running a script, eyeballing configuration,
    performing database surgery, ...) at the time of upgrade for it to succeed.
  • migration: A fully automatic upgrade migration task with no engineer input required.

Note: only one type should be chosen.

How are new versions calculated?
  • ❗The break and manual task changelog types will result in a major release!
  • 🐛 The fix changelog type will result in a minor release in most cases, and a patch release version for patch branches. This behaviour is configurable in autorelease.
  • ✨ All others will result in a minor version release.

Type

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

Description

Deprecate CaffeineCacheStats.registerCache

Check the box to generate changelog(s)

  • Generate changelog entry

@ash211 ash211 marked this pull request as ready for review August 29, 2024 05:34
@ash211 ash211 requested a review from schlosna August 29, 2024 05:34
@carterkozak
Copy link
Contributor

How widely is this API still used? How many of those repos compile with -Werror? We should take deprecation seriously -- unless humans are keeping a close eye on upgrade PRs, this will prevent those projects from taking almost all first party library upgrades until humans intervene!

@ash211
Copy link
Contributor Author

ash211 commented Aug 29, 2024

How widely is this API still used? How many of those repos compile with -Werror? We should take deprecation seriously -- unless humans are keeping a close eye on upgrade PRs, this will prevent those projects from taking almost all first party library upgrades until humans intervene!

I discussed this in the PR description:

Repos that have opted into making deprecations fail builds and are using these now-deprecated methods won't be able to take the upgrade automatically. However, this something those repos have opted into and should expect as a result of that choice.

I count 575 callsites internally: https://pl.ntr/2ok. This deprecation would only affect repos that have -Werror AND -Xlint:deprecation enabled. The first is enabled in the new default for highline-created repos now, as of March: 0682272. But the second is not, and is less widely deployed (140+ internal repos).

Personally I think -Xlint:deprecation causes more problems than it's worth, and it's not enabled on most repos I regularly work with. There needs to be a way to noticeably signal that something is going away, WITHOUT requiring that it happen immediately. @Deprecation annotation is that, unless -Xlint:deprecation is turned on. A Javadoc @deprecated isn't loud enough in IDEs.

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.

4 participants