-
Notifications
You must be signed in to change notification settings - Fork 13
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
git fake data functions git_add, git_commit #232
git fake data functions git_add, git_commit #232
Conversation
parameterized git_add and git_commit added author and email parameters for git_commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some files being modified on accident here for this PR. Please see my inline comments!
DESCRIPTION
Outdated
@@ -43,4 +43,4 @@ Imports: | |||
VignetteBuilder: knitr | |||
URL: https://github.com/sailuh/kaiaulu | |||
BugReports: https://github.com/sailuh/kaiaulu/issues | |||
RoxygenNote: 7.0.2 | |||
RoxygenNote: 7.2.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not "git add" files which are not needed for the change. This is side effect behavior! This commit should be reverted to not modify this file.
R/git.R
Outdated
#' @param folder_path The worktree path | ||
#' @param file_to_add The file we want to add | ||
#' @export | ||
git_add <- function(git_repo, folder_path, file_to_add) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the function name is already git add, so lets just call the parameter file
. Can the filepath
be provided rather than just the file name? if so, then we should call it filepath
instead!
R/git.R
Outdated
@@ -154,31 +154,51 @@ git_create_sample_log <- function(folder_path="/tmp"){ | |||
git_repo <- file.path(folder_path,'.git') | |||
|
|||
# git --git-dir sample/.git --work-tree sample add hello.R | |||
#' @param git_repo The git repo path | |||
#' @param folder_path The worktree path | |||
#' @param file_to_add The file we want to add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job on including the docs! 👍
conf/geronimo.yml
Outdated
issues: ../rawdata/issue_tracker/geronimo_issues.json | ||
issue_comments: ../rawdata/issue_tracker/geronimo_issue_comments.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is another file that should not be modified. I also recommend you organize the folders as kaiaulu/kaiaulu so you do not need to keep switching the ../
back and forth every time.
man/git_create_sample_log.Rd
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for including the .Rd files!
Note your commit did not pass the test coverage checks, although @Rubegen did! You should compare notes on why yours are not passing, and check the log generated above. I suspect it may be some of the files you may have change on accident. Please do not delete the fork as you try to change the code! This will kill the Pull Request, and we don't want to create one PR to every attempt :) |
This reverts commit 5b5c1a0.
Codecov Report
@@ Coverage Diff @@
## master #232 +/- ##
==========================================
+ Coverage 17.44% 18.62% +1.18%
==========================================
Files 20 20
Lines 2534 2572 +38
==========================================
+ Hits 442 479 +37
- Misses 2092 2093 +1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need a few more changes. Consider using git diff before sending a commit for me to review.
vignettes/download_jira_data.Rmd
Outdated
@@ -49,7 +48,7 @@ save_path_issue_tracker_issue_comments <- conf[["issue_tracker"]][["jira"]][["is | |||
|
|||
In the project configuration file, we define the domain which JIRA is hosted. The example configuration file uses the domain for Apache Software Foundation. We can use this information to queue the domain to identify all project keys available in its JIRA: | |||
|
|||
```{r eval = FALSE} | |||
```{r} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use git diff before sending the commit so you can spot these. Note you are modifying the original Notebook on parts that should not be modified. This is likely from when I showed how the Notebook works. Regardless, there should be no reason for the Notebook to be added to your commit, since you are not changing that, right?
R/git.R
Outdated
git_add(git_repo, folder_path, "hello.R") | ||
git_commit(git_repo, folder_path, "This is a commit msg.", "John Smith", "[email protected]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a script file. It should not execute code outside function definitions.
You should also do a git squash at this point to see if the tests goes through. |
This reverts commit 0d69ab2.
parameterized git_add and git_commit added author and email parameters for git_commit Revert "i sailuh#227 parameterized git_add, git_commit" This reverts commit 5b5c1a0. i sailuh#227 parameterized git_add, git_commit Revert "i sailuh#227 parameterized git_add, git_commit" This reverts commit 0d69ab2. i sailuh#227 parameterized git_add, git_commit
…/github.com/waylonho/kaiaulu into 227-setup-gitadd-gitcommit-helper-functions
added return(git_repo) for the add and commit functions, trying to pass test
Not sure why this is failing. I've edited the commits so it only changes the git_add and git_commit, and it returns git_repo. |
If you inspect the log it will say. It is failing a unit test: Which is: kaiaulu/tests/testthat/test-parser.R Lines 52 to 53 in cb2f409
Did you run the unit tests and check command on your local machine? |
git_create_sample_log now uses git_init, git_add, and git_commit
Been trying to trouble shoot this for a while. Even when I run the check on the master branch on my local machine, I get the following error: Looking at the R-CMD-check, this line always brings up the error: Error ('test-parser.R:52:3'): Calling parse_gitlog with correct perceval and correct git log path returns a data table ── It is the same error as mentioned on #108. Not sure if this is a file path issue or something else. Any thoughts? |
Hi, As we talked about it today, the error you are experiencing on the pull request is likely due to modifications you performed on git_sample_gitlog. Since one of the functions were incorrectly implemented, it is likely git_sample_log is also broken. If the data can't be generated, then parse_gitlog has no data to test, leading to failure. Executing the unit tests on your local machine will not work, because you have not installed Perceval. We did the pip on call. What was missing is knowing where the perceval binary was installed in your machine. It should be in the same place as GitHub Actions install it. I.e. it should be on /Library/Frameworks/Python.framework/Versions/Current/bin/perceval If not, just search for the word "perceval" on your machine. Please let me know the soonest if you can find this file or not. Thanks! |
The thing to keep in mind is that it doesn't matter where the file should be, but rather that you specify its location on Once you confirm that, get the full path and replace on my |
@waylonho Did we not install 0.12.4 on call? In any case: Try to run Perceval on a |
…it_repo) for the add and commit functions running test w/ percevel, only functions have are in git.R. git_create_sample_log calls these functions and returns same git repo. git_commit is commented out and original system2 call is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't exhaustive look at the code on this review, but wanted to point the more immediate PR failed check.
Also, please take a look on CONTRIBUTING.md to go through the checklist, these changes should be added to NEWS.md under documentation sub-section.
Thanks!
R/git.R
Outdated
#' @param filepath The filepath we want to add | ||
#' @return The path to the sample .git file. | ||
#' @export | ||
git_commit <- function(git_repo, folder_path, commit_msg, author, email) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
R/git.R
Outdated
# git --git-dir sample/.git --work-tree sample add hello.R | ||
git_add(git_repo, folder_path, file_path) | ||
|
||
# WILL UNCOMMENT THIS BELOW LINE AFTER TEST |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should remove these before sending the Pull Request, or they may be accidentally accepted into the main code.
removed incorrectly defined filepath param, added commit_msg, author, and email in new function for git_commit. Currently the create_sample_gitlog does NOT use the new git_commit function, but rather a hard coded system2 call.
git_checkout function parameter now has boolean, and create_sample_git_log is now calling new git_commit with a fake author
@waylonho Unfortunately my edit was ill formatted on the DESCRIPTION file:
It is probably missing a comma or a parenthesis somewhere (your commit was missing Nicole's). Since I can't commit directly to your fork, you need to patch this DESCRIPTION file and send another commit so the checks can go through. Let me know if this doesn't make sense. |
Signed-off-by: Carlos Paradis <[email protected]>
Ok it seems I can commit directly to this branch on your fork. The unit test failing is because of a new test I added tracking another problem. Will commit here in a bit after I fix it on the master branch to see what we get. The description file is now fixed. |
…gitcommit-helper-functions Merging updates from upstream
…gitcommit-helper-functions Add commits from Kaiaulu moving to R 4.0.
There we go. The checks now pass. I will proceed to code review later today. Make sure you run Until code review for this is ready, I suggest you, after doing the git pull to this one so you don't forget, focus on the milestone 2. On your computer, this means you have to 1) git checkout to your master branch, 2) update your master branch with kaiaulu more recent changes:
Resolve any conflicts and commit if needed (it shouldn't, unless you accidentally changed code here). Then it is business as usual as you do CONTRIBUTING.md: git checkout -b new_branch etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As asked on @Rubegen PR, could you ensure that
- the git.R of both your PRs are exact the same
- the examples.R only contain your examples
- the unit tests only contain your unit tests
I want to avoid reviewing your incomplete git.R functions or the same code twice in case it ended up duplicated. This also should facilitate showcasing your contributions when the PR is accepted.
Thanks!
…mple_log I have included Ruben's updated functions as well as my own. example.R now uses the delete folder function. git_create_sample_log uses the new functions. This commit should contain all the updated functions and finalized git.R and io.R.
Hi, sorry I'm writing this so late. The most recent commit has everything updated: git.R has all the functions, git_checkout, and git_create_sample_log io.R has all the functions and is the same as Rubens commit. I sent Ruben a copy and will update him in the morning. |
Ruben commit already got merged, so you need to incorporate his code into yours! The simplest way to do this if you don't want to deal with git branches: Clone the more recent copy of Kaiaulu (not Ruben's) master branch. Add your needed modifications to git.R, io.R, example.R, test-parser.R. Then copy all these files and paste to your branch of this PR. Then send as commit. (Remember to also keep your NEWS.md and DESCRIPTION files. |
Hi, I currently have all the files done. Just want to make sure: do you want the PR to include Ruben's recent changes that were merged to master, or just my changes? For example, should example.R has both our tests? |
@waylonho I see the point of conflict! Since I already merged @Rubegen code, please go ahead and merge everything from |
…gitcommit-helper-functions
I suspect the issue are your .Rd files. Try to generate the docs and version them. I am seeing above the old name of functions that I fixed on @Rubegen code. You may want to wait for the checks to finish before sending the next review request just in case too, unless you are stuck! |
updated branch from master, changed git_checkout in git.R, example.R, test-parser.R, DESCRIPTION.
fixed function names, testing of checks pass
the error generated is because you are missing one function I added to @Rubegen code (Error in As I said before, it may be easier to just to just backup your code, copy all of kaiaulu/master from sailuh git.R, io.R, example.R, and test.R, and then re-add your changes on top of it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor changes needed I believe.
Your changes to git.R are reverting the corrections I already did to them on @waylonho code, with I believe the exception of the git_checkout
function. So basically, unless you are adding a new function, or improving a new function, can you keep the one I already reviewed on master? Pasting the master functions to your code should fix this, but you need to make sure the example functions are properly using the corrected functions.
R/git.R
Outdated
|
||
|
||
#' Git Init | ||
#' Initialize a git repo in a folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is reverting the changes on master. Can you leave the code on master as is?
R/git.R
Outdated
#' | ||
#' Initializes a new Git repository in the specified folder. | ||
#' The Git Init command creates a hidden `.git` folder. | ||
#' This function initializes a new Git repository in the specified folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
R/git.R
Outdated
return(git_repo) | ||
} | ||
|
||
#' Git Commit | ||
#' Git commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also reverting the function from master branch.
R/git.R
Outdated
#' | ||
#' Executes the `git commit` command on the target | ||
#' git repository. | ||
#' Git commits a file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
R/git.R
Outdated
@@ -250,10 +222,10 @@ git_commit <- function(git_repo, folder_path, commit_msg, author, email) { | |||
return(git_repo) | |||
} | |||
|
|||
#' Git Add | |||
|
|||
#' Git adds a file to the gitlog sample |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again reverting, etc.
#' @return Any error message generated by git | ||
#' @export | ||
git_checkout <- function(commit_hash,git_repo_path){ | ||
git_checkout <- function(commit_hash,git_repo_path,new_branch = FALSE){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the changes to git_checkout look needed. I would keep this on your commit.
Ok, after a few technical difficulties the checks pass now. Everything should be updated and contain Rubens code as well as added changes:
And yes, I was attempting to do the clone master and update that branch, but I was running into trouble because github was changing some other files in the 227 branch, other errors, etc. Long story short I updated 227 branch from master, then added to that branch. |
@waylonho see my review of your passed checks. You're almost there! |
@carlosparadis Understood, I'll fix these very shortly. |
Hi, I've commited the original function headers from master, the changes should be good to merge. Let me know if there's any other changes. |
- supressWarnings were removed from unit tests. - Parameters to example() folder have been added for consistency with other example functions. - The commented unit test that checked empty repo has been "fixed". More specifically, the code causing the issue to the test has been addressed to fail more gracefully returning a value that can be assessed with the unit test (this indirectly adresses sailuh#108). - One of the examples and unit tests purpose was not clear and the filter for large files was missing. This was corrected. - Other small details. Signed-off-by: Carlos Paradis <[email protected]>
@waylonho please have a look on a37ccd to see a few things you missed, so you don't repeat on the following PR. That being said, good work! The merges were properly addressed. There were a few docs inconsistencies and the suppressWarnings that were left in the code, so remember to not use them on the next run! :^) With this, milestone 1 comes to an end! Thank you for your hard work 👍 |
parameterized git_add and git_commit helper functions
added author and email parameters for git_commit