Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

swarm: add pull request template #1715

Merged
merged 3 commits into from
Oct 20, 2019
Merged

swarm: add pull request template #1715

merged 3 commits into from
Oct 20, 2019

Conversation

acud
Copy link
Member

@acud acud commented Aug 31, 2019

Adds a PR template to the repo for the welfare of all our contributors and reviewers alike

pull_request_template.md Outdated Show resolved Hide resolved
pull_request_template.md Outdated Show resolved Hide resolved
1. Open PRs preemptively (i.e. whenever you start working on it), especially for the case of large tasks
2. Create PRs with a healthy amount of description. A PR without a description will not be approved
3. PR names should adhere to the following standard: "(affected package(s)): description". examples: "storage: fix panic on hasherstore put", "network, storage, p2p: integrate capabilities api". if many (many) packages are affected, use "all" instead of individual names
3. Mark the PR with a `ready for review` label once it is. If a second(or more) round of reviews is required, remove the `ready for review` label and add a `ready for another review` label
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use "in progress" inbetween

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH i find the in progress label redundant and never use it. if the package is not marked ready for review it means it is in progress and we should not review it. not sure why we need a label for every permutation of the universe

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is first "ready for review" and then needs some more work I change it to "in progress" while it's not ready for review anymore. I think this protocol makes it more clear when to re-review PRs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as @nolash says it is in order for a second reviewer to judge if submitter works on fixes atm.

2. Create PRs with a healthy amount of description. A PR without a description will not be approved
3. PR names should adhere to the following standard: "(affected package(s)): description". examples: "storage: fix panic on hasherstore put", "network, storage, p2p: integrate capabilities api". if many (many) packages are affected, use "all" instead of individual names
3. Mark the PR with a `ready for review` label once it is. If a second(or more) round of reviews is required, remove the `ready for review` label and add a `ready for another review` label
4. Never(!) force-push a PR once reviews have started! This has the unfortunate side-effect of resolving/outdating previous comments over the PR
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so rebase only in the end?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally yes. and ideally you shouldn't need to rebase at all. i'm willing to reconcile with adding "rebasing while the pr is under review is to be done only if requested by reviewers"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is more complicated. if the PR review is a longer process, it is super important to keep it rebased, since it can bring up incompatibilities etc.
Another reason not to keep review process too long and PRs to be small.
@janos you usually do a merge what do u think is the best way?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This point is fine as a warning, even I doubt that it can be always applied, but at least it would minimize force pushing. As we cannot restore old history after force pushing, I do not see what we can do when that happens. It has a bit of conflict with point number 1. With preemptive PRs, we are encouraging early comments, which means that this point would be activated very early.

I think that rebasing and force pushing breaks history for other clones, especially when conflicts need to be resolved afterwards repeatedly. Having a merge commit allows better automatic conflict resolution by not loosing commits and history. But, I have nothing against force pushing as it provides cleaner history. It is completely ok to do force push for me, as it is a usual operation on swarm codebase. I would prefer forbidding force pushing completely, as we are squashing commits at the end, but that would be too drastic.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we encourage development in parallell temporary files where possible? That way we have less issues with rebase.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My idea is to avoid force pushing as much as possible, that is why I added the reservations that the reviewer can ask to do so once the review process has started.

Rebasing brings a plethora of problems ranging from regressions due to human error while rebasing to github quirks that resolve comments and other branches that break while rebasing. These thing happen to us all the time and I would like to reduce the number of points of possible failures. We shouldn't rebase unless another branch contains a changeset that is needed in the current one we're working on. If master changes in the meanwhile when we work on the PR - it does not infer that a rebase is in need. If our CI runs a merge build and not a push build the incompatibilities should pop up and be shown on the CI build.

I agree that this point somehow is in conflict with point 1, but the idea is to give guidelines to contributors while allowing core members a bit more flexibility according to fluctuating needs. There's no silver bullet here but we can at least minimize error by new and external contributors.

@nolash you are welcome to PR or start a document on development best practices. I really don't wanna make a PR template into a gocode best practices knowledge-base

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@acud my point is not a go-specific one. Conflicts would happen in any kind of source. By keeping separate temporary files, rebase is even less likely. This is also aligned with your announced goal:

My idea is to avoid force pushing as much as possible

3. Mark the PR with a `ready for review` label once it is. If a second(or more) round of reviews is required, remove the `ready for review` label and add a `ready for another review` label
4. Never(!) force-push a PR once reviews have started! This has the unfortunate side-effect of resolving/outdating previous comments over the PR
5. It is up to the reviewer to resolve a comment
6. A comment does not account as a blocker to merging a PR unless explicitly mentioned in the comment: `BLOCKER: .....`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

