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 2023/10/16 08:25:18 UTC
[incubator-devlake] branch kw-normal-bp-json-error created (now ad8e21d2d)
This is an automated email from the ASF dual-hosted git repository.
klesh pushed a change to branch kw-normal-bp-json-error
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
at ad8e21d2d fix: normalize_bp_settings throws error
This branch includes the following new commits:
new ad8e21d2d fix: normalize_bp_settings throws error
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[incubator-devlake] 01/01: fix: normalize_bp_settings throws error
Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch kw-normal-bp-json-error
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit ad8e21d2d54d5b7489a0e2e1a81489ceed171527
Author: Klesh Wong <zh...@merico.dev>
AuthorDate: Mon Oct 16 16:25:04 2023 +0800
fix: normalize_bp_settings throws error
---
.../core/models/migrationscripts/20230829_normalize_bp_settings.go | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/backend/core/models/migrationscripts/20230829_normalize_bp_settings.go b/backend/core/models/migrationscripts/20230829_normalize_bp_settings.go
index 881dcb9bb..6de0155fc 100644
--- a/backend/core/models/migrationscripts/20230829_normalize_bp_settings.go
+++ b/backend/core/models/migrationscripts/20230829_normalize_bp_settings.go
@@ -74,7 +74,7 @@ func (script *normalizeBpSettings) Up(basicRes context.BasicRes) errors.Error {
}
db := basicRes.GetDal()
bp := &blueprint20230829{}
- cursor := errors.Must1(db.Cursor(dal.From("_devlake_blueprints")))
+ cursor := errors.Must1(db.Cursor(dal.From("_devlake_blueprints"), dal.Where("mode = ?", "NORMAL")))
defer cursor.Close()
for cursor.Next() {
@@ -82,6 +82,9 @@ func (script *normalizeBpSettings) Up(basicRes context.BasicRes) errors.Error {
errors.Must(db.Fetch(cursor, bp))
// decrypt and unmarshal settings
settingsJson := errors.Must1(plugin.Decrypt(encKey, bp.Settings))
+ if settingsJson == "" {
+ continue
+ }
settings := &blueprintSettings20230829{}
errors.Must(json.Unmarshal([]byte(settingsJson), settings))
// update bp fields