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

Create summary of cached content #13386

Merged
merged 6 commits into from
Mar 9, 2023

Conversation

AbrilRBS
Copy link
Member

@AbrilRBS AbrilRBS commented Mar 8, 2023

Changelog: Feature: Create summary of cached content.
Docs: Omit

Co-Authored-By: @memsharded

Initial work towards the sources backup feature, this PR aims to implement a simple "summary.json" for sources downloaded by a conanfile, which stores info about which reference downloaded which URL, relying in the sha256 checksum as the key.

It also changes the cache layout a bit by moving the mentioned downloaded files by the conanfile to their own s/ subfolder, and the rest to c/

Omitted docs because it only makes sense to document this once the whole feature lands

@AbrilRBS AbrilRBS requested a review from memsharded March 8, 2023 16:56
@memsharded memsharded added this to the 2.0.2 milestone Mar 8, 2023
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Not sure what would be the best flow, if we should merge, or we should target "develop2" for 2.1, or how to approach it. Ideally, this part of the cache could start to be used asap I guess

conans/client/downloaders/caching_file_downloader.py Outdated Show resolved Hide resolved
h = sha256
sources_cache = True
else:
ConanOutput()\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for ourselves: we need modes of behavior for the caching, like being able to raise if the thing is not cached, to raise if it cannot be cached because of no sha256, etc. For future work.

Copy link
Member Author

@AbrilRBS AbrilRBS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to always use "unknown" as an origin if the ref is None, and added a test path for when the ref is actually there, but have a question about the usage of the --format=json output

conans/test/integration/cache/download_cache_test.py Outdated Show resolved Hide resolved
@memsharded memsharded merged commit 657472b into conan-io:release/2.0 Mar 9, 2023
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.

2 participants