Skip to content
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

Parse GitHub URLs #112

Merged
merged 11 commits into from Nov 14, 2017

Conversation

Projects
None yet
3 participants
@jennybc
Copy link
Member

commented Sep 20, 2017

The promised PR that allows install_github() to accept a variety of GitHub URLs. It should be merged after #110, because this branch works off that base. Or, I guess, I could close that, because those commits are included here as well.

I took the liberty of doing a general tidy of GitHub remote parsing:

  • Split GitHub repo parsing into two exported functions: parse_repo_spec() (the thing we've always had) and parse_github_url(). They are documented together.
  • Moved the dropping of empty elements into the (unexported) parse_git_repo() to make the return value of the above functions more predictable.
  • Put all related tests in their own file because it's nice to be able to do test(filter = "parse") w/o doing the full install_github() tests.

I know it still needs a NEWS bullet. I'll write one with correct issue/PR numbers if this is good to merge.

@jennybc jennybc requested a review from gaborcsardi Sep 20, 2017

@jennybc

This comment has been minimized.

Copy link
Member Author

commented Sep 21, 2017

To really make installation via URL work for, say, GHE remotes, the parsed list would have to gain a slot to hold the host 🤔.

NAMESPACE Outdated
@@ -35,7 +35,8 @@ export(install_url)
export(install_version)
export(local_package_deps)
export(package_deps)
export(parse_github_repo_spec)
export(parse_github_url)
export(parse_repo_spec)

This comment has been minimized.

Copy link
@gaborcsardi

gaborcsardi Nov 12, 2017

Member

It is an incompatible change to drop parse_github_repo_spec, I think we should keep that name (as well?).

This comment has been minimized.

Copy link
@jennybc

jennybc Nov 12, 2017

Author Member

OK I will address this. Need to re-orient myself to what I was doing!

Just for context, I can't find any evidence of parse_github_repo_spec() usage on CRAN, outside of remotes itself.

GitHub-wise, I see one other use:

This comment has been minimized.

Copy link
@gaborcsardi

This comment has been minimized.

Copy link
@richfitz

richfitz Nov 12, 2017

As requested here: #13 😀

This comment has been minimized.

Copy link
@jennybc

jennybc Nov 12, 2017

Author Member

OK I went back to the old name, @gaborcsardi.

Here's what I think (?) I was thinking:

  • Start to de-emphasize the GitHub-ness, since these repo spec parsers are not too hard to generalize to BitBucket, GitLab, and the like. But it's easy to make this change now and cross that bridge later.

jennybc added some commits Nov 12, 2017

Merge branch 'master' into parse-github-urls
# Conflicts:
#	R/install-github.R
#	tests/testthat/test-install-github.R
@gaborcsardi

This comment has been minimized.

Copy link
Member

commented Nov 13, 2017

Thanks! Can we just make parse_github_repo_spec an alias to the new function? Then we don't need two implementations. I understand that the new function is doing more, but that is fine.

params$release <- "*release"
}

params[grepl("^[^\\.]", names(params))]
}

parse_git_repo <- function(repo) {

This comment has been minimized.

Copy link
@jennybc

jennybc Nov 13, 2017

Author Member

Should this be exported?

This comment has been minimized.

Copy link
@gaborcsardi

gaborcsardi Nov 13, 2017

Member

Up to you. Personally I would not export any parsing functions, but we are past that already...

This comment has been minimized.

Copy link
@jennybc

jennybc Nov 13, 2017

Author Member

OK let's leave it alone for now then.

@gaborcsardi

This comment has been minimized.

Copy link
Member

commented Nov 14, 2017

Great, thanks!

@gaborcsardi gaborcsardi merged commit 2363c85 into master Nov 14, 2017

4 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

jimhester added a commit to jimhester/pkgdepends that referenced this pull request Nov 28, 2017

Parse GitHub URLs
A port of @jennybc's r-lib/remotes#112 to
pkgdepends.

jimhester added a commit to jimhester/pkgdepends that referenced this pull request Nov 28, 2017

Parse GitHub URLs
A port of @jennybc's r-lib/remotes#112 to
pkgdepends.

@jimhester jimhester referenced this pull request Nov 28, 2017

Merged

Parse GitHub URLs #49

jimhester added a commit to jimhester/pkgdepends that referenced this pull request Nov 28, 2017

Parse GitHub URLs
A port of @jennybc's r-lib/remotes#112 to
pkgdepends.

jimhester added a commit to jimhester/pkgdepends that referenced this pull request Dec 4, 2017

Parse GitHub URLs
A port of @jennybc's r-lib/remotes#112 to
pkgdepends.

gaborcsardi added a commit to r-lib/pkgdepends that referenced this pull request Dec 4, 2017

Parse GitHub URLs (#49)
A port of @jennybc's r-lib/remotes#112 to
pkgdepends.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.