Skip to content

Commit

Permalink
fix(plugins/core): Handle missing tests in get_assignment calls
Browse files Browse the repository at this point in the history
This commit fixes an issue where generic runs would fail to submit due
to not finding a test entity associated with a run when storing a
version. It adds exception handling to submit_product_version on every
plugin to fix that.

Fixes scylladb#524
  • Loading branch information
k0machi committed Nov 28, 2024
1 parent 0e4df14 commit 0b8b77d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
6 changes: 5 additions & 1 deletion argus/backend/plugins/driver_matrix_tests/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from uuid import UUID
from xml.etree import ElementTree
from cassandra.cqlengine import columns
from cassandra.cqlengine.models import Model
from argus.backend.db import ScyllaCluster
from argus.backend.models.web import ArgusRelease
from argus.backend.plugins.core import PluginModelBase
Expand Down Expand Up @@ -412,7 +413,10 @@ def get_events(self) -> list:

def submit_product_version(self, version: str):
self.scylla_version = version
new_assignee = self.get_assignment(version)
try:
new_assignee = self.get_assignment(version)
except Model.DoesNotExist:
new_assignee = None
if new_assignee:
self.assignee = new_assignee

Expand Down
5 changes: 4 additions & 1 deletion argus/backend/plugins/generic/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ def submit_product_version(self, version: str):
pattern = re.compile(r"((?P<short>[\w.~]+)-(?P<build>(0\.)?(?P<date>[0-9]{8,8})\.(?P<commit>\w+).*))")
if match := pattern.search(version):
self.scylla_version = match.group("short")
new_assignee = self.get_assignment(match.group("short"))
try:
new_assignee = self.get_assignment(match.group("short"))
except Model.DoesNotExist:
new_assignee = None
if new_assignee:
self.assignee = new_assignee
self.set_full_version(version)
Expand Down
5 changes: 4 additions & 1 deletion argus/backend/plugins/sct/testrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ def get_events(self) -> list[EventsBySeverity]:

def submit_product_version(self, version: str):
self.scylla_version = version
new_assignee = self.get_assignment(version)
try:
new_assignee = self.get_assignment(version)
except Model.DoesNotExist:
new_assignee = None
if new_assignee:
self.assignee = new_assignee

Expand Down
5 changes: 4 additions & 1 deletion argus/backend/plugins/sirenada/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ def get_distinct_product_versions(cls, release: ArgusRelease, cluster: ScyllaClu

def submit_product_version(self, version: str):
self.scylla_version = version
new_assignee = self.get_assignment(version)
try:
new_assignee = self.get_assignment(version)
except Model.DoesNotExist:
new_assignee = None
if new_assignee:
self.assignee = new_assignee

Expand Down

0 comments on commit 0b8b77d

Please sign in to comment.