CredibilityLab / groundhog

Reproducible R Scripts Via Date Controlled Installing & Loading of CRAN & Git Packages
https://groundhogr.com/
GNU General Public License v3.0
78 stars 4 forks source link

Add specific HTTP header for groundhogR? #27

Closed Bisaloo closed 4 years ago

Bisaloo commented 4 years ago

So the servers (CRAN & MRAN) know that the request comes from groundhogR.

Currently, they see requests from either "RStudio Desktop (1.2.5019); R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu)" or "R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu)".

urisohn commented 4 years ago

sorry, i don't understand

Bisaloo commented 4 years ago

When you connect to a website, the program you use for this sends a User-Agent. It's kind of a business card declining its identity.

For example, here you can see how your web browser presents itself to every website you visit: https://www.whatismybrowser.com/detect/what-is-my-user-agent.

Right now, we are connecting to CRAN and MRAN by announcing we are using R (and possibly RStudio). It might be nice for them to have more information and know that those are not direct requests from users but they are done under the hood by groundhogR.

urisohn commented 4 years ago

If we are talking about what groundhogR does from within R as a user, I am not sure i see why. or put another way, when i install a package with install.pacakges() what HTTP headers are sent? I would emulate their approach to this.

Bisaloo commented 4 years ago

For the user, it doesn't change anything.

It's only useful for MRAN and CRAN (and possibly us). This way, they know that these requests come from us. They can contact us if something is wrong with how groundhogR behaves.

install.packages() is slightly different in my opinion because it signals the user explicit intent to download and install the package whereas groundhog.library() kind of does it as a side effect.

urisohn commented 4 years ago

ok, let's do this. let's wait till i do the updates though.

Bisaloo commented 4 years ago

How does paste0("groundhogR R package version ", utils::packageVersion("groundhogR"), " running on R ", get.rversion()) sound?

Bisaloo commented 4 years ago

I hadn't thought about this but this is only feasible on most recent R versions so I'm going to close this issue for now.