From 625fda971747ecdf7ce51c00e214c4f8c52add95 Mon Sep 17 00:00:00 2001 From: WizzzOzzz Ori Wiesel <155454910+WizzzOzzz-Ori@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:09:04 +0200 Subject: [PATCH 1/7] Create CONTRIBUTING.md --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..e6cbb99 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,2 @@ +Remove the job_poll_interval: int in client.py so that there won't be a problem with the parameter later. +The error "TypeError: 'str' object cannot be interpreted as an integer" is received. From b07b586710f092716fd784d576ea9521433aac5a Mon Sep 17 00:00:00 2001 From: WizzzOzzz Ori Wiesel <155454910+WizzzOzzz-Ori@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:42:28 +0200 Subject: [PATCH 2/7] Update client.py --- jenkins_client/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins_client/client.py b/jenkins_client/client.py index e15acc3..4e4239a 100644 --- a/jenkins_client/client.py +++ b/jenkins_client/client.py @@ -39,7 +39,7 @@ def list_jobs(self) -> list: job_names_list = [item[0] for item in self._jenkins.items()] return job_names_list - def start_job(self, job_name: str, params: dict = None, wait_for_result: bool = True, job_poll_interval: int = 20): + def start_job(self, job_name: str, params: dict = None, wait_for_result: bool = True, job_poll_interval = 20): """Start a job and poll it until it's over or timed out.""" if params is not None and type(params) is not dict: print(type(params)) From c90069c7da34993c8357e17f9addcbcbaeeae6ba Mon Sep 17 00:00:00 2001 From: WizzzOzzz Ori Wiesel <155454910+WizzzOzzz-Ori@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:50:12 +0200 Subject: [PATCH 3/7] Update client.py --- jenkins_client/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins_client/client.py b/jenkins_client/client.py index 4e4239a..fee6448 100644 --- a/jenkins_client/client.py +++ b/jenkins_client/client.py @@ -108,7 +108,7 @@ def _poll_build_for_status(self, build: Build, job_poll_interval): logging.info(f"Overall timeout: No status before timeout of {self.overall_max_timeout} secs") sys.exit(1) - time.sleep(job_poll_interval) + time.sleep(45) if __name__ == "__main__": From d9db8001e99cf97c8d050103f7fe5d644406a877 Mon Sep 17 00:00:00 2001 From: WizzzOzzz Ori Wiesel <155454910+WizzzOzzz-Ori@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:56:32 +0200 Subject: [PATCH 4/7] Update client.py --- jenkins_client/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins_client/client.py b/jenkins_client/client.py index fee6448..694eb4a 100644 --- a/jenkins_client/client.py +++ b/jenkins_client/client.py @@ -108,7 +108,7 @@ def _poll_build_for_status(self, build: Build, job_poll_interval): logging.info(f"Overall timeout: No status before timeout of {self.overall_max_timeout} secs") sys.exit(1) - time.sleep(45) + time.sleep(15) if __name__ == "__main__": From d8e4e34f2f62bdfd81aa45b260084674811a13be Mon Sep 17 00:00:00 2001 From: Ori Wizzz Wiesel Date: Mon, 24 Feb 2025 20:09:36 +0200 Subject: [PATCH 5/7] fix --- action.yml | 1 + jenkins_client/client.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 5f0b10c..17fcf94 100644 --- a/action.yml +++ b/action.yml @@ -26,6 +26,7 @@ polling_interval: description: 'Interval to poll for result' required: false + default: 15 runs: image: "Dockerfile" diff --git a/jenkins_client/client.py b/jenkins_client/client.py index 694eb4a..4c99a29 100644 --- a/jenkins_client/client.py +++ b/jenkins_client/client.py @@ -100,7 +100,7 @@ def _poll_build_for_status(self, build: Build, job_poll_interval): sys.exit(1) else: logging.info( - f"{time.ctime()} | Job: {build.job.name} | Status: The job is still running. Polling again in {self.job_poll_interval} secs" + f"{time.ctime()} | Job: {build.job.name} | Status: The job is still running. Polling again in {job_poll_interval} secs" ) cur_epoch = int(time.time()) @@ -108,7 +108,7 @@ def _poll_build_for_status(self, build: Build, job_poll_interval): logging.info(f"Overall timeout: No status before timeout of {self.overall_max_timeout} secs") sys.exit(1) - time.sleep(15) + time.sleep(job_poll_interval) if __name__ == "__main__": From 40566c8d386fd5eb4cb028bc896383c3d53f82c8 Mon Sep 17 00:00:00 2001 From: WizzzOzzz Ori Wiesel <155454910+WizzzOzzz-Ori@users.noreply.github.com> Date: Tue, 25 Feb 2025 13:45:19 +0200 Subject: [PATCH 6/7] Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5e7105..85ce22d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,12 @@ - fix precommit issues - **client.py**: bump timeout to one hour +## v1.3.4 (2025-05-25) + +### Fix + +- **action.yml**: Add default value for _polling_interval_ so it won't take default value as String + ## v1.3.3 (2023-05-15) ### Fix From b45b2cbd86f9765c9f3534603f2dd6cdb457ab47 Mon Sep 17 00:00:00 2001 From: WizzzOzzz Ori Wiesel <155454910+WizzzOzzz-Ori@users.noreply.github.com> Date: Tue, 25 Feb 2025 13:45:41 +0200 Subject: [PATCH 7/7] Update CONTRIBUTING.md --- CONTRIBUTING.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e6cbb99..3fd8289 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,2 +1 @@ -Remove the job_poll_interval: int in client.py so that there won't be a problem with the parameter later. -The error "TypeError: 'str' object cannot be interpreted as an integer" is received. +action.yml: Add default value for polling_interval so it won't take default value as String