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 life-of-a-feature development guide (#823)
Danny Xu77f2ef109074
diff --git a/docs/coding-guide.md b/docs/coding-guide.mddeleted file mode 100644index d5d5009fd9..0000000000--- a/docs/coding-guide.md+++ /dev/null@@ -1,28 +0,0 @@-# General--1. Put more thought on data modeling and naming.-1. Write comment and use English.-1. If the change is beyond trivial, write informative PR title and description.--# How to build a feature--It's highly recommended to split a large change into multiple smaller changes, and each pull request should only have one goal. This makes reviewer life easy, and you will get fast feedback. The change for each pull request should not exceed `500 lines` unless it's a trivial change such as renaming or refactoring.--If you are working on an end-to-end feature including both backend and frontend, the usual steps to follow are:--1. If it requires schema change, design the schema first (you may need to discuss with peers).-1. Design the API, our [API style guide](https://github.com/bytebase/bytebase/blob/main/docs/api-style-guide.md).-1. Golang code follows [Uber Go Style Guide](https://github.com/uber-go/guide/blob/master/style.md).-1. Finish the rest.--Ideally, you will split the schema change, API change and the rest into separate PRs. If you put them together, then if the schema requires a change after the review, it will end up with a lot of code changes. For obvious schema changes, you can still choose to put them in a single PR.--All in all, figure out the schema/data model first before moving forward and use your judgement to decide whether to split the change into separate PRs.--## Example commits--1. 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)--## Post-submission (Optional)--Sometimes local developmenet environment has different setup and configurations than production release. After code is submitted, you can wait for an hour and use a docker image built from main branch head for testing. Change the image tag from `bytebase/bytebase:x.x.x` to `bytebase/bytebase:dev-ci` in [Docker Deployment Guide](https://docs.bytebase.com/install/docker).diff --git a/docs/life-of-a-feature.md b/docs/life-of-a-feature.mdnew file mode 100644index 0000000000..6833e66280--- /dev/null+++ b/docs/life-of-a-feature.md@@ -0,0 +1,29 @@+# Life of a Feature++## Do's++1. Understand the goal by answering "what's the problem we're solving?".+1. Write technical design docs.+ - Do some researches and provide background information and overview.+ - Find a simple and sustainable solution. Technical decisions usually come along with trade-offs among several options. We need a simple solution for a difficult problem. The solution should also be scalable to future changes or growth if possible.+ - Split a large design into smaller ones, e.g. backend, UI, UX, etc.+ - ```(IMPORTANT)``` Define data model and design database schema. According to our [Version Management](version-management.md), any schema change could cause disruption to existing customers. Uncareful design will also lead to software scalability issues.+ - Design API by following [API style guide](https://github.com/bytebase/bytebase/blob/main/docs/api-style-guide.md)+ - Put thoughts on naming, because it's hard to change the names in database schemas and APIs. We can have different names for technical pieces and products.+ - Collabrate with peers and tech leads.+ - Write doc including comments in English. We are doing open-source with contributors globally.+2. Coding.+ - Follow [code review guide](code-review-guide.md) (small changes, effective communication, collabrate, and ```respect```).+ - Split changes to database schema, API, backend, frontend if possible, because you will get different reviewers looking at different parts. For example, we can make backend do dual writes for any API changes, switch the reads on UI, and clean up the dual writes in bacnkend.+ - ```(IMPORTANT)``` Think about compatability and don't break existing users. This usually happen if we change database schemas or APIs.+ - Guard new features behind a release flag especially for frontend using [`isDev()`](https://github.com/bytebase/bytebase/blob/4fd7ea41a716dbd72c85b0bc02f04fff5e08370f/frontend/src/main.ts#L41). We should release the feature only when it's mature.+ - Testing, key for product quality. This includes unit tests, [backend integration tests](https://github.com/bytebase/bytebase/tree/main/tests), frontend manual tests. Tests should cover critical user journeys. While writing backend integration tests, you will have even better idea on how users will use the product from end to end.+ - Golang code follows [Go Wiki](https://github.com/golang/go/wiki/CodeReviewComments) and [Uber Go Style Guide](https://github.com/uber-go/guide/blob/master/style.md).+ - Collabrate if a feature requires multiple developers to work on.+ - (Optional) After code is submitted, you can wait for a while and use a docker image with tag `bytebase/bytebase:dev-ci` for testing release build. See [Docker Deployment Guide](https://docs.bytebase.com/install/docker).+3. Documentation.+ - We should update [public documentation](https://docs.bytebase.com/) for new features.+4. Testing and feedback.+ - Before a feature is released, get some peers to try out this new features by following public documentation. Receive feedback and iterate.+5. Release and announcement. Cheers!+