New setup working release with aliases#22
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ 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 |
dana89co
left a comment
There was a problem hiding this comment.
Hi @RossanaTat, I reviewed it and some of the tests are not passing regarding this file, so maybe we need to check that. However, I tested in pipload and I have made the changes accordingly. I will send you PR in a bit
Sure thanks, fixing the tests now! |
R/working_release.R
Outdated
|
|
||
| # Existing aliases in this stamp project | ||
| existing_aliases <- tryCatch( | ||
| stamp::st_aliases(), |
There was a problem hiding this comment.
Hi @RossanaTat, I do not think this function exists. We can use stamp::st_alias_get or stamp::st_alias_list. Maybe we should use the last one here?
R/working_release.R
Outdated
| i = glue::glue( | ||
| "You are trying to re-register it for:\n {root}" | ||
| ), | ||
| i = "This usually happens when switching PIP releases in the same R session.", |
There was a problem hiding this comment.
@RossanaTat , wait is this actually happening? It should no re-register. If the folder is already created st_init does not do anything. Is that not the case?
There was a problem hiding this comment.
Hey @dana89co, this is happening when you try to initialize the same alias for different folders, which {stamp} by default does not accept. This is because some root folders paths, like the one for aux data, are release specific. For example, if I call setup_working_release("20251211", "TEST") and then setup_working_release("20251205", "TEST") in the same session, {stamp} will error saying that the "aux" alias was already registered for ".../.../aux_data/20251211_TEST" and therefore cannot point now to ".../.../aux_data/20251205_TEST". This is correct behavior in {stamp} and ideally a situation that does not occur often, as we work with one release per session.
However, in order to make it more flexible, I've updated the function in the following way (refer to latest commits):
setup_working_releasehas an additional argumentalias_include_releasewhich is by default FALSE. When the user sets it to TRUE, when stamp initializes the aliases, the alias name will contain the release date for those folders which are release specific, so that no conflict arise.
Feel free to give it a try and let me know if you have questions :)
Updated:
setup_working_releaseto work with stamp alias