6. A comment does not account as a blocker to merging a PR unless explicitly mentioned in the comment: `BLOCKER: .....`
7. When reviewing - please make the comment on a line that would constitute a change when addressed - this will resolve the comments automatically once addressed
8. Once you address a review comment with a code change - no need to comment on it with "done"/"ok"/:+1: - this generates redundant email notifications (to those who have them enabled) and once you push git will automatically resolve/outdate the comment and the reviewer could then mark the comment as resolved without any further taxation of reading even more comments on the PR
9. We are all here to ship working software with a continuous attention to technical excellence and good design (https://agilemanifesto.org/principles.html); not to make each other's lives miserable. Thus, we ask you to take PR reviews as a process of reflection rather than a fencing duel(!)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to add something like "in difference of opinion focus on the arguments." and perhaps "matters of pure taste should be the discretion of thte author"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please write the complete suggested bulletpoint?

9. We are all here to ship working software with a continuous attention to technical excellence and good design (https://agilemanifesto.org/principles.html); not to make each other's lives miserable. Thus, we ask you to take PR reviews as a process of reflection rather than a fencing duel(!)
10. Please reference related issues that should be closed with the most favorite keyword of your choice - https://github.com/blog/1506-closing-issues-via-pull-requests
11. Always use the `Squash` method of merging the PR to the branch
12. Always tidy up the commit message when using squash - having a very long commit message does not help anyone. Summerize the work done in bullet points and only then merge
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about "including trivial intermediate commit messages" - sometimes maybe it's not a dumb idea to have a bit of a log.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH in the context of big pull requests, intermediate commit messages are redundant because the underlying diff is very difficult to compare anyway. in the case of small PRs intermediate commits are trivial. i'm willing to reconcile with adding a small request to include intermediate commit message only in the case that they are very important

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

big pull requests

But there shouldn't be any, right? ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. especially on planet nolash

@acud acud self-assigned this Sep 3, 2019
Copy link
Contributor

@nonsense nonsense left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me.

@zelig
Copy link
Member

zelig commented Sep 4, 2019

I would add:

  • before setting the ready for review label, make sure all checks passed. To try the ci locally, use go run ./build/ci.go lint, go run ./build/ci.go test.
  • for merging the PR must be reviewed and approved by at least two others and approved by all parties that submitted a review earlier even if there are 2 other approvals
  • you do not need to create an issue on a PR you submit (early or complete, cos you would not anyway) but if there exists one, reference it with the appropriate magic keywords, e.g., fixes #1501
  • consider submitting changes in other packages that are dependecies of a PR in separate PRs
  • assign to yourself or whoever you delegate
  • make sure the work is shown on a board by choosing the project
  • use labels
    • review status: in progress, ready for review, ready for another review
    • it is prudent to use 'in progress' before the PR is ready, but not needed
    • it is imperative to use 'ready for review'
    • in subsequent iterations, be brave and put back in progress, and ready for review
  • PRs are an excellent interface to discuss changes, so sometimes you open PRs that are not meant to be merged. Use the 'do not merge' label for PR that are
    - experimental (e.g., DO NOT MERGE Independent services in Swarm #1676) or
    - demonstrative (Unified hasher methods in swarm #427)
    - supplemental (alternative implementation, e.g, pss: Improve pressure backstop queue handling  #1680)
  • put on the board and groom the board regularly, esp blocker

@nolash
Copy link
Contributor

nolash commented Sep 4, 2019

for merging the PR must be reviewed and approved by at least two others and approved by all parties that submitted a review earlier even if there are 2 other approvals

@zelig @acud we should also add a reminder that before merge smoke tests on cluster should have been run and passed.

@nolash
Copy link
Contributor

nolash commented Sep 4, 2019

@acud is it a conscious choice that you have omitted encouragement to keep the PR deltas small?

@nolash
Copy link
Contributor

nolash commented Sep 4, 2019

9b. If there is strong difference of opinion, please double check that you have understood all proposed arguments in the process of discussion. Unresolved differences are resolved by simple majority of author and the two reviewers. Matters of taste are at the discretion of the author.

How about this? @acud

@nolash
Copy link
Contributor

nolash commented Sep 4, 2019

we should also add a reminder that before merge smoke tests on cluster should have been run and passed.

...though in case of wholly external contributors this is not possible, I guess.

@acud
Copy link
Member Author

acud commented Sep 4, 2019

@zelig @nolash I have nothing against your propositions but may I remind you that these guidelines should appear in the following (tiny) textbox:
2019-09-04-145102_1920x1080_scrot
Not sure how much text you wanna have in there but I feel that if we are not concise with a readable checklist people will just not read what's in the box. We are better off with having this in some wiki page/documentation page.

@acud acud closed this Sep 4, 2019
@acud acud reopened this Oct 20, 2019
@acud acud merged commit 99fc4dd into master Oct 20, 2019
@acud acud deleted the pr-template branch October 20, 2019 07:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants