-
Notifications
You must be signed in to change notification settings - Fork 457
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
profiler: deprecate PprofDiff #1806
Conversation
The PprofDiff function was added to our public API unintentionally as part of #1511. The function is only meant for internal use. This was missed during code review, likely due to the size of the change and the fact that most of our attention was devoted to making sure the core parts of the change were implemented correctly. This is an exception to our normal v1 compatibility guarantees. It is very unlikely that any of our users depend on this function. It serves no purpose in the context of the profiler's public API, and anybody who might have a reason to use this function would probably have already found a way to do what they want using the github.com/google/pprof/profile package.
I've marked this as a draft, so we don't merge it right away. I personally think this is okay to do. However, we could mark this as deprecated instead, with a note that this was not intended to be part of our API. I know pkg.go.dev understands deprecation warnings, and I think some Go IDEs will also show you if you're using a deprecated function. Then we could remove it in a later release. That could be more cautious than necessary, though. Thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I think I'd slightly prefer the two release cycle deprecation-first removal strategy you mentioned. But if it's a PITA I'm also cool with ripping off this bandaid.
Instead of making it private right away, make it deprecated instead, to be removed in a later release. This should hopefully give users a chance to notice that it's going away and stop using it before it's removed. pkg.go.dev won't show it, and some IDEs and linters will flag use of deprecated functions.
Not a PITA at all :) I think it's reasonable to deprecate it first. I've changed the PR to do so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
What does this PR do?
Deprecates the PprofDiff function. It will be removed in v1.50.0.
Motivation
The PprofDiff function was added to our public API unintentionally as
part of #1511. The function is only meant for internal use. This was
missed during code review, likely due to the size of the change and the
fact that most of our attention was devoted to making sure the core
parts of the change were implemented correctly.
This is an exception to our normal v1 compatibility guarantees. It is
very unlikely that any of our users depend on this function. It serves
no purpose in the context of the profiler's public API, and anybody who
might have a reason to use this function would probably have already
found a way to do what they want using the
github.com/google/pprof/profile package.
Describe how to test/QA your changes
N/A
Reviewer's Checklist
Triage
milestone is set.