You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2022/09/21 13:00:15 UTC

[incubator-devlake-website] branch main updated: update migration and release SOP docs (#216)

This is an automated email from the ASF dual-hosted git repository.

klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake-website.git


The following commit(s) were added to refs/heads/main by this push:
     new ed0b963ea update migration and release SOP docs (#216)
ed0b963ea is described below

commit ed0b963ead7618df620b0116aaff91c5a2398078
Author: mindlesscloud <li...@merico.dev>
AuthorDate: Wed Sep 21 21:00:11 2022 +0800

    update migration and release SOP docs (#216)
    
    * update migration and release SOP docs
    
    * adjustments based on feedback
    
    * update migration docs
---
 docs/DeveloperManuals/DBMigration.md | 7 ++++++-
 docs/DeveloperManuals/Release-SOP.md | 6 +++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/docs/DeveloperManuals/DBMigration.md b/docs/DeveloperManuals/DBMigration.md
index 531604981..2cb3000b7 100644
--- a/docs/DeveloperManuals/DBMigration.md
+++ b/docs/DeveloperManuals/DBMigration.md
@@ -16,10 +16,15 @@ Migration script describes how to do database migration.
 They implement the `Script` interface.
 When DevLake starts, scripts register themselves to the framework by invoking the `Register` function
 
+The method `Up` contains the steps of migration. When you write a new migration script, please pay attention to the fault tolerance and the side effect. 
+It would be better if the failed script could be safely retry, in case of something goes wrong during the migration. For this purpose, the migration scripts should be well-designed.
+For example, if you created a temporary table in the `Up` method, it should be dropped before exiting, regardless of success or failure.
+Using the `defer` statement to do some cleanup is a good idea.
+
 ```go
 type Script interface {
     // this function will contain the business logic of the migration (e.g. DDL logic)
-	Up(ctx context.Context, db *gorm.DB) error
+	Up(ctx context.Context, db *gorm.DB) errors.Error
     // the version number of the migration. typically in date format (YYYYMMDDHHMMSS), e.g. 20220728000001. Migrations are executed sequentially based on this number.
 	Version() uint64
 	// The name of this migration
diff --git a/docs/DeveloperManuals/Release-SOP.md b/docs/DeveloperManuals/Release-SOP.md
index 9e020d4a8..7e87bee37 100644
--- a/docs/DeveloperManuals/Release-SOP.md
+++ b/docs/DeveloperManuals/Release-SOP.md
@@ -98,7 +98,11 @@ https://incubator.apache.org/guides/releasemanagement.html
     ```shell
     svn mv https://dist.apache.org/repos/dist/dev/incubator/devlake/0.12.0-incubating-rc2 https://dist.apache.org/repos/dist/release/incubator/devlake/0.12.0-incubating -m "transfer packages for 0.12.0-incubating-rc2"
     ```
-- Wait until the directory 0.12.0-incubating in https://downloads.apache.org/incubator/devlake/  was created
+- Wait until the directory `https://downloads.apache.org/incubator/devlake/0.12.0-incubating/`  was created
+- Remove the last release from `https://downloads.apache.org/` (according the Apache release policy, this link should be pointing to the current release)
+    ```shell
+    svn rm https://dist.apache.org/repos/dist/release/incubator/devlake/0.11.0-incubating -m "remove 0.11.0-incubating"
+    ```
 - Announce release by sending an email to general@incubator.apache.org
    [[ANNOUNCE] Release Apache Devlake(incubating) 0.12.0-incubating](https://lists.apache.org/thread/7h6og1y6nhh4xr4r6rqbnswjoj3msxjk)
 ### GitHub