From ab6c3169ac38b6aef3021ec997886666a5de5a07 Mon Sep 17 00:00:00 2001 From: "Mikhail f. Shiryaev" Date: Fri, 6 May 2022 20:50:44 +0200 Subject: [PATCH] Use ENV for API_URL customization --- tests/ci/cancel_and_rerun_workflow_lambda/app.py | 3 ++- tests/ci/workflow_approve_rerun_lambda/app.py | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/ci/cancel_and_rerun_workflow_lambda/app.py b/tests/ci/cancel_and_rerun_workflow_lambda/app.py index 4b65788cab6..72fbe530bae 100644 --- a/tests/ci/cancel_and_rerun_workflow_lambda/app.py +++ b/tests/ci/cancel_and_rerun_workflow_lambda/app.py @@ -5,6 +5,7 @@ from typing import Any, Dict, List from threading import Thread from queue import Queue import json +import os import time import jwt @@ -20,7 +21,7 @@ NEED_RERUN_OR_CANCELL_WORKFLOWS = { # https://docs.github.com/en/rest/reference/actions#cancel-a-workflow-run # -API_URL = "https://api.github.com/repos/ClickHouse/ClickHouse" +API_URL = os.getenv("API_URL", "https://api.github.com/repos/ClickHouse/ClickHouse") MAX_RETRY = 5 diff --git a/tests/ci/workflow_approve_rerun_lambda/app.py b/tests/ci/workflow_approve_rerun_lambda/app.py index 545ba8c0355..43f15059980 100644 --- a/tests/ci/workflow_approve_rerun_lambda/app.py +++ b/tests/ci/workflow_approve_rerun_lambda/app.py @@ -1,15 +1,16 @@ #!/usr/bin/env python3 -import json -import time -import fnmatch from collections import namedtuple -import jwt +import fnmatch +import json +import os +import time +import jwt import requests # type: ignore import boto3 # type: ignore -API_URL = "https://api.github.com/repos/ClickHouse/ClickHouse" +API_URL = os.getenv("API_URL", "https://api.github.com/repos/ClickHouse/ClickHouse") SUSPICIOUS_CHANGED_FILES_NUMBER = 200