DEV Community

anatlavitzkovitz
anatlavitzkovitz

Posted on • Updated on

osdc-2023-assignment7

Contributing to open projects

assignment 7

  1. Contribute to pydigger: I decided to contribute an author name for pydigger

I found this repo, without an author name.

This is what I wrote in my pull request:
"Hi. I am taking an open source project course https://github.com/OSDC-Code-Maven/osdc-2023-01-public
and try to contribute to projects without an author name. to be added here: https://pydigger.com/."

my pull request

Waiting for a reply!

update: My pull request was excepted and merged! (-:

  1. Running R tests locally

This is my next task...
I work with a package in R called CrispRVariants.

I cloned it to my server and activated an R conda environment I have there.
Now I could do:

Rscript testthat.R

Enter fullscreen mode Exit fullscreen mode

I received the following message:

Loading required package: CrispRVariants
Loading required package: ggplot2

[ FAIL 0 | WARN 2 | SKIP 0 | PASS 20 ]

[ FAIL 0 | WARN 2 | SKIP 0 | PASS 20 ]

seems that something worked.
Also I found that there is a package to test coverage similar to python in (here)[https://github.com/IainMcl/R-Unit-Testing]

install.packages(covr)
library(covr)
report()
Enter fullscreen mode Exit fullscreen mode

I need to test this.


Lesson notes:

Example on how to write an issue
Problem in dev.to:
in dev.to if you do save changes your are out of the editor. how can this be fixed? maybe add an automated saving, or save and keep on editing.
If we go down on GitHub page there is a link to Forem. Going to forem and link to github. one repo is forem.
Forem/forem issues - search for autosave
shuly suggested an issue to add autosave here but got no reply.

another example: zarr-python
First search the issues - maybe someone else had a similar problem?

codecove - which lines were running during the test
this can show absence of tests
this can show us if a code was not tested after a change.
but if a test was not written, a piece of code will not be tested. high coverage doesn't mean good code but low coverage will show that not all the code is being tested.

You can try to promote a pull request

What if it doesn't work and you don't want to wait?
you can fix the issue locally and put in pypl with shaw - not recommended.
or you can make a fork and accept the pull request.

how?
dr - a basic docker file with alias in basrc for Gabor called dr.
Gabor has it in GitHub.

git clone ...
git fetch origin (default name) pull/1357/head
git checkout -b b1357 FETCH_HEAD
git lg
git show HEAD
git checkout main
git checkout -b szabgab
git merge 1357
gitk --all
Enter fullscreen mode Exit fullscreen mode

now you can use this repo.
better that he would do rebase...

Now we can add another PR:

git checkout -b b1299 FETCH_HEAD
Enter fullscreen mode Exit fullscreen mode

but this time there is a conflict.

a conflict
If you make a change in a different line - no problem to merge branch and main. changes to the same line- merge has a conflict. The change is in the text itself, not the raw number.
Now you can manually edit the new file and add it after that.

You can cancel the commit like this:

git merge --abort
Enter fullscreen mode Exit fullscreen mode

how to find projects in R?

explore/topics 'r'
add languages : R
recently updated better than more stars.

wcgenesummary
add contribution, find tests that can be run locally. this is the best practice for running the test.

ggplots - open issue how to run a test?
testhat? maybe this is very simple to run.

to do
how to run a test, open a pull request. how to make test coverage? send a pull requst. what test is missing, write it.
good way - run the test case and compare to the output. make this as a test.

Top comments (0)