"skip testing" button
Something like:
how it would work:
POST to /series/{sid}/revisions/{rid}/skiptesting
This would require following changes:
diff --git a/patchwork/models.py b/patchwork/models.py
index 627dd2b..8b882a6 100644
--- a/patchwork/models.py
+++ b/patchwork/models.py
@@ -625,6 +625,7 @@ class SeriesRevision(models.Model):
state_summary = jsonfield.JSONField(null=True)
test_state = models.SmallIntegerField(choices=TestState.STATE_CHOICES,
null=True, blank=True)
+ skip_testing = models.BooleanField(default=False)
class Meta:
unique_together = [('series', 'version')]
diff --git a/patchwork/views/api.py b/patchwork/views/api.py
index 28dba80..df53952 100644
--- a/patchwork/views/api.py
+++ b/patchwork/views/api.py
@@ -321,6 +321,18 @@ class RevisionViewSet(mixins.ListModelMixin, ListMixin,
log.save()
return HttpResponse()
+ @detail_route(methods=['post'])
+ def skiptesting(self, request, series_pk=None, pk=None):
+ rev = get_object_or_404(SeriesRevision, series=series_pk, version=pk)
+
+ # make sure the user is a maintainer
+ self.check_object_permissions(request, rev.series)
+
+ rev.skip_testing = True
+ rev.save()
+
+ return HttpResponse()
+
class ResultMixin(object):
Then it would be for any CI system that manages exection to query /series/{sid}/revisions/{rid}
before any stage of execution to see whether the run is still valid (i.e. not skipped).
Let's also be explicit that the series is already marked as skipped via <button disabled class="btn btn-danger">
: