Include timestamp and author for approved packagerevisions in the API #3481
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.
This PR exposes the time and author for published packagerevisions. They are exposed as the new fields
publishedBy
andpublishedAs
on the status object of the packagerevision resource.For published packages on a git tag, we fetch the author and timestamp from the latest commit on the tag. For packages on the main branch, we can't assume that the last commit is related to the package in question, so we scan through the git commit log to find the latest commit for the specific package, by looking for the gitAnnotations. If we can't find any annotations for the package, we just leave the fields empty.
This still needs a few more tests, but wanted feedback on the API changes.