This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/devlake.git
The following commit(s) were added to refs/heads/main by this push:
new 54d4e91cf fix(azuredevops_go) - consider runname for pipeline regex
match (#9152)
54d4e91cf is described below
commit 54d4e91cf060787518b31f9d5b649f4192f94d9b
Author: Veet Moradiya <[email protected]>
AuthorDate: Thu Sep 24 18:31:49 2026 +0530
fix(azuredevops_go) - consider runname for pipeline regex match (#9152)
* fix(azuredevops_go) - consider runname for pipeline regex match
* fix(lint): lint issue fix in azure devops extractor
* fix(lint): migration file issue fix
---------
Co-authored-by: root
<r...@inst-builder-debian-12-build-build-v4yxp.europe-west4-a.c.gce-image-builder.internal>
---
backend/plugins/azuredevops_go/models/build.go | 1 +
... 20260916_add_run_name_to_azuredevops_build.go} | 32 ++++++++++++++++------
.../models/migrationscripts/archived/build.go | 1 +
.../models/migrationscripts/register.go | 1 +
.../azuredevops_go/tasks/ci_cd_build_converter.go | 4 +--
.../azuredevops_go/tasks/ci_cd_build_extractor.go | 2 ++
.../src/plugins/register/azure/transformation.tsx | 6 ++--
7 files changed, 33 insertions(+), 14 deletions(-)
diff --git a/backend/plugins/azuredevops_go/models/build.go
b/backend/plugins/azuredevops_go/models/build.go
index ba395b950..8b10e4d8e 100644
--- a/backend/plugins/azuredevops_go/models/build.go
+++ b/backend/plugins/azuredevops_go/models/build.go
@@ -31,6 +31,7 @@ type AzuredevopsBuild struct {
Status string
Result string
Name string
+ RunName string
SourceBranch string
SourceVersion string
// Tags is a string version of the APIs tags array that helps to
identify
diff --git a/backend/plugins/azuredevops_go/models/migrationscripts/register.go
b/backend/plugins/azuredevops_go/models/migrationscripts/20260916_add_run_name_to_azuredevops_build.go
similarity index 52%
copy from backend/plugins/azuredevops_go/models/migrationscripts/register.go
copy to
backend/plugins/azuredevops_go/models/migrationscripts/20260916_add_run_name_to_azuredevops_build.go
index a7f7b24cb..c09a0375f 100644
--- a/backend/plugins/azuredevops_go/models/migrationscripts/register.go
+++
b/backend/plugins/azuredevops_go/models/migrationscripts/20260916_add_run_name_to_azuredevops_build.go
@@ -18,15 +18,29 @@ limitations under the License.
package migrationscripts
import (
- "github.com/apache/devlake/core/plugin"
+ "github.com/apache/devlake/core/context"
+ "github.com/apache/devlake/core/errors"
+ "github.com/apache/devlake/helpers/migrationhelper"
)
-// All return all the migration scripts
-func All() []plugin.MigrationScript {
- return []plugin.MigrationScript{
- new(addInitTables),
- new(extendRepoTable),
- new(addEndpointToAzuredevops),
- new(addUsernameToAzuredevops),
- }
+type addRunNameToAzuredevopsBuild struct{}
+
+type azuredevopsBuild20260916 struct {
+ RunName string `gorm:"type:varchar(255)"`
+}
+
+func (azuredevopsBuild20260916) TableName() string {
+ return "_tool_azuredevops_go_builds"
+}
+
+func (script *addRunNameToAzuredevopsBuild) Up(basicRes context.BasicRes)
errors.Error {
+ return migrationhelper.AutoMigrateTables(basicRes,
&azuredevopsBuild20260916{})
+}
+
+func (*addRunNameToAzuredevopsBuild) Version() uint64 {
+ return 20260916000001
+}
+
+func (*addRunNameToAzuredevopsBuild) Name() string {
+ return "add run name field to _tool_azuredevops_go_builds"
}
diff --git
a/backend/plugins/azuredevops_go/models/migrationscripts/archived/build.go
b/backend/plugins/azuredevops_go/models/migrationscripts/archived/build.go
index e8ff36d42..215f78488 100644
--- a/backend/plugins/azuredevops_go/models/migrationscripts/archived/build.go
+++ b/backend/plugins/azuredevops_go/models/migrationscripts/archived/build.go
@@ -29,6 +29,7 @@ type AzuredevopsBuild struct {
AzuredevopsId int `gorm:"primaryKey"`
RepositoryId string `gorm:"type:varchar(255)"`
Name string `gorm:"type:varchar(100)"`
+ RunName string `gorm:"type:varchar(255)"`
Status string `gorm:"type:varchar(255)"`
Result string `gorm:"type:varchar(255)"`
SourceBranch string `gorm:"type:varchar(255)"`
diff --git a/backend/plugins/azuredevops_go/models/migrationscripts/register.go
b/backend/plugins/azuredevops_go/models/migrationscripts/register.go
index a7f7b24cb..e71885f35 100644
--- a/backend/plugins/azuredevops_go/models/migrationscripts/register.go
+++ b/backend/plugins/azuredevops_go/models/migrationscripts/register.go
@@ -28,5 +28,6 @@ func All() []plugin.MigrationScript {
new(extendRepoTable),
new(addEndpointToAzuredevops),
new(addUsernameToAzuredevops),
+ new(addRunNameToAzuredevopsBuild),
}
}
diff --git a/backend/plugins/azuredevops_go/tasks/ci_cd_build_converter.go
b/backend/plugins/azuredevops_go/tasks/ci_cd_build_converter.go
index 944b4ddb2..14003c719 100644
--- a/backend/plugins/azuredevops_go/tasks/ci_cd_build_converter.go
+++ b/backend/plugins/azuredevops_go/tasks/ci_cd_build_converter.go
@@ -93,8 +93,8 @@ func ConvertBuilds(taskCtx plugin.SubTaskContext)
errors.Error {
OriginalStatus: build.Status,
OriginalResult: build.Result,
CicdScopeId:
repoIdGen.Generate(data.Options.ConnectionId, build.RepositoryId),
- Environment:
data.RegexEnricher.ReturnNameIfMatched(devops.PRODUCTION,
build.Name+";"+build.Tags),
- Type:
data.RegexEnricher.ReturnNameIfMatched(devops.DEPLOYMENT,
build.Name+";"+build.Tags),
+ Environment:
data.RegexEnricher.ReturnNameIfMatched(devops.PRODUCTION,
build.Name+";"+build.RunName+";"+build.Tags),
+ Type:
data.RegexEnricher.ReturnNameIfMatched(devops.DEPLOYMENT,
build.Name+";"+build.RunName+";"+build.Tags),
DurationSec: duration,
TaskDatesInfo: devops.TaskDatesInfo{
CreatedDate: *build.QueueTime,
diff --git a/backend/plugins/azuredevops_go/tasks/ci_cd_build_extractor.go
b/backend/plugins/azuredevops_go/tasks/ci_cd_build_extractor.go
index 9d7b8be00..e832398b7 100644
--- a/backend/plugins/azuredevops_go/tasks/ci_cd_build_extractor.go
+++ b/backend/plugins/azuredevops_go/tasks/ci_cd_build_extractor.go
@@ -19,6 +19,7 @@ package tasks
import (
"encoding/json"
+
"github.com/apache/devlake/core/errors"
"github.com/apache/devlake/core/plugin"
"github.com/apache/devlake/helpers/pluginhelper/api"
@@ -70,6 +71,7 @@ func ExtractApiBuilds(taskCtx plugin.SubTaskContext)
errors.Error {
Status: buildApi.Status,
Result: buildApi.Result,
Name: buildApi.Definition.Name,
+ RunName: buildApi.BuildNumber,
SourceBranch: buildApi.SourceBranch,
SourceVersion: buildApi.SourceVersion,
QueueTime: buildApi.QueueTime,
diff --git a/config-ui/src/plugins/register/azure/transformation.tsx
b/config-ui/src/plugins/register/azure/transformation.tsx
index 1a8ea0807..637c2d501 100644
--- a/config-ui/src/plugins/register/azure/transformation.tsx
+++ b/config-ui/src/plugins/register/azure/transformation.tsx
@@ -85,8 +85,8 @@ const renderCollapseItems = ({
</p>
<div>Convert a Azure Pipeline Run as a DevLake Deployment when:
</div>
<div style={{ margin: '8px 0', paddingLeft: 28 }}>
- <span>
- The name of the <strong>Azure pipeline</strong> or <strong>one
of its jobs</strong> matches
+ <span>
+ The <strong>pipeline name</strong>, <strong>run name</strong>,
or <strong>one of its jobs</strong> matches
</span>
<Input
style={{ width: 200, margin: '0 8px' }}
@@ -104,7 +104,7 @@ const renderCollapseItems = ({
<HelpTooltip content="Azure Pipelines:
https://learn.microsoft.com/en-us/azure/devops/pipelines/get-started/what-is-azure-pipelines?view=azure-devops#continuous-testing"
/>
</div>
<div style={{ margin: '8px 0', paddingLeft: 28 }}>
- <span>If the name also matches</span>
+ <span>If the pipeline name, run name, or job name also
matches</span>
<Input
style={{ width: 200, margin: '0 8px' }}
placeholder="prod(.*)"