-
Notifications
You must be signed in to change notification settings - Fork 552
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add pr Additions and Deletions (#7714)
* fix: add pr Additions and Deletions * fix: add pr Additions and Deletions * fix: e2e test * fix: e2e test * fix: gitlab e2e * fix: migration conflict * fix: lint
- Loading branch information
Showing
11 changed files
with
137 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
backend/core/models/migrationscripts/20240710_add_changes_to_pr.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package migrationscripts | ||
|
||
import ( | ||
"github.com/apache/incubator-devlake/core/context" | ||
"github.com/apache/incubator-devlake/core/errors" | ||
"github.com/apache/incubator-devlake/core/plugin" | ||
) | ||
|
||
var _ plugin.MigrationScript = (*addChangesToPr)(nil) | ||
|
||
type prChange20240710 struct { | ||
Additions int | ||
Deletions int | ||
} | ||
|
||
func (prChange20240710) TableName() string { | ||
return "pull_requests" | ||
} | ||
|
||
type addChangesToPr struct{} | ||
|
||
func (*addChangesToPr) Up(basicRes context.BasicRes) errors.Error { | ||
db := basicRes.GetDal() | ||
if err := db.AutoMigrate(&prChange20240710{}); err != nil { | ||
return err | ||
} | ||
return nil | ||
} | ||
|
||
func (*addChangesToPr) Version() uint64 { | ||
return 20240710142100 | ||
} | ||
|
||
func (*addChangesToPr) Name() string { | ||
return "add additions and deletions to pr" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
backend/plugins/azuredevops_go/e2e/snapshot_tables/pull_requests.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
id,base_repo_id,head_repo_id,status,original_status,title,description,url,author_name,author_id,parent_pr_id,pull_request_key,created_date,merged_date,closed_date,type,component,merge_commit_sha,head_ref,base_ref,base_commit_sha,head_commit_sha | ||
azuredevops_go:AzuredevopsPullRequest:1:1,azuredevops_go:AzuredevopsRepo:1:0d50ba13-f9ad-49b0-9b21-d29eda50ca33,azuredevops_go:AzuredevopsRepo:1:0d50ba13-f9ad-49b0-9b21-d29eda50ca33,OPEN,OPEN,ticket-2PR,Updatedmain.javabyticket-2,https://dev.azure.com/johndoe/7a3fd40e-2aed-4fac-bac9-511bf1a70206/_apis/git/repositories/0d50ba13-f9ad-49b0-9b21-d29eda50ca33/pullRequests/1,JohnDoe,azuredevops_go:AzuredevopsUser:1:bc538feb-9fdd-6cf8-80e1-7c56950d0289,,1,2023-02-07T04:41:26.642+00:00,,"",,,ebc6c7a2a5e3c155510d0ba44fd4385bf7ae6e22,refs/heads/ticket-2,refs/heads/main,4bc26d92b5dbee7837a4d221035a4e2f8df120b2,85ede91717145a1e6e2bdab4cab689ac8f2fa3a2 | ||
id,base_repo_id,head_repo_id,status,original_status,title,description,url,author_name,author_id,parent_pr_id,pull_request_key,created_date,merged_date,closed_date,type,component,merge_commit_sha,head_ref,base_ref,base_commit_sha,head_commit_sha,additions,deletions | ||
azuredevops_go:AzuredevopsPullRequest:1:1,azuredevops_go:AzuredevopsRepo:1:0d50ba13-f9ad-49b0-9b21-d29eda50ca33,azuredevops_go:AzuredevopsRepo:1:0d50ba13-f9ad-49b0-9b21-d29eda50ca33,OPEN,OPEN,ticket-2PR,Updatedmain.javabyticket-2,https://dev.azure.com/johndoe/7a3fd40e-2aed-4fac-bac9-511bf1a70206/_apis/git/repositories/0d50ba13-f9ad-49b0-9b21-d29eda50ca33/pullRequests/1,JohnDoe,azuredevops_go:AzuredevopsUser:1:bc538feb-9fdd-6cf8-80e1-7c56950d0289,,1,2023-02-07T04:41:26.642+00:00,,,,,ebc6c7a2a5e3c155510d0ba44fd4385bf7ae6e22,refs/heads/ticket-2,refs/heads/main,4bc26d92b5dbee7837a4d221035a4e2f8df120b2,85ede91717145a1e6e2bdab4cab689ac8f2fa3a2,0,0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
backend/plugins/github/e2e/snapshot_tables/_tool_github_pull_requests.csv
Large diffs are not rendered by default.
Oops, something went wrong.
100 changes: 50 additions & 50 deletions
100
backend/plugins/github/e2e/snapshot_tables/pull_requests.csv
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.