From 6aee81da24bc72c088332b7efcdb1bea00c3fe3f Mon Sep 17 00:00:00 2001 From: Thomas Carmet Date: Thu, 28 Apr 2022 20:27:40 -0700 Subject: [PATCH] BERTE-565 fixup key error on html url for checksuites --- CHANGELOG | 7 ++++++- bert_e/git_host/github/__init__.py | 4 ++-- bert_e/git_host/github/schema.py | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2a8b66b0..c59ae487 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. -## [3.6.9] - 2022-04-25 + +## [3.6.11] - 2022-04-28 +# Fixed +- Fix Key error when retrieve html_url for checksuites + +## [3.6.10] - 2022-04-25 # Fixed - Fix Key error when workflow dispatch is triggered on the commit_status checked diff --git a/bert_e/git_host/github/__init__.py b/bert_e/git_host/github/__init__.py index 72634f03..4c38dd3f 100644 --- a/bert_e/git_host/github/__init__.py +++ b/bert_e/git_host/github/__init__.py @@ -544,8 +544,8 @@ def __init__(self, *args, **kwargs): @property def url(self): - def sort_f(check_run): - date = check_run.get('started_at') + def sort_f(check_suite): + date = check_suite.get('created_at') if date: return datetime.strptime(date, '%Y-%m-%dT%H:%M:%SZ') return datetime(year=1962, month=1, day=1) diff --git a/bert_e/git_host/github/schema.py b/bert_e/git_host/github/schema.py index f5ff372e..152da789 100644 --- a/bert_e/git_host/github/schema.py +++ b/bert_e/git_host/github/schema.py @@ -90,6 +90,8 @@ class CheckSuite(Schema): id = fields.Integer() head_sha = fields.Str() head_branch = fields.Str() + html_url = fields.Url() + created_at = fields.DateTime() status = fields.Str() conclusion = fields.Str(allow_none=True) repository = fields.Nested(Repo)