Skip to content

Could git_sitrep() check for network (proxy) connection? #725

@ijlyttle

Description

@ijlyttle

This was the "edgiest" of cases, but I thought it was interesting.

Someone at the workshop used a proxy but did not have their environment variables set up for the proxy. I think that proxy-setup is clearly beyond the scope of usethis, but it did seem that from the git_sitrep() perspective, a network failure is indistinguishable from an invalid token.

With my network off:

usethis::git_sitrep()
#> Git user
#> * Name: 'Ian Lyttle'
#> * Email: 'ian.lyttle@schneider-electric.com'
#> * Vaccinated: TRUE
#> usethis + git2r
#> * Default usethis protocol: <unset>
#> * git2r supports SSH: TRUE
#> * Credentials: '<usethis + git2r default behaviour>'
#> GitHub
#> * Personal access token: '<found in env var>'
#> ✖ Token is invalid.
#> Repo
#> ℹ No active usethis project.

Created on 2019-04-20 by the reprex package (v0.2.1)

As a first idea, could git_sitrep() look for a successful call to something like httr::GET("https://httpbin.org/get") to determine if it has network access?

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancementgitgit, GitHub, and CI in general

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions