Use existence of issue_reference_number flag to determine if prod

This commit is contained in:
Joseph T. Lyons 2024-04-05 08:13:33 -04:00
parent 3ae6463869
commit 1737329e84
3 changed files with 4 additions and 8 deletions

View file

@ -54,14 +54,10 @@ class IssueData:
@app.command()
def main(
issue_reference_number: Optional[int] = None,
github_token: Optional[str] = None,
prod: bool = False,
issue_reference_number: Optional[int] = None,
query_day_interval: Optional[int] = None,
) -> None:
if prod and not issue_reference_number:
raise ValueError("Issue reference number must be provided in prod mode")
start_time: datetime = datetime.now()
start_date: datetime | None = None
@ -97,7 +93,7 @@ def main(
error_message_to_erroneous_issue_data,
)
if prod:
if issue_reference_number:
top_ranking_issues_issue: Issue = repository.get_issue(issue_reference_number)
top_ranking_issues_issue.edit(body=issue_text)
else: