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

@ -15,4 +15,4 @@ jobs:
architecture: "x64"
cache: "pip"
- run: pip install -r script/update_top_ranking_issues/requirements.txt
- run: python script/update_top_ranking_issues/main.py 5393 --github-token ${{ secrets.GITHUB_TOKEN }} --prod
- run: python script/update_top_ranking_issues/main.py --github-token ${{ secrets.GITHUB_TOKEN }} --issue_reference_number 5393

View file

@ -15,4 +15,4 @@ jobs:
architecture: "x64"
cache: "pip"
- run: pip install -r script/update_top_ranking_issues/requirements.txt
- run: python script/update_top_ranking_issues/main.py 6952 --github-token ${{ secrets.GITHUB_TOKEN }} --prod --query-day-interval 7
- run: python script/update_top_ranking_issues/main.py --github-token ${{ secrets.GITHUB_TOKEN }} --issue_reference_number 6952 --query-day-interval 7

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: