x/exp/apidiff: does not include package path in apidiff messages #61387
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What did you do?
I used
apidiff -m
to compare the APIs of two versions of a module that contains several packages (github.com/hashicorp/vault/sdk as it happens, but this issue is not specific to any one module)What did you expect to see?
Messages clearly identifying what had changed.
What did you see instead?
Each type or function that had changed was listed, but without the package path within the module. It was necessary to see the base name, and then go hunting within the code of the module to figure out which package it was in. When used on a large module containing many packages, this greatly decreases the value of the apidiff report.
Proposal to fix
When apidiff is used in single package mode, it is reasonable for it to continue as before, and just display type base names.
When apidiff is used in module mode, and is displaying diffs for types in the root package of the module (i.e. package-path == module-path), it is also reasonable for it to continue as before.
When apidiff is used in module mode and is displaying diffs for a type in a sub-package within the module, it should display them with a
./relative/path/to/package.
prefix on the type name.example:
When using
apidiff -m
to compare versions ofgithub.com/hashicorp/vault/sdk
, and the fieldDisplayNavigation
has been removed from the structOASPathItem
in packagegithub.com/hashicorp/vault/sdk/framework
, the displayed output should change from:to
I have code to implement this ready to upload once I figure out CLA & Gerrit, but meanwhile would appreciate comments on the idea.
The text was updated successfully, but these errors were encountered: