Skip to content

Commit

Permalink
fix: normalize_bp_settings throws error
Browse files Browse the repository at this point in the history
  • Loading branch information
klesh committed Oct 16, 2023
1 parent 1d91c11 commit ad8e21d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,17 @@ 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() {
// load row
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
Expand Down

0 comments on commit ad8e21d

Please sign in to comment.