-
Notifications
You must be signed in to change notification settings - Fork 8
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
Getting started vignette #60
Conversation
Cool. Thanks, I’ll look at it later this week tie earliest unfortunately. You can |
touchstone::refs_install() # installs branches to benchmark | ||
touchstone::pin_assets("data/all.Rdata", "inst/scripts") # pin files and directories | ||
|
||
load(path_pinned_asset("all.Rdata")) # perform other setup you need for the benchmarks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, this would actually be load(path_pinned_asset("all.Rdata"))
, don't you think? Do we place all assets in the temp directory root?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not quite sure I understand, that's what it says?
We have separate dirs in the temp dir for head and base ref now that we allow pinning from both to avoid name collisions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have separate dirs in the temp dir for head and base ref now that we allow pinning from both to avoid name collisions.
Yes, but if I pin data/all.Rdata
, it would be most natural to access it with path_pinned_asset("data/all.Rdata")
instead of path_pinned_asset("all.Rdata")
. Do you agree or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll plan some time for this and the other issue this coming week :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only want this to work for subdirectories of the current working directory/git repo right? So a path like ./../../../some/dir
should be invalid assuming .
is the root of the git repo, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it should be invalid. And all paths should be relative to the repo root. For other patients logic, do we also take the repo root as a starting point or are some things relative to touchstone/
? This should be consistent across the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lorenzwalthert This should now work as we expect, I added some handling of the repo root as we only did this implicitly up to now, please check if the way I implemented this is ok for you. I still need to update the documentation at some points etc. put functionally it should be ok ) also added/modified the tests.
touchstone::pin_assets("data/all.Rdata", "inst/scripts") # pin files and directories | ||
|
||
load(path_pinned_asset("all.Rdata")) # perform other setup you need for the benchmarks | ||
source(path_pinned_asset("scripts/prepare.R")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
potentially confusing for the user because this script is not pinned...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I choose these examples to illustrate that you can pin both files and directories and how only the last dir is copied when you use nested dirs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only the last dir is copied
Ok, this is probably related to what I wrote above. I think the whole directory tree should be copied, not just the last directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change that?
@assignUser thanks, I can have a look at resolving the merge conflicts now... |
I think there are a few related things that we should improve:
I will look into this next week hopefully. |
Thanks for the work you did so far @assignUser 👍 |
I am looking into it |
ok, thanks. I'll look into the other things then... |
I had the tempfile problem before somewhere else. I just deactivated the test for Windows: 11cfc5e. We could also opt against using a snap and do a regex match of the path instead where we try to match the part after |
Yeah the reason seems to be (on windows, idk why it does this on mac? Ihave no mac myslef to test that behaviour nor any experience with macos) |
re:mac it appears that |
|
Great @assignUser 👍, thanks a lot. I'll discuss my concerns in s separate issue I think, since this is on the brink of going off topic 😄 |
Closes #42
Let me know what you think :)
had to uninstall precommit to be able to commit the readme changes because the hook uses bash (but it looks like there are already multiple issues related to it so i wont open one 👍 ).