Python icon indicating copy to clipboard operation
Python copied to clipboard

Hacktoberfest flooded this repository with pull requests

Open ghost opened this issue 6 years ago • 43 comments

If possible can we all please focus on pull request and close the unnecessary ones

ghost avatar Oct 21 '20 07:10 ghost

dear maintainers, if possible please check this issue out.

@cclauss @dhruvmanila

ghost avatar Oct 22 '20 16:10 ghost

https://github.com/TheAlgorithms/Python/issues/2510#issuecomment-701540969

We should have a GitHub Action that autocloses PRs that do not have tests.

Criteria:

  1. Search Python code for ">>> " and
  2. Search Python filenames for test_*.py or *_test.py
    • https://docs.pytest.org/en/stable/goodpractices.html#conventions-for-python-test-discovery

If both of those tests fail then the Action should autoclose the PR with a note pointing the contributor to CONTRIBUTING.md.

cclauss avatar Oct 23 '20 04:10 cclauss

Oh. I did not know that. Bye! Have a great day ahead.

ghost avatar Oct 23 '20 07:10 ghost

Sorry I've been a bit busy, lot of things going on. This seems like a good idea, I will get onto it. One more thing we should do is use labels extensively. This will give a short summary of what is happening in a given PR and it will become the first point of contact between a maintainer and a user.

  • [x] Script for auto-closing PR which do not contain tests (any other conditions where auto-closing a PR would help?)
  • [x] Auto-label PRs?: tests are failing (I have already written a script for this using PyGithub library), merge-conflicts (search auto label merge conflicts) ...,
  • [ ] Write a note for maintainers about the importance of labels
  • [ ] IDEA for Project Euler PRs: As we don't want to be flooded with PRs for beginner level problems, I restricted to not submit problems that exist in this repository. Users still do that so make a script which will close them.

dhruvmanila avatar Oct 23 '20 07:10 dhruvmanila

any other conditions where auto-closing a PR

No annotations (type hints). I believe that this would require inspect or ast.

cclauss avatar Oct 23 '20 10:10 cclauss

Auto-labelling is a great idea, it highly simplifies the complete process of reviewing.

ghost avatar Oct 23 '20 11:10 ghost

I was also thinking about this #3239, Any suggestions?

ghost avatar Oct 23 '20 11:10 ghost

I see 10 open implementations for Problem 50 of Project Euler.

My opinion is for hacktoberfest-accepted, we may make it a bit lenient. I'm not sure if closing PRs with hacktoberfest-accepted tagged sounds logical or not.

poyea avatar Oct 23 '20 16:10 poyea

@xcodz-dot There're some updates this year: https://hacktoberfest.digitalocean.com/hacktoberfest-update

poyea avatar Oct 23 '20 17:10 poyea

Ok, thanks for letting me know. I logged into hactoberfest on 1st October and the article was released on 3rd October

ghost avatar Oct 23 '20 17:10 ghost

#2510 (comment)

We should have a GitHub Action that autocloses PRs that do not have tests.

Criteria:

  1. Search Python code for ">>> " and

  2. Search Python filenames for test_*.py or *_test.py

    • https://docs.pytest.org/en/stable/goodpractices.html#conventions-for-python-test-discovery

If both of those tests fail then the Action should autoclose the PR with a note pointing the contributor to CONTRIBUTING.md.

Please also include unittest and perhaps pytest. doctest are not the most beautiful way to add test code: http://www.rohitschauhan.com/index.php/2018/07/05/python-relative-benefits-of-pytest-unittest-nose-and-doctest/#:~:text=Pytest%20provides%20essentially%20the%20same,very%20easy%20to%20do%20so.

ronnydw avatar Oct 24 '20 22:10 ronnydw

They are included in 2. above. Our automated testing uses pytest, not nose or unittest. Tests that follow pytest discovery rules will ensure that those PRs are not autoclosed.

Doctests are not pretty but they are more simple for first-time contributors to understand. Contributors are free to chose either kind of test but we do not need to confuse contributors but explaining both.

cclauss avatar Oct 24 '20 22:10 cclauss

https://github.com/actions/stale I found this, anyone who can implement it for PRs?

ghost avatar Oct 25 '20 09:10 ghost

This has already been implemented but the number of days before an issue becomes stale is 30 so it takes time to see the difference.

dhruvmanila avatar Oct 25 '20 14:10 dhruvmanila

You are right but we need a action for PR (stale is implemented for issues only), #3707.

ghost avatar Oct 25 '20 16:10 ghost

Um, no. https://github.com/TheAlgorithms/Python/blob/master/.github/workflows/stale.yml It is implemented both for PR and issues.

dhruvmanila avatar Oct 25 '20 17:10 dhruvmanila

Whoops! thanks for letting me know. 😄

ghost avatar Oct 25 '20 17:10 ghost

Please close these PRs #3741 #3737 (they are duplicates of #3743) Those three PR's are made by the same person @agpeshal

ghost avatar Oct 25 '20 18:10 ghost

Is there any way we can help you with the pull requests ?

NumberPiOso avatar Oct 30 '20 15:10 NumberPiOso

Anyone can review any pull request on any repo on GitHub.

Look at PRs that have passing tests and then near the top of the pull request click Files changed and read thru the changes... Are they clear? Are they an improvement? Are there tests? Do those tests cover a sensable set of cases (large numbers, small numbers, zero, negative numbers, integers, floating-point numbers, strings, empty strings, lists, tuples, dicts, etc.)? Are there type hints on all function parameters and return values?

When you have had a good read through the changes, click the Review changes button at the upper right and call 'em like you see 'em. Positive reviews will give maintainers confidence that you have read through the contribution and believe that it would help to improve the repo. Other comments can help the contributor to improve their work so that it is easier for visitors to read and easier for maintainers to review. Thx!

cclauss avatar Oct 30 '20 15:10 cclauss