Conversation
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.gitignore (1)
22-34: Consider separating infrastructure changes from the verbose fix.The ignore patterns for Compound GPID artifacts are correctly formatted and clearly documented. However, these infrastructure changes appear unrelated to the PR's stated objective of fixing verbose behavior in
st_init.While the changes themselves are fine, mixing tooling/infrastructure updates with functional code changes can make PR history less clear and complicate future rollbacks if needed.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.gitignore around lines 22 - 34, This PR mixes .gitignore entries for Compound GPID artifacts (entries like .github/prompts/, .github/skills/, .github/agents/, .github/instructions/, .github/copilot-instructions.md, compound-gpid.local.md, and .cg-docs/) with a functional change to st_init; split those infrastructure/tooling ignore updates into their own commit or separate PR so the st_init fix remains focused and reviewable, or alternatively revert the .gitignore additions from this branch and reintroduce them in an isolated change.tests/testthat/test-save-load.R (1)
1-34: Comprehensive test coverage forverboseflag behavior.The test thoroughly covers:
verbose = TRUEemitting messagesverbose = FALSEbeing silent- Rebasing scenarios
- Duplicate-alias warnings
- Input validation for invalid values
However, there's a potential test isolation issue: the test modifies the "default" alias multiple times (td1→td2→td3→td4), which updates both
.stamp_aliasesand.stamp_state(viast_state_set()inst_init()). Thewithr::deferon line 23 only cleans up.stamp_aliasesfor the named aliases (dup_a,dup_b,dup_c), but doesn't restore.stamp_stateto its original value after the "default" alias rebasing operations.This may not cause issues in practice since
withr::local_tempdir()cleans up the filesystem and subsequent tests likely callst_init()themselves, but for robustness you could consider also cleaning up.stamp_stateor the "default" alias from.stamp_aliases.🔧 Optional: Add cleanup for default alias state
test_that("st_init respects verbose flag", { + # Capture initial state for cleanup + old_default <- rlang::env_get(stamp:::.stamp_aliases, "default", default = NULL) + old_root <- rlang::env_get(stamp:::.stamp_state, "root_dir", default = NULL) + withr::defer({ + if (!is.null(old_default)) { + rlang::env_poke(stamp:::.stamp_aliases, "default", old_default) + } else { + rlang::env_unbind(stamp:::.stamp_aliases, "default", inherit = FALSE) + } + if (!is.null(old_root)) { + rlang::env_poke(stamp:::.stamp_state, "root_dir", old_root) + } + }) + td1 <- withr::local_tempdir() td2 <- withr::local_tempdir()🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/testthat/test-save-load.R` around lines 1 - 34, The test mutates the global .stamp_aliases and .stamp_state via st_init (which calls st_state_set), so add cleanup to restore state after the test: after creating temp dirs and before exiting, capture the original value of stamp:::.stamp_state and/or remove/reset the "default" entry from stamp:::.stamp_aliases, then use withr::defer to restore stamp:::.stamp_state and unbind the "default" alias from stamp:::.stamp_aliases; reference st_init, st_state_set, stamp:::.stamp_state and stamp:::.stamp_aliases to locate where to add the capture and withr::defer restore/unbind calls.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.gitignore:
- Around line 22-34: This PR mixes .gitignore entries for Compound GPID
artifacts (entries like .github/prompts/, .github/skills/, .github/agents/,
.github/instructions/, .github/copilot-instructions.md, compound-gpid.local.md,
and .cg-docs/) with a functional change to st_init; split those
infrastructure/tooling ignore updates into their own commit or separate PR so
the st_init fix remains focused and reviewable, or alternatively revert the
.gitignore additions from this branch and reintroduce them in an isolated
change.
In `@tests/testthat/test-save-load.R`:
- Around line 1-34: The test mutates the global .stamp_aliases and .stamp_state
via st_init (which calls st_state_set), so add cleanup to restore state after
the test: after creating temp dirs and before exiting, capture the original
value of stamp:::.stamp_state and/or remove/reset the "default" entry from
stamp:::.stamp_aliases, then use withr::defer to restore stamp:::.stamp_state
and unbind the "default" alias from stamp:::.stamp_aliases; reference st_init,
st_state_set, stamp:::.stamp_state and stamp:::.stamp_aliases to locate where to
add the capture and withr::defer restore/unbind calls.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0e10122f-a230-4cb3-90cc-117586e0df4b
📒 Files selected for processing (5)
.Rbuildignore.gitignoreR/IO_core.Rman/st_init.Rdtests/testthat/test-save-load.R
Hi @randrescastaneda,
I have made a small change on the verbose for
st_init, which is creating a lot of noise on the new pipeline. Feel free to review it and approve it whenever you have the time. Thank you!Summary by CodeRabbit
New Features
verboseparameter tost_init()function (defaultTRUE). When set toFALSE, suppresses informational messages and warnings while preserving error reporting.Tests
Chores