From b4f57a034d8d5c3fb99895c9a3aa4f199dfda034 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 06:53:40 +0000 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#205) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.7.0 → v0.7.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.7.0...v0.7.1) - [github.com/gitleaks/gitleaks: v8.21.1 → v8.21.2](https://github.com/gitleaks/gitleaks/compare/v8.21.1...v8.21.2) - [github.com/pre-commit/mirrors-mypy: v1.12.1 → v1.13.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.12.1...v1.13.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Meni Yakove <441263+myakove@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- ci_jobs_trigger/libs/openshift_ci/re_trigger/job_db.py | 5 ++--- .../tests/job_retriggering/test_job_triggering.py | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 82942ec..ec37394 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,19 +42,19 @@ repos: - id: detect-secrets - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.0 + rev: v0.7.1 hooks: - id: ruff args: [--fix] - id: ruff-format - repo: https://github.com/gitleaks/gitleaks - rev: v8.21.1 + rev: v8.21.2 hooks: - id: gitleaks - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.12.1 + rev: v1.13.0 hooks: - id: mypy additional_dependencies: [types-croniter, types-PyYAML, types-requests] diff --git a/ci_jobs_trigger/libs/openshift_ci/re_trigger/job_db.py b/ci_jobs_trigger/libs/openshift_ci/re_trigger/job_db.py index 25f67b3..d5ee418 100644 --- a/ci_jobs_trigger/libs/openshift_ci/re_trigger/job_db.py +++ b/ci_jobs_trigger/libs/openshift_ci/re_trigger/job_db.py @@ -19,8 +19,7 @@ def __enter__(self): self.connection = sqlite3.connect(self.db_path) self.cursor = self.connection.cursor() self.cursor.execute( - f"CREATE TABLE if not exists {self.table_name}(" - f"{self.job_name_column} TEXT, {self.prow_job_id_column} TEXT)" + f"CREATE TABLE if not exists {self.table_name}({self.job_name_column} TEXT, {self.prow_job_id_column} TEXT)" ) return self @@ -42,7 +41,7 @@ def check_prow_job_id_in_db(self, job_name, prow_job_id): def write(self, job_name, prow_job_id): def _insert_to_db(_job_name, _prow_job_id): self.cursor.execute( - f"INSERT INTO {self.table_name} " f"(job_name, prow_job_id) VALUES ('{_job_name}', '{_prow_job_id}')" + f"INSERT INTO {self.table_name} (job_name, prow_job_id) VALUES ('{_job_name}', '{_prow_job_id}')" ) for _ in TimeoutSampler( diff --git a/ci_jobs_trigger/tests/job_retriggering/test_job_triggering.py b/ci_jobs_trigger/tests/job_retriggering/test_job_triggering.py index f9280e3..78cc678 100644 --- a/ci_jobs_trigger/tests/job_retriggering/test_job_triggering.py +++ b/ci_jobs_trigger/tests/job_retriggering/test_job_triggering.py @@ -61,9 +61,9 @@ def test_failed_job_in_pre_phase(junit_file, job_triggering): ) def test_failed_job_in_tests_phase(junit_file, job_triggering): tests_dict = job_triggering.get_testsuites_testcase_from_junit_operator(junit_xml=junit_file) - assert not job_triggering.is_build_failed_on_setup( - tests_dict=tests_dict - ), "Job should fail on test phase but did not" + assert not job_triggering.is_build_failed_on_setup(tests_dict=tests_dict), ( + "Job should fail on test phase but did not" + ) class TestJobTriggering: