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 how to use feature flag for backend (#3577)
Tianzhou (天舟)f288c6a39cb8
diff --git a/docs/life-of-a-feature.md b/docs/life-of-a-feature.mdindex a802c52ecf..485861542a 100644--- a/docs/life-of-a-feature.md+++ b/docs/life-of-a-feature.md@@ -13,10 +13,13 @@- Collaborate with peers and tech leads.- Write docs including comments in English. We are doing open-source with contributors globally.1. Coding.- - Follow [code review guide](code-review-guide.md) (small changes, effective communication, collaboration, and ```respect```).+ - Follow [code review guide](code-review-guide.md) (small changes, effective communication, collaboration, 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 the backend do dual writes for any API changes, switch the reads on UI, and clean up the dual writes in the backend.- **(IMPORTANT)** Think about compatibility and don't break existing users. This usually happens 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.+ - Guard new features behind a release flag. We should release the feature only when it's mature.+ - For frontend using [`isDev()`](https://github.com/bytebase/bytebase/blob/4fd7ea41a716dbd72c85b0bc02f04fff5e08370f/frontend/src/main.ts#L41).+ - For backend using [`FeatureFlag(xxx)`](https://github.com/bytebase/bytebase/blob/main/store/feature_flag.go)+ to make the code work with both old and new schema.- Testing is the key to 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 an even better idea of how users will use the product from end to end.- Golang code follows [Google Go Style](https://google.github.io/styleguide/go/).- Collaborate if a feature requires multiple developers to work on.@@ -24,8 +27,8 @@1. Success metrics- What data do we need to prove the feature or business is successful?- Collect and display the metrics in the [metrics dashboard](https://metric.bytebase.com/).-2. Documentation.+1. Documentation.- We should update [public documentation](https://bytebase.com/docs) for new features.-3. Testing and feedback.+1. Testing and feedback.- Before a feature is released, get some peers to try out these new features by following public documentation. Receive feedback and iterate.-4. Release and announcement. Cheers!+1. Release and announcement. Cheers!