Skip to content

Commit

Permalink
When measuring the number of job runs within a time period with Jenki…
Browse files Browse the repository at this point in the history
…ns as source, don't throw an exception when a Jenkins pipeline build has no result yet.

Fixes #10610.
  • Loading branch information
fniessink committed Jan 13, 2025
1 parent 88f6eb0 commit ec6ca0b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ def _include_build(self, build: Build) -> bool:
result_types = [result_type.lower() for result_type in self._parameter("result_type")]
lookback_days = int(cast(str, self._parameter("lookback_days")))
build_datetime = datetime_from_timestamp(int(build["timestamp"]))
return days_ago(build_datetime) <= lookback_days and build["result"].lower() in result_types
return days_ago(build_datetime) <= lookback_days and build.get("result", "").lower() in result_types
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def setUp(self):
self.builds = [
{"result": "FAILURE", "timestamp": 1552686540953},
{"result": "SUCCESS", "timestamp": 1552686531953},
{"timestamp": 1552686531953},
]
self.job_url = "https://job"
self.job2_url = "https://job2"
1 change: 1 addition & 0 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ If your currently installed *Quality-time* version is not the latest version, pl
### Fixed

- Don't throw an exception when a Trivy JSON file contains vulnerabilities without fixed version information. Fixes [#10606](https://github.com/ICTU/quality-time/issues/10606).
- When measuring the number of job runs within a time period with Jenkins as source, don't throw an exception when a Jenkins pipeline build has no result yet. Fixes [#10610](https://github.com/ICTU/quality-time/issues/10610).

### Added

Expand Down

0 comments on commit ec6ca0b

Please sign in to comment.