TTM: Add migration for the 'testing' status attribute

This commit is contained in:
Stephan Kulow 2019-04-15 10:27:53 +02:00
parent fcdd51b974
commit f5220af12d
2 changed files with 9 additions and 0 deletions

View File

@ -160,6 +160,7 @@ class ToTestPublisher(ToTestManager):
def publish(self, project, force=False): def publish(self, project, force=False):
self.setup(project) self.setup(project)
try: try:
current_snapshot = self.version_from_totest_project() current_snapshot = self.version_from_totest_project()
except NotFoundException as e: except NotFoundException as e:
@ -167,6 +168,11 @@ class ToTestPublisher(ToTestManager):
self.logger.warn(e) self.logger.warn(e)
current_snapshot = None current_snapshot = None
if not self.get_status('testing'):
# migrating. Normally the releaser maintains that snapshot, but to differentiate
# bootstrap of new project and migration we explicitly set 'NONE' if there is Nothing
self.update_status('testing', current_snapshot if current_snapshot else 'NONE')
group_id = self.openqa_group_id() group_id = self.openqa_group_id()
if self.get_status('publishing') == current_snapshot or self.get_status('published') == current_snapshot: if self.get_status('publishing') == current_snapshot or self.get_status('published') == current_snapshot:

View File

@ -28,6 +28,9 @@ class ToTestReleaser(ToTestManager):
self.setup(project) self.setup(project)
testing_snapshot = self.get_status('testing') testing_snapshot = self.get_status('testing')
if not testing_snapshot:
self.logger.debug("No snapshot in testing, waiting for publisher to tell us")
return None
new_snapshot = self.version_from_project() new_snapshot = self.version_from_project()
# not overwriting # not overwriting