You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by to...@apache.org on 2022/07/19 11:41:45 UTC

[lucene-jira-archive] branch check-issue-key-when-downloading created (now b7f90891)

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

tomoko pushed a change to branch check-issue-key-when-downloading
in repository https://gitbox.apache.org/repos/asf/lucene-jira-archive.git


      at b7f90891 don't create empty file for moved issues

This branch includes the following new commits:

     new b308b3cd check if issue key matches request key
     new b7f90891 don't create empty file for moved issues

The 2 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.



[lucene-jira-archive] 02/02: don't create empty file for moved issues

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomoko pushed a commit to branch check-issue-key-when-downloading
in repository https://gitbox.apache.org/repos/asf/lucene-jira-archive.git

commit b7f90891dc918a87e886e2926199393fb9421420
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Tue Jul 19 20:41:34 2022 +0900

    don't create empty file for moved issues
---
 migration/src/download_jira.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/migration/src/download_jira.py b/migration/src/download_jira.py
index 648c25e8..dbe5bac9 100644
--- a/migration/src/download_jira.py
+++ b/migration/src/download_jira.py
@@ -41,12 +41,12 @@ def download_issue(num: int, dump_dir: Path) -> bool:
     if res.status_code != 200:
         logger.warning(f"Can't download {issue_id}. status code={res.status_code}, message={res.text}")
         return False
+    data = res.json()
+    if data["key"] != issue_id:
+        logger.warning(f"The issue key {data['key']} does not match the request key {issue_id}. Maybe this was moved.")
+        return False
     dump_file = jira_dump_file(dump_dir, num)
     with open(dump_file, "w") as fp:
-        data = res.json()
-        if data["key"] != issue_id:
-            logger.warning(f"The issue key {data['key']} does not match the request key {issue_id}. Maybe this was moved.")
-            return False
         json.dump(data, fp, indent=2)
     logger.debug(f"Jira issue {issue_id} was downloaded in {dump_file}.")
     return True


[lucene-jira-archive] 01/02: check if issue key matches request key

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomoko pushed a commit to branch check-issue-key-when-downloading
in repository https://gitbox.apache.org/repos/asf/lucene-jira-archive.git

commit b308b3cd3b50b5055f756487fa1a0868dca4ed20
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Tue Jul 19 20:39:26 2022 +0900

    check if issue key matches request key
---
 migration/src/download_jira.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/migration/src/download_jira.py b/migration/src/download_jira.py
index 9fb5c049..648c25e8 100644
--- a/migration/src/download_jira.py
+++ b/migration/src/download_jira.py
@@ -43,7 +43,11 @@ def download_issue(num: int, dump_dir: Path) -> bool:
         return False
     dump_file = jira_dump_file(dump_dir, num)
     with open(dump_file, "w") as fp:
-        json.dump(res.json(), fp, indent=2)
+        data = res.json()
+        if data["key"] != issue_id:
+            logger.warning(f"The issue key {data['key']} does not match the request key {issue_id}. Maybe this was moved.")
+            return False
+        json.dump(data, fp, indent=2)
     logger.debug(f"Jira issue {issue_id} was downloaded in {dump_file}.")
     return True