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

Get organized: owner/repo = repo_spec #376

Merged
merged 2 commits into from May 31, 2018
Merged

Get organized: owner/repo = repo_spec #376

merged 2 commits into from May 31, 2018

Conversation

@jennybc
Copy link
Member

@jennybc jennybc commented May 31, 2018

Main points:

  • Continue to standardize user-facing args and internal vocabulary around GitHub:
    • r-lib/usethis: owner = r-lib, repo = usethis, repo_spec = r-lib/usethis
  • Add more helpers around GitHub owner, repo, repo_spec

Questions:

  • Is it bad to use non-exported functions in default arg values? General question.
  • Should the browse_*() family switch over to repo_spec from package? Right now, target repo is driven by GitHub info found in URL field of DESCRIPTION. But maybe it should be driven by the local remote associated with GitHub? Or try one then the other?
    • Pro: everything would work for non-package projects
    • Con: less favourable if you're working with someone else's package. But how relevant is that?

Happy to discuss/review during 1-on-1.

@jennybc jennybc requested a review from hadley May 31, 2018
R/create.R Outdated
}
owner <- repo[[1]]
repo <- repo[[2]]
## TODO: do I need to do anything re: repo --> repo_spec?

This comment has been minimized.

@jennybc

jennybc May 31, 2018
Author Member

Do I need to do much/anything about changing repo argument to repo_spec? create_from_github() is mostly for interactive use, probably has few users, repo/repo_spec is the first argument (so often unnamed) and partial matching works in our favour.

This comment has been minimized.

@hadley

hadley May 31, 2018
Member

I don't think you need to

repo = NULL,
from = releases(owner = owner, repo = repo)[[1]],
use_tidy_thanks <- function(repo_spec = github_repo_spec(),
from = releases(repo_spec)[[1]],

This comment has been minimized.

@jennybc

jennybc May 31, 2018
Author Member

I dislike using unexported functions for the defaults. But also like having a sensible default and revealing it.

This comment has been minimized.

@hadley

hadley May 31, 2018
Member

Should we add this as an argument to use_github_labels() too?

This comment has been minimized.

@jennybc

jennybc May 31, 2018
Author Member

I don't think we need to add repo_spec to use_github_labels(). I makes sense to me that it works on the active project.

I think use_tidy_thanks() is different and pretty unique because you are likely to use it while in another project, e.g. composing a post in the tidyverse.org project.

@hadley
hadley approved these changes May 31, 2018
R/create.R Outdated
}
owner <- repo[[1]]
repo <- repo[[2]]
## TODO: do I need to do anything re: repo --> repo_spec?

This comment has been minimized.

@hadley

hadley May 31, 2018
Member

I don't think you need to

repo = NULL,
from = releases(owner = owner, repo = repo)[[1]],
use_tidy_thanks <- function(repo_spec = github_repo_spec(),
from = releases(repo_spec)[[1]],

This comment has been minimized.

@hadley

hadley May 31, 2018
Member

Should we add this as an argument to use_github_labels() too?

@jennybc
Copy link
Member Author

@jennybc jennybc commented May 31, 2018

We've decided to leave the browse_*() family alone for now, but it remains on the radar for future change.

@jennybc jennybc merged commit c21b284 into master May 31, 2018
5 of 6 checks passed
5 of 6 checks passed
codecov/patch 8.33% of diff hit (target 60.99%)
Details
codecov/project 60.93% (-0.07%) compared to 105f394
Details
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
@jennybc jennybc deleted the owner-repo-repospec branch May 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants