From b13c12edf2da7527d91ede5033caf2f689f75030 Mon Sep 17 00:00:00 2001 From: mischko Date: Fri, 7 Feb 2025 13:09:54 +0100 Subject: [PATCH 1/3] add info about github creds --- ...opic-handling-packages-with-remote-dependencies.Rmd | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vignettes/z-advanced-topic-handling-packages-with-remote-dependencies.Rmd b/vignettes/z-advanced-topic-handling-packages-with-remote-dependencies.Rmd index 064554eb..0a9e25c4 100644 --- a/vignettes/z-advanced-topic-handling-packages-with-remote-dependencies.Rmd +++ b/vignettes/z-advanced-topic-handling-packages-with-remote-dependencies.Rmd @@ -231,8 +231,16 @@ first](https://docs.github.com/en/authentication/keeping-your-account-and-data-s If don't want to always have to set the `GITHUB_PAT` environment variable, you can also use a more [long term solution](https://gitcreds.r-lib.org/index.html). +Note: If you use `{gitcreds}`, you still need to set the `GITHUB_PAT` variable explicitly +for each session before calling `{rix}`. To not expose your PAT in your code, you can use: + +``` +my_token <- gitcreds::gitcreds_get()$password +Sys.setenv(GITHUB_PAT = my_token) +``` + However, you might still be getting the following message, even after -configuring a GitHub PAT: +correctly configuring a GitHub PAT: ``` Failed to get closest commit for gaborcsardi/gh: Failed to download commit data From e80e0354efb50cb43476fa0da913e9ddfd6e297e Mon Sep 17 00:00:00 2001 From: mischko Date: Fri, 7 Feb 2025 13:36:09 +0100 Subject: [PATCH 2/3] add note about 1000 commit limit --- ...andling-packages-with-remote-dependencies.Rmd | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/vignettes/z-advanced-topic-handling-packages-with-remote-dependencies.Rmd b/vignettes/z-advanced-topic-handling-packages-with-remote-dependencies.Rmd index 0a9e25c4..535287d4 100644 --- a/vignettes/z-advanced-topic-handling-packages-with-remote-dependencies.Rmd +++ b/vignettes/z-advanced-topic-handling-packages-with-remote-dependencies.Rmd @@ -198,8 +198,18 @@ Remotes: `{rix}` uses the GitHub API to fetch the commits of these remote packages and will attempt to select the commit of the remote packages, whose date is closest -to (always before, never after) the date of the commit provided by the user. If -you don't have a Github Personal Acccess Token set up, it will show: +to (always before, never after) the date of the commit provided by the user. +Note: `{rix}` will only be able to fetch a maximum of 1000 commits. That means +if the commit you provided is rather old or if the package has many commits, this +will fail and fallback to the `HEAD` of the repository. We have not observed this +in practice yet, but if this happens you should see a message like this: + +``` +Failed to get commit date for <<< satijalab/seurat-wrappers >>> No commits found before or on the target date +Falling back to <<< HEAD >>> +``` + +If you don't have a Github Personal Acccess Token set up, it will show: ``` When fetching the commit date from GitHub from <<< ropensci/rix >>>, no GitHub Personal Access Token found. @@ -211,7 +221,7 @@ This should still work until you hit the API limit, in which case you will see messages, such as this one: ``` -Failed to get commit date from <<< satijalab/seurat-wrappers >>> API request failed with status code 403. +Failed to get commit date for <<< satijalab/seurat-wrappers >>> API request failed with status code 403. Falling back to <<< HEAD >>> ``` From 90c4331f808ca893e099e207b3896a44a6b43488 Mon Sep 17 00:00:00 2001 From: mischko Date: Fri, 7 Feb 2025 14:33:01 +0100 Subject: [PATCH 3/3] add more info about git credentials --- ...ced-topic-handling-packages-with-remote-dependencies.Rmd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vignettes/z-advanced-topic-handling-packages-with-remote-dependencies.Rmd b/vignettes/z-advanced-topic-handling-packages-with-remote-dependencies.Rmd index 535287d4..d47184ef 100644 --- a/vignettes/z-advanced-topic-handling-packages-with-remote-dependencies.Rmd +++ b/vignettes/z-advanced-topic-handling-packages-with-remote-dependencies.Rmd @@ -240,9 +240,11 @@ Of course, you need to create a [GitHub PAT first](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic). If don't want to always have to set the `GITHUB_PAT` environment variable, you can also use a more [long term solution](https://gitcreds.r-lib.org/index.html). +For more information on GitHub Tokens, please also refer to [Happy Git and GitHub for the useR](https://happygitwithr.com/https-pat). For permanent storage, also refer +to [this stackoverflow question](https://stackoverflow.com/a/5343146/21417317). -Note: If you use `{gitcreds}`, you still need to set the `GITHUB_PAT` variable explicitly -for each session before calling `{rix}`. To not expose your PAT in your code, you can use: +Note: If you use `{gitcreds}`, you still need to set the `GITHUB_PAT` variable explicitly for each session before calling `{rix}`. +To avoid exposing your PAT in your code, you could use: ``` my_token <- gitcreds::gitcreds_get()$password