Skip to content

re-implement cache folder detection#11130

Merged
ndeloof merged 5 commits intodocker:mainfrom
ndeloof:cachefile
Nov 2, 2023
Merged

re-implement cache folder detection#11130
ndeloof merged 5 commits intodocker:mainfrom
ndeloof:cachefile

Conversation

@ndeloof
Copy link
Contributor

@ndeloof ndeloof commented Oct 25, 2023

What I did
replace xdg.CacheFile with our own implementation (basically, a copy/paste) so that we detect HOME is not set and don't assume we can use / as a replacement. Unclear to me if this is legitimate from a Posix point of view, but we should offer users a better error message for diagnostic than "can't write /.cache/docker-compose"

Related issue
closes #11126
closes #11137

(not mandatory) A picture of a cute animal, if possible in relation to what you did

@ndeloof ndeloof requested review from glours, milas and thaJeztah October 25, 2023 14:19
@ndeloof ndeloof changed the title align with OCI artifact best practices re-implement cache folder detection Oct 26, 2023
@ndeloof ndeloof force-pushed the cachefile branch 2 times, most recently from 4c290e7 to d6be77e Compare October 26, 2023 14:37
@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Attention: 72 lines in your changes are missing coverage. Please review.

Comparison is base (328ca3f) 57.42% compared to head (98e11b5) 57.11%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11130      +/-   ##
==========================================
- Coverage   57.42%   57.11%   -0.31%     
==========================================
  Files         129      133       +4     
  Lines       11299    11324      +25     
==========================================
- Hits         6488     6468      -20     
- Misses       4182     4230      +48     
+ Partials      629      626       -3     
Files Coverage Δ
cmd/compose/compose.go 72.70% <100.00%> (+1.85%) ⬆️
internal/locker/pidfile.go 0.00% <0.00%> (ø)
pkg/remote/oci.go 5.55% <28.57%> (-6.95%) ⬇️
pkg/remote/cache_unix.go 0.00% <0.00%> (ø)
internal/locker/runtime_unix.go 0.00% <0.00%> (ø)
internal/locker/runtime.go 0.00% <0.00%> (ø)
pkg/remote/cache.go 0.00% <0.00%> (ø)
pkg/remote/git.go 3.20% <6.89%> (-5.61%) ⬇️

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@thaJeztah
Copy link
Member

thaJeztah commented Oct 30, 2023

basically, a copy/paste

If this implementation is copying the original code, we probably must include the copyright information from the original;
https://github.com/adrg/xdg/blob/693ef18888dfbd619bc164da09317f0df8496a1a/LICENSE#L12-L13

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof ndeloof requested review from a team, StefanScherer, laurazard, nicksieger and ulyssessouza and removed request for a team October 31, 2023 07:51
Copy link
Contributor

@glours glours left a comment

Choose a reason for hiding this comment

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

LGTM

@ndeloof ndeloof merged commit d646d75 into docker:main Nov 2, 2023
@ndeloof ndeloof deleted the cachefile branch November 2, 2023 10:16
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.

[BUG] watch does not work in devcontainer (docker-outside-of-docker) [BUG] v2.23.0 breaks if can't create cache for any reason

3 participants