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

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


The following commit(s) were added to refs/heads/main by this push:
     new 72f7d5cb chore: refine the db-migration-required msg for production 
(#2822)
72f7d5cb is described below

commit 72f7d5cbba6fb13a6a9f513e3b502929d4daee39
Author: Klesh Wong <[email protected]>
AuthorDate: Wed Aug 24 15:36:08 2022 +0800

    chore: refine the db-migration-required msg for production (#2822)
---
 api/api.go | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/api/api.go b/api/api.go
index 947a966e..e61934e9 100644
--- a/api/api.go
+++ b/api/api.go
@@ -34,10 +34,16 @@ import (
        "github.com/swaggo/gin-swagger/swaggerFiles"
 )
 
+const DB_MIGRATION_REQUIRED = `
+New migration scripts detected. Database migration is required to launch 
DevLake.
+WARNING: Performing migration may wipe collected data for consistency and 
re-collecting data may be required.
+To proceed, please send a request to 
<config-ui-endpoint>/api/proceed-db-migration (or 
<devlake-endpoint>/proceed-db-migration).
+Alternatively, you may downgrade back to the previous DevLake version.
+`
+
 // @title  DevLake Swagger API
 // @version 0.1
 // @description  <h2>This is the main page of devlake api</h2>
-// sdfasdfasd
 // @license.name Apache-2.0
 // @host localhost:8080
 // @BasePath /
@@ -66,10 +72,7 @@ func CreateApiService() {
                }
                shared.ApiOutputError(
                        ctx,
-                       fmt.Errorf("Database migration is required for Apache 
DevLake to function properly, it might cause the "+
-                               "collected data gets wiped out for consistency. 
\nPlease send a request to `/proceed-db-migration` "+
-                               "(or `/api/proceed-db-migration` from 
config-ui)if it is ok, or you may downgrade back to the older "+
-                               "version you previous used."),
+                       fmt.Errorf(DB_MIGRATION_REQUIRED),
                        http.StatusPreconditionRequired,
                )
                ctx.Abort()

Reply via email to