Skip to content

Commit 119195b

Browse files
authored
Merge branch 'main' into fix/#8975
2 parents 5cf684d + eaf86ce commit 119195b

35 files changed

Lines changed: 2068 additions & 40 deletions

backend/.dockerignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Build artifacts: regenerated inside the image (GOBIN=/app/bin + make build-plugin/build-server).
2+
# Shipping the host's pre-built bin/ (multiple GB of plugin .so files) bloats the
3+
# build context and the builder layer, which can exhaust the Docker VM and crash BuildKit.
4+
bin/
5+
6+
# Generated mocks (regenerated via make mock inside the image)
7+
mocks/
8+
9+
# Runtime logs
10+
logs/
11+
12+
# Python build/venv artifacts (regenerated; Dockerfile.server reinstalls from
13+
# requirements.txt / pyproject and runs python/build.sh). Source under python/ is kept.
14+
**/.venv/
15+
**/__pycache__/
16+
**/*.pyc
17+
python/.devlake-python-build-root/
18+
19+
# Test / coverage output
20+
*.out
21+
coverage.txt
22+
23+
# OS / editor junk
24+
.DS_Store

backend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ RUN if [ "$(arch)" != "x86_64" ] ; then \
5050
fi
5151

5252
RUN go install github.com/vektra/mockery/v2@v2.53.6
53-
RUN go install github.com/swaggo/swag/cmd/swag@v1.16.1
53+
RUN go install github.com/swaggo/swag/cmd/swag@v1.16.6
5454

5555
COPY --from=debian-amd64 /usr/include /rootfs-amd64/usr/include
5656
COPY --from=debian-amd64 /usr/lib/x86_64-linux-gnu /rootfs-amd64/usr/lib/x86_64-linux-gnu

backend/Dockerfile.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ RUN mkdir -p /tmp/build && cd /tmp/build && \
4848
ldconfig
4949

5050
RUN go install github.com/vektra/mockery/v2@v2.53.6
51-
RUN go install github.com/swaggo/swag/cmd/swag@v1.16.1
51+
RUN go install github.com/swaggo/swag/cmd/swag@v1.16.6
5252

5353
WORKDIR /app
5454
COPY . /app

backend/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ all: build
2828

2929
go-dep:
3030
go install github.com/vektra/mockery/v2@v2.53.6
31-
go install github.com/swaggo/swag/cmd/swag@v1.16.1
31+
go install github.com/swaggo/swag/cmd/swag@v1.16.6
3232
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2
3333

3434
go-dev-tools:
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
17+
18+
package codequality
19+
20+
import (
21+
"time"
22+
23+
"github.com/apache/incubator-devlake/core/models/domainlayer"
24+
)
25+
26+
type CqProjectMetricsHistory struct {
27+
domainlayer.DomainEntity
28+
ProjectKey string `gorm:"index;type:varchar(500)"`
29+
AnalysisDate time.Time `gorm:"index"`
30+
Coverage *float64
31+
Ncloc *int
32+
Bugs *int
33+
ReliabilityRating string `gorm:"type:varchar(5)"`
34+
CodeSmells *int
35+
SqaleRating string `gorm:"type:varchar(5)"`
36+
Complexity *int
37+
CognitiveComplexity *int
38+
Vulnerabilities *int
39+
SecurityRating string `gorm:"type:varchar(5)"`
40+
SecurityHotspots *int
41+
DuplicatedLinesDensity *float64
42+
}
43+
44+
func (CqProjectMetricsHistory) TableName() string {
45+
return "cq_project_metrics_history"
46+
}

backend/core/models/domainlayer/domaininfo/domaininfo.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func GetDomainTablesInfo() []dal.Tabler {
5656
&codequality.CqIssue{},
5757
&codequality.CqIssueImpact{},
5858
&codequality.CqProject{},
59+
&codequality.CqProjectMetricsHistory{},
5960
// crossdomain
6061
&crossdomain.Account{},
6162
&crossdomain.BoardRepo{},
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
17+
18+
package migrationscripts
19+
20+
import (
21+
"github.com/apache/incubator-devlake/core/context"
22+
"github.com/apache/incubator-devlake/core/errors"
23+
"github.com/apache/incubator-devlake/core/models/migrationscripts/archived"
24+
"github.com/apache/incubator-devlake/helpers/migrationhelper"
25+
)
26+
27+
type addCqProjectMetricsHistory struct{}
28+
29+
func (u *addCqProjectMetricsHistory) Up(basicRes context.BasicRes) errors.Error {
30+
return migrationhelper.AutoMigrateTables(
31+
basicRes,
32+
&archived.CqProjectMetricsHistory{},
33+
)
34+
}
35+
36+
func (*addCqProjectMetricsHistory) Version() uint64 {
37+
return 20260707153201
38+
}
39+
40+
func (*addCqProjectMetricsHistory) Name() string {
41+
return "add cq_project_metrics_history domain table"
42+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
17+
18+
package archived
19+
20+
import "time"
21+
22+
type CqProjectMetricsHistory struct {
23+
DomainEntity
24+
ProjectKey string `gorm:"index;type:varchar(500)"`
25+
AnalysisDate time.Time `gorm:"index"`
26+
Coverage *float64
27+
Ncloc *int
28+
Bugs *int
29+
ReliabilityRating string `gorm:"type:varchar(5)"`
30+
CodeSmells *int
31+
SqaleRating string `gorm:"type:varchar(5)"`
32+
Complexity *int
33+
CognitiveComplexity *int
34+
Vulnerabilities *int
35+
SecurityRating string `gorm:"type:varchar(5)"`
36+
SecurityHotspots *int
37+
DuplicatedLinesDensity *float64
38+
}
39+
40+
func (CqProjectMetricsHistory) TableName() string {
41+
return "cq_project_metrics_history"
42+
}

backend/core/models/migrationscripts/register.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,5 +145,6 @@ func All() []plugin.MigrationScript {
145145
new(modifyCicdDeploymentsToText),
146146
new(increaseCqIssuesProjectKeyLength),
147147
new(addAuthSessions),
148+
new(addCqProjectMetricsHistory),
148149
}
149150
}

backend/plugins/dora/e2e/change_lead_time/cicd_deployment_commits.csv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ id,result,started_date,duration_sec,cicd_deployment_id,cicd_scope_id,repo_url,en
1414
13,SUCCESS,2023-04-13T07:56:39.000+00:00,60,pipeline7,cicd2,REPO111,PRODUCTION,3,,commit13,2023-4-13 7:56:39,2023-04-13T07:57:39.000+00:00
1515
14,FAILURE,2023-04-13T07:57:26.000+00:00,60,pipeline8,cicd3,REPO111,PRODUCTION,,,commit14,2023-4-13 7:57:26,2023-04-13T07:58:26.000+00:00
1616
15,SUCCESS,2023-04-13T07:57:45.000+00:00,60,pipeline9,cicd3,REPO111,PRODUCTION,,,commit15,2023-4-13 7:57:45,2023-04-13T07:58:45.000+00:00
17-
16,SUCCESS,2023-04-13T07:58:24.000+00:00,60,pipeline10,cicd3,REPO333,,,,commit16,2023-4-13 7:58:24,2023-04-13T07:59:24.000+00:00
17+
16,SUCCESS,2023-04-13T07:58:24.000+00:00,60,pipeline10,cicd3,REPO333,,,,commit16,2023-4-13 7:58:24,2023-04-13T07:59:24.000+00:00
18+
17,SUCCESS,2023-04-13T07:59:00.000+00:00,60,pipeline11,cicd1,REPO111,PRODUCTION,,project1,direct_commit1,2023-4-13 7:59:00,2023-04-13T08:00:00.000+00:00

0 commit comments

Comments
 (0)