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:46 UTC
[lucene-jira-archive] 01/02: check if issue key matches request key
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