[autotest] Endpoints for syncing jobs and hqes back to master
The status of jobs that were completed on a shard should be visible
in the master AFE, so a human can easily see which jobs have been run in one
central place.
This adds the functionality to the AFE to retrieve newer versions of
jobs and hqes from shards.
BUG=None
DEPLOY=apache, afe
TEST=Ran Suites
Change-Id: I04c3401921a3f54bae6070639af805904952bf6a
Reviewed-on: https://chromium-review.googlesource.com/213901
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Jakob Jülich <jakobjuelich@chromium.org>
Tested-by: Jakob Jülich <jakobjuelich@chromium.org>
diff --git a/frontend/afe/model_logic.py b/frontend/afe/model_logic.py
index 6329bd0..c77c80a 100644
--- a/frontend/afe/model_logic.py
+++ b/frontend/afe/model_logic.py
@@ -1117,6 +1117,18 @@
return instance
+ def sanity_check_update_from_shard(self, shard, updated_serialized,
+ *args, **kwargs):
+ """Check if an update sent from a shard is legitimate.
+
+ @raises error.UnallowedRecordsSentToMaster if an update is not
+ legitimate.
+ """
+ raise NotImplementedError(
+ 'sanity_check_update_from_shard must be implemented by subclass %s '
+ 'for type %s' % type(self))
+
+
def update_from_serialized(self, serialized):
"""Updates local fields of an existing object from a serialized form.