Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
docs: add code review workflow and guideline (#197)
tianzhou3078827115b1
diff --git a/docs/assets/codereview1.png b/docs/assets/codereview1.pngindex bb072f3d20..130049e660 100644Binary files a/docs/assets/codereview1.png and b/docs/assets/codereview1.png differdiff --git a/docs/assets/codereview2.png b/docs/assets/codereview2.pngnew file mode 100644index 0000000000..82a73a7513Binary files /dev/null and b/docs/assets/codereview2.png differdiff --git a/docs/code-review-guide.md b/docs/code-review-guide.mdnew file mode 100644index 0000000000..6e98759580--- /dev/null+++ b/docs/code-review-guide.md@@ -0,0 +1,67 @@+# Code review workflow++The code review workflow is like ping-pong between the author and reviewer. To streamline the process and avoid conflicts, both sides need to know which side should take the turn at the moment.++There are 2 approaches to inform this transition, the sync way and the async way.++## The sync way++Right after one finishes her part, she tells the other side immediately, usually via IM or face-to-face. We do NOT recommend this approach except for emergency because:++1. It's interruptive to your peers.+2. We are a distributed team, also working on open source means we have contributors in different timezones.++## The async way++This is the preferred way. On the other hand, it requires some discipline to make this approach efficient, thus we define some review guidelines.++# Guideline++## Terms++Below list some common review terms++### For the reviewer++- LGTM (Looks Good To Me): short note while approving the PR.++- Needs more work: require the reviewer to refine the PR.++- Request more info: require the reviewer to provide more info.++- nit: nit(picking), nice to improve.++### For the author++- PTAL (Please Take Another Look): request the reviewer to take another look after addressing the review comments.++# An example flow++1. Author creates the PR and request 1 or more reviewers.++1. The reviewer spots couple issues, leaves corresponding comments and sends the PR back by choosing **Request changes** when submitting the review.++1. The author addresses the comments and requests the reviewer to review again. We require author to **explicilty leave a PTAL comment** to indicate this.++1. The above 2 steps could take couple rounds until the reviewer chooses **Approve** when submitting the review and **explicitly leaves a LGTM comment**.++++## Notes++1. GitHub does a poor job indicating which side should take the turn. Thus, we strongly encourage each side to explicitly leave comment to indicate the other side can take the turn. e.g. Author should leave a PTAL comment when she addresses all previous review comments and ask reviwer to review again.+1. For the author, only include multiple reviewers if really needed. Multiple reviewers would increase review time and the reviewers would also be confused about who should review the code. If you want each reviewer review different parts of the code, please leave explicit comments.+1. The assigned reviewer is expected to give review feedback in 1 business day. If the reviewer is busy, please let the author know. The reviewer can unassign herself, just leave a comment to explain.++Though we don't recommend sync commnunication, sometimes it's more appropriate.++1. The reviewer is not responding in a business day. It's OK to ping the other side to check the status.+2. If there is back and forth on a particular topic, it's usaully more efficient to discuss offline.++# Tools++1. You can install [Neat](https://neat.run/) to subscribe GitHub notification, make sure to watch the bytebase repository.++1. You can also try [graphite](https://graphite.dev/) which is a new code review tool for GitHub. One nice feature is it displays who should take the turn for each ongoing PR.++diff --git a/docs/coding-guide.md b/docs/coding-guide.mdindex 690fc89c71..b1842fc58e 100644--- a/docs/coding-guide.md+++ b/docs/coding-guide.md@@ -4,7 +4,6 @@1. Write comment and use English.1. If the change is beyond trivial, write informative PR title and description.-# How to build a featureSplit into smaller changes. This makes reviewer life easy and you will get faster feedback.@@ -23,25 +22,3 @@ All in all, figure out the schema/data model first before moving forward and use## Example commits1. An end-to-end example showing you the code touched when adding a field to the schema and populate it all the way to UI: [Add path field to backup setting](https://github.com/bytebase/bytebase/commit/a7c28a4fefb2c2cff0c1ed9bb7fc043a47f535cd#diff-e547f2c710d4d67f2887ee13f4361d35537404829114e9c10d6aa5f48b3179dc)---# Code review workflow--We prefer the async review workflow since we can't always IM the other side.--The review workflow is like ping-pong between the author and reviewer. To streamline the process, please leave explicit comment to indicate you have finished your part and request the other side to take action.----You can install [Neat](https://neat.run/) to subscribe GitHub notification, make sure to watch the bytebase repository.--## Common reviewer term-* LGTM (Looks Good To Me): short note while approving the PR.--* Needs more work: require the reviewer to refine the PR.--* Request more info: require the reviewer to provide more info.--## Common author term--* PTAL (Please Take Another Look): request the reviewer to take another look after addressing the review comments.