Skip to content

Commit

Permalink
Merge pull request #412 from mihem/improve_docs_remote_deps
Browse files Browse the repository at this point in the history
Improve docs remote deps
  • Loading branch information
b-rodrigues authored Feb 7, 2025
2 parents e5f50ce + 90c4331 commit feb9a81
Showing 1 changed file with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 >>>
```

Expand All @@ -230,9 +240,19 @@ 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 avoid exposing your PAT in your code, you could 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
Expand Down

0 comments on commit feb9a81

Please sign in to comment.