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

pkgreview_create vs pkgreview_init #5

Closed
maelle opened this issue Jan 29, 2018 · 8 comments
Closed

pkgreview_create vs pkgreview_init #5

maelle opened this issue Jan 29, 2018 · 8 comments

Comments

@maelle
Copy link
Contributor

maelle commented Jan 29, 2018

As said earlier, fantastic package and initiative!

I have trouble understanding why pkgreview_create and pkgreview_init are two separate functions?

@annakrystalli
Copy link
Collaborator

annakrystalli commented Jan 29, 2018

So initially they were one function, put when I tried to run them, the call had started cloning the package from github before the project could be launched (and the working directory changed) so did not end up in the right location relative to the review directory. So I split it up to ensure pkgreview_init was launched from the review project root. I'd be much nicer to be one function though, agreed.

Any ideas on how this could be handled? When the review proj is created it even launches a new session so quite a bit to handle.

@maelle
Copy link
Contributor Author

maelle commented Jan 30, 2018

ah ok it makes sense! I'm not sure 🤔 I have never started a project from the command line actually, I always click on "New Project" in RStudio.

@maelle
Copy link
Contributor Author

maelle commented Jan 31, 2018

I'm looking into an RStudio project template could help.

What seems "easy":

  • Having that template create the structure and set the working directory to it.

  • Creating the template by clicking

What I do not know yet

  • How to create a project from the command line (the usethis::create_project function doesn't have a template argument)

  • How the template could be updated (cf review template to be read from its original source? #7 )

  • How the template could use info about the name of the review (apart from the folder created by hand with the right name)

So we might still end up having two functions...

  • init blank review project which creates a review where the user says.

  • setup review which would need the username/package and would then clone the package, and fill out the parts of the template such as package name.

Not sure it's easier?

@annakrystalli
Copy link
Collaborator

You know I think this might be a useful model: from the workflowr package https://jdblischak.github.io/workflowr/reference/wflow_start.html

Code here:

@maelle
Copy link
Contributor Author

maelle commented Jan 31, 2018

Nice!

I also want to look at https://github.com/ijlyttle/ghentr and https://github.com/lockedata/pRojects for inspiration

@maelle
Copy link
Contributor Author

maelle commented Jan 31, 2018

Here are my notes about workflowr::wflow_start "Start a new workflowr project.".

  • It has the name of the project as an argument, although otherwise it'd use the name of the directory.

  • It does a lot of checks of RStudio (cf Dependency on RStudio #11 ) and of git.

  • It checks overwriting as well. (doesn't sound urgent to implement, but nice)

  • The way it initiates the project is by copying files from a model folder that includes an Rproj file. This Rproj file is simply renamed by this function.

  • It makes the first git commit. Honestly here I don't think it's needed, it's fine to "just" intialize git.

  • I'm not 100% sure because I haven't tested the function but I don't think it opens the project in the end? Which in my opinion should happen.

All of this happens by writing the name and arguments of the function. If I were a reviewer I know I'd love to just click to start the project, but both solutions are important?

@maelle
Copy link
Contributor Author

maelle commented Feb 12, 2018

Could the pkg_repo argument of the initialisation step disappear? One expects this function to be called in an RProj already created using the argument so it could be deduced from something?

@maelle
Copy link
Contributor Author

maelle commented Jun 25, 2018

maybe a flowchart would help by the way? am obsessed with http://rich-iannone.github.io/DiagrammeR/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants