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

gc --not-in-remote: misleading warning message #10590

Closed
DGrady opened this issue Oct 17, 2024 · 4 comments · Fixed by #10592
Closed

gc --not-in-remote: misleading warning message #10590

DGrady opened this issue Oct 17, 2024 · 4 comments · Fixed by #10592
Labels
A: gc Related go garbage collection bug Did we break something? good first issue p2-medium Medium priority, should be done, but less important

Comments

@DGrady
Copy link

DGrady commented Oct 17, 2024

Bug Report

Description

The warning message printed when using the --not-in-remote flag appears to be incorrect. The behavior of the flag appears correct (consistent with the documentation); the warning message is not consistent with behavior or documentation.

Reproduce

dvc gc --workspace --not-in-remote

Prints the following warning:

WARNING: This will remove all cache except items used in the workspace that are present in the DVC remote of the current repo.
Are you sure you want to proceed? [y/n]: 

The actual behavior for this command is to keep only the local cache items that are: a) referenced in the current workspace, and b) not present in the remote.

Expected

The warning message should read, perhaps,

WARNING: This will remove all cache except items used in the workspace that are not present in the DVC remote of the current repo.
Are you sure you want to proceed? [y/n]: 

(That is, just adding the word "not".)

Environment information

Output of dvc doctor:

$ dvc doctor
DVC version: 3.55.2 (pip)
-------------------------
Platform: Python 3.12.7 on macOS-15.0.1-x86_64-i386-64bit
Subprojects:
	dvc_data = 3.16.6
	dvc_objects = 5.1.0
	dvc_render = 1.0.2
	dvc_task = 0.40.2
	scmrepo = 3.3.8
Supports:
	http (aiohttp = 3.10.10, aiohttp-retry = 2.8.3),
	https (aiohttp = 3.10.10, aiohttp-retry = 2.8.3),
	s3 (s3fs = 2024.9.0, boto3 = 1.35.36)
Config:
	Global: /Users/dan/Library/Application Support/dvc
	System: /Library/Application Support/dvc
Cache types: reflink, hardlink, symlink
Cache directory: apfs on /dev/disk1s1s1
Caches: local
Remotes: s3
Workspace directory: apfs on /dev/disk1s1s1
Repo: dvc, git
Repo.site_cache_dir: /Library/Caches/dvc/repo/a60ba71a9b85f3c8d2c283884465924b
@shcheklein
Copy link
Member

Good catch. It is consistent with this description I think:

https://dvc.org/doc/command-reference/gc#--not-in-remote

Please feel free to send a PR to fix this. It should be pretty straightforward hopefully.

@shcheklein shcheklein added good first issue bug Did we break something? p2-medium Medium priority, should be done, but less important A: gc Related go garbage collection labels Oct 17, 2024
@5AIPAVAN
Copy link
Contributor

as a beginner can i work on this please @shcheklein @DGrady :-)

@shcheklein
Copy link
Member

@5AIPAVAN yes, absolutely, feel free to take it!

@DGrady
Copy link
Author

DGrady commented Oct 18, 2024

@5AIPAVAN that would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: gc Related go garbage collection bug Did we break something? good first issue p2-medium Medium priority, should be done, but less important
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants