feat: expose provenance transparency url #6428
Merged
+34
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was able to add support for provenance in
lerna
yesterday (now available in v6.6.2) butlibnpmpublish
currently only emits a log with the transparency log URL, it does not expose it as data for us to use.This is a particularly a problem for lerna, because we often deal with publishing many packages concurrently. These publish requests are kicked off eagerly in parallel, and so it is currently not possible to reconcile the logs to their originating package.
The presence of this URL data would allow me to easily differentiate between packages which were published with provenance and those which weren't, as well as recreate the log on the lerna side.
For now the best I can do via log interception is gather up the unique URLs and print them at the very end:
I have gone for a rather rudimentary "bolt it on the npmFetch response" approach here, but it would definitely get me what I need. Let me know if you want to rename the property or apply it within some other existing structure on the response in some way.
References