This is an automated email from the ASF dual-hosted git repository.
abeizn pushed a commit to branch release-v0.20
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/release-v0.20 by this push:
new 6a48821e6 fix: dora benchmark metric value (#6737) (#6738)
6a48821e6 is described below
commit 6a48821e6659c1ed2dc689168475a5a7e84e46a5
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Jan 4 17:29:01 2024 +0800
fix: dora benchmark metric value (#6737) (#6738)
Co-authored-by: abeizn <[email protected]>
---
...er.go => 20240104_fix_dora_benchmark_metric.go} | 22 ++++++++++++++++------
.../dora/models/migrationscripts/register.go | 1 +
2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/backend/plugins/dora/models/migrationscripts/register.go
b/backend/plugins/dora/models/migrationscripts/20240104_fix_dora_benchmark_metric.go
similarity index 61%
copy from backend/plugins/dora/models/migrationscripts/register.go
copy to
backend/plugins/dora/models/migrationscripts/20240104_fix_dora_benchmark_metric.go
index ef96ffbeb..6646f5baa 100644
--- a/backend/plugins/dora/models/migrationscripts/register.go
+++
b/backend/plugins/dora/models/migrationscripts/20240104_fix_dora_benchmark_metric.go
@@ -18,12 +18,22 @@ limitations under the License.
package migrationscripts
import (
- "github.com/apache/incubator-devlake/core/plugin"
+ "github.com/apache/incubator-devlake/core/context"
+ "github.com/apache/incubator-devlake/core/errors"
)
-// All return all the migration scripts
-func All() []plugin.MigrationScript {
- return []plugin.MigrationScript{
- new(addDoraBenchmark),
- }
+type fixDoraBenchmarkMetric struct{}
+
+func (u *fixDoraBenchmarkMetric) Up(baseRes context.BasicRes) errors.Error {
+ db := baseRes.GetDal()
+ return db.Exec("UPDATE dora_benchmarks SET metric = 'Deployment
frequency' WHERE id = 1")
+
+}
+
+func (*fixDoraBenchmarkMetric) Version() uint64 {
+ return 20240104000002
+}
+
+func (*fixDoraBenchmarkMetric) Name() string {
+ return "fix dora benchmark metric"
}
diff --git a/backend/plugins/dora/models/migrationscripts/register.go
b/backend/plugins/dora/models/migrationscripts/register.go
index ef96ffbeb..1d7fb7bf8 100644
--- a/backend/plugins/dora/models/migrationscripts/register.go
+++ b/backend/plugins/dora/models/migrationscripts/register.go
@@ -25,5 +25,6 @@ import (
func All() []plugin.MigrationScript {
return []plugin.MigrationScript{
new(addDoraBenchmark),
+ new(fixDoraBenchmarkMetric),
}
}