You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by zh...@apache.org on 2023/05/10 10:55:07 UTC

[incubator-devlake] branch main updated: feat: azure adapts original_status and status (#5143)

This is an automated email from the ASF dual-hosted git repository.

zhangliang2022 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 80ae444c7 feat: azure adapts original_status and status (#5143)
80ae444c7 is described below

commit 80ae444c7851a005a7df2ec9b2b854c53c9a003f
Author: abeizn <zi...@merico.dev>
AuthorDate: Wed May 10 18:55:02 2023 +0800

    feat: azure adapts original_status and status (#5143)
    
    * feat: azure adapts original_status and status
    
    * fix: fix azure pull request unit test
    
    * fix: azure devops original_status
---
 backend/python/plugins/azuredevops/azuredevops/streams/pull_requests.py | 1 +
 backend/python/plugins/azuredevops/tests/streams_test.py                | 1 +
 backend/python/pydevlake/pydevlake/domain_layer/code.py                 | 1 +
 3 files changed, 3 insertions(+)

diff --git a/backend/python/plugins/azuredevops/azuredevops/streams/pull_requests.py b/backend/python/plugins/azuredevops/azuredevops/streams/pull_requests.py
index b7ab834be..2d9485e14 100644
--- a/backend/python/plugins/azuredevops/azuredevops/streams/pull_requests.py
+++ b/backend/python/plugins/azuredevops/azuredevops/streams/pull_requests.py
@@ -50,6 +50,7 @@ class GitPullRequests(Stream):
             base_repo_id=base_repo_id,
             head_repo_id=repo_id,
             status=status,
+            original_status=pr.status.value,
             title=pr.title,
             description=pr.description,
             url=pr.url,
diff --git a/backend/python/plugins/azuredevops/tests/streams_test.py b/backend/python/plugins/azuredevops/tests/streams_test.py
index f7624afbe..4f9f1e199 100644
--- a/backend/python/plugins/azuredevops/tests/streams_test.py
+++ b/backend/python/plugins/azuredevops/tests/streams_test.py
@@ -276,6 +276,7 @@ def test_pull_requests_stream(context):
         base_repo_id='azuredevops:GitRepository:1:johndoe/test-repo',
         head_repo_id='azuredevops:GitRepository:1:johndoe/test-repo',
         status='OPEN',
+        original_status='active',
         title='ticket-2 PR',
         description='Updated main.java by ticket-2',
         url='https://dev.azure.com/johndoe/7a3fd40e-2aed-4fac-bac9-511bf1a70206/_apis/git/repositories/0d50ba13-f9ad-49b0-9b21-d29eda50ca33/pullRequests/1',
diff --git a/backend/python/pydevlake/pydevlake/domain_layer/code.py b/backend/python/pydevlake/pydevlake/domain_layer/code.py
index d8da795a4..629dd991e 100644
--- a/backend/python/pydevlake/pydevlake/domain_layer/code.py
+++ b/backend/python/pydevlake/pydevlake/domain_layer/code.py
@@ -27,6 +27,7 @@ class PullRequest(DomainModel, table=True):
     base_repo_id: str
     head_repo_id: str
     status: str
+    original_status: str
     title: str
     description: str
     url: str