Skip to content

Commit

Permalink
fix(send_kcidb): Do not crash if optional field is missing
Browse files Browse the repository at this point in the history
Some fields might be not present, as they are optional in model.
Also add this field in custom checkout, even it is not mandatory,
it is better to have it for consistency.

Signed-off-by: Denys Fedoryshchenko <[email protected]>
  • Loading branch information
nuclearcat committed Nov 7, 2024
1 parent 582e677 commit 7310cbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/lava_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,8 @@ async def checkout(data: ManualCheckout, request: Request,
"tree": treename,
"branch": branch,
"commit": commit,
"url": treeurl
"url": treeurl,
"tip_of_branch": False
}
},
"timeout": checkout_timeout.isoformat(),
Expand Down
6 changes: 3 additions & 3 deletions src/send_kcidb.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ def _parse_checkout_node(self, origin, checkout_node):
'git_repository_branch':
checkout_node['data']['kernel_revision']['branch'],
'git_commit_tags':
checkout_node['data']['kernel_revision']['commit_tags'],
checkout_node['data']['kernel_revision'].get('commit_tags'),
'git_commit_message':
checkout_node['data']['kernel_revision']['commit_message'],
checkout_node['data']['kernel_revision'].get('commit_message'),
'git_repository_branch_tip':
checkout_node['data']['kernel_revision']['tip_of_branch'],
checkout_node['data']['kernel_revision'].get('tip_of_branch'),
'start_time': self._set_timezone(checkout_node['created']),
'patchset_hash': '',
'misc': {
Expand Down

0 comments on commit 7310cbf

Please sign in to comment.