You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by ly...@apache.org on 2024/02/29 08:33:01 UTC
(incubator-devlake) branch lw-cp-0229-1 created (now 3de7eec6d)
This is an automated email from the ASF dual-hosted git repository.
lynwee pushed a change to branch lw-cp-0229-1
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
at 3de7eec6d fix(azuredevops): fix environment field in cicd_tasks and cicd_pipelines
This branch includes the following new commits:
new 3de7eec6d fix(azuredevops): fix environment field in cicd_tasks and cicd_pipelines
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(incubator-devlake) 01/01: fix(azuredevops): fix environment field in cicd_tasks and cicd_pipelines
Posted by ly...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lynwee pushed a commit to branch lw-cp-0229-1
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit 3de7eec6de063562dd9f1d418218be32c92daa50
Author: Lynwee Hou <li...@merico.dev>
AuthorDate: Thu Feb 29 16:15:46 2024 +0800
fix(azuredevops): fix environment field in cicd_tasks and cicd_pipelines
---
backend/python/plugins/azuredevops/azuredevops/streams/builds.py | 2 +-
backend/python/plugins/azuredevops/azuredevops/streams/jobs.py | 2 +-
backend/python/pydevlake/pydevlake/domain_layer/devops.py | 5 +++--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/backend/python/plugins/azuredevops/azuredevops/streams/builds.py b/backend/python/plugins/azuredevops/azuredevops/streams/builds.py
index aaf7a7be0..cb3b9f652 100644
--- a/backend/python/plugins/azuredevops/azuredevops/streams/builds.py
+++ b/backend/python/plugins/azuredevops/azuredevops/streams/builds.py
@@ -67,7 +67,7 @@ class Builds(Stream):
environment = devops.CICDEnvironment.PRODUCTION
if ctx.scope_config.production_pattern is not None and ctx.scope_config.production_pattern.search(
b.name) is None:
- environment = ""
+ environment = devops.CICDEnvironment.EMPTY
if b.finish_time:
duration_sec = abs(b.finish_time.timestamp() - b.start_time.timestamp())
diff --git a/backend/python/plugins/azuredevops/azuredevops/streams/jobs.py b/backend/python/plugins/azuredevops/azuredevops/streams/jobs.py
index 39c8883cc..9a309a2a7 100644
--- a/backend/python/plugins/azuredevops/azuredevops/streams/jobs.py
+++ b/backend/python/plugins/azuredevops/azuredevops/streams/jobs.py
@@ -84,7 +84,7 @@ class Jobs(Substream):
environment = devops.CICDEnvironment.PRODUCTION
if ctx.scope_config.production_pattern is not None and ctx.scope_config.production_pattern.search(
j.name) is None:
- environment = ""
+ environment = devops.CICDEnvironment.EMPTY
if j.finish_time:
duration_sec = abs(j.finish_time.timestamp() - j.start_time.timestamp())
diff --git a/backend/python/pydevlake/pydevlake/domain_layer/devops.py b/backend/python/pydevlake/pydevlake/domain_layer/devops.py
index abcd93448..3b6608fb3 100644
--- a/backend/python/pydevlake/pydevlake/domain_layer/devops.py
+++ b/backend/python/pydevlake/pydevlake/domain_layer/devops.py
@@ -44,6 +44,7 @@ class CICDEnvironment(Enum):
PRODUCTION = "PRODUCTION"
STAGING = "STAGING"
TESTING = "TESTING"
+ EMPTY = ""
class CICDPipeline(DomainModel, table=True):
@@ -66,7 +67,7 @@ class CICDPipeline(DomainModel, table=True):
queued_duration_sec: Optional[float]
type: Optional[CICDType]
- environment: Optional[str]
+ environment: Optional[CICDEnvironment]
class CiCDPipelineCommit(NoPKModel, table=True):
@@ -100,7 +101,7 @@ class CICDTask(DomainModel, table=True):
original_result: Optional[str]
type: Optional[CICDType]
- environment: Optional[str]
+ environment: Optional[CICDEnvironment]
created_date: Optional[datetime]
queued_date: Optional[datetime]