Skip to content

rpkg: surface status/get summary messages in R console#155

Draft
CGMossa wants to merge 2 commits into
mainfrom
fix/r-pkg-warnings
Draft

rpkg: surface status/get summary messages in R console#155
CGMossa wants to merge 2 commits into
mainfrom
fix/r-pkg-warnings

Conversation

@CGMossa
Copy link
Copy Markdown
Contributor

@CGMossa CGMossa commented Apr 24, 2026

AI-written details

Summary

The dvs CLI prints two informational lines that the R package was silently dropping:

  • println!("No tracked files") / "...matching the filter" from dvs status when the result is empty.
  • println!("Total: N files, X") from dvs get summarizing copied files.

dvs-rpkg/R/dvs-commands.R (+15 lines, only file touched) now mirrors both:

  • dvs_status() emits message("No tracked files") or message("No tracked files matching the filter") depending on whether all three states or a subset is requested.
  • dvs_get() emits message("Total: <N> files, <size>") whenever at least one file was actually copied.

Uses message() (not warning()) so output reaches the console without being treated as a condition: tryCatch / withCallingHandlers warning = handlers don't fire on it, interactive and non-interactive sessions both see it.

Per-file errors are not surfaced via warning() — they're already rows in the returned data frame, which is the contract the rest of dvs_* follows. Deliberate narrowing from an earlier draft that warned per row.

Test plan

  • devtools::test('dvs-rpkg') passes
  • dvs_status() against an empty repo prints No tracked files and returns the empty tibble
  • dvs_status(status = "absent") against an empty filter result prints ...matching the filter
  • dvs_get(...) after at least one copy prints Total: N files, <human-size>

Drafted by Claude (claude-opus-4-7). Reviewed by the author.

@CGMossa
Copy link
Copy Markdown
Contributor Author

CGMossa commented Apr 24, 2026

The implementation of this PR supports adding list(result = , error = )|[all result or all error].

@CGMossa CGMossa marked this pull request as ready for review April 30, 2026 14:27
@CGMossa CGMossa changed the title rpkg: align R console output with CLI warnings and messages rpkg: surface status/get summary messages in R console May 5, 2026
@CGMossa CGMossa force-pushed the fix/r-pkg-warnings branch from c091a59 to ac3f6d5 Compare May 5, 2026 09:25
@CGMossa CGMossa force-pushed the fix/r-pkg-warnings branch from ac3f6d5 to ca276b3 Compare May 16, 2026 09:24
@CGMossa CGMossa marked this pull request as draft May 16, 2026 11:37
CGMossa and others added 2 commits May 17, 2026 11:09
- dvs_add/get/status: warning() for each per-file error (mirrors CLI eprintln!)
- dvs_status: message() when result is empty ("No tracked files" / "...matching the filter")
- dvs_get: message() with total file count and size after successful retrieval

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@CGMossa CGMossa force-pushed the fix/r-pkg-warnings branch from ca276b3 to 0bfda3b Compare May 17, 2026 09: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.

1 participant