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

Add url,checksums and metadata to JSON report. #2791

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

yilinwei
Copy link

@yilinwei yilinwei commented Jun 23, 2023

This adds the url, metadata and checksums to the JSON report produced via fetch.

Note that the checksums are the downloaded ones, not calculated from the artifacts. This is to allow a follow-up PR for #1223.

Fixes part of #1487.

There are a few outstanding issues:

  • The checksum files are not standardized, it's probably worth attempting to just get the valid part of the checksum using parseChecksumRaw
  • Since the metadata files can reference parents (see com.twitter::hpack), it is currently not sufficient to recreate the coursier cache just from the JSON file, since the Artifact returned by the resolution does not contain the parent. Any ideas/pointers to solve this would be appreciated.
  • It's worth adding a flag to set the checksum types to be fetched.

Ideally I'd like to add the metadata files and the associated hashes so I can recreate the coursier cache within a sandbox, which would allow downstream build tools such as sbt or mill to build in a sandboxed environment, but that can be done in a follow up PR.

Adds the `url` and `checksums` field to the JSON report for
resolve. The `checksums` field contains the all the downloaded
checksums for a given artifact.

Co-authored-by: Yilin Wei <yilin@kebab-ca.se>
@yilinwei yilinwei changed the title Add url and checksums to JSON report. Add url,checksums and metadata to JSON report. Jun 23, 2023
@yilinwei yilinwei force-pushed the add-checksum-to-report branch 3 times, most recently from 33e576c to f8f4df7 Compare June 23, 2023 21:36
Add the `metadata` field to the JSON report for the fetch command with the
`file`, `url` and `checksum` fields.
@yilinwei
Copy link
Author

By way of an update, this works quite well apart from the fact that the set of pom's needs to be extended to allow coursier to resolve the dependency properly.

What I mean is:

  • Suppose we have dependencies foo, bar, and baz.
  • foo and bar both depend on baz but different minor versions

then coursier needs the pom for both minor versions but not the jar for the evicted version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants