Commit 5fa3e55a authored by lukas.burgey's avatar lukas.burgey
Browse files

Publish more changes to DeploymentStates

parent c3056801
Pipeline #110562 passed with stage
in 1 minute and 23 seconds
......@@ -551,17 +551,17 @@ class DeploymentState(models.Model):
QUESTIONNAIRE: self.publish_to_user, # needs answers
},
NOT_DEPLOYED: {
DEPLOYED: REMOVAL_PENDING, # needs to get removed
DEPLOYMENT_PENDING: NOT_DEPLOYED, # aborting a deployment
DEPLOYED: [REMOVAL_PENDING, self.publish_to_user, self.publish_to_client], # needs to get removed
DEPLOYMENT_PENDING: [NOT_DEPLOYED, self.publish_to_user], # aborting a deployment
NOT_DEPLOYED: None, # already reached correct state
REMOVAL_PENDING: None, # already on the way to the correct state
# these four states indicate that the last deployment run was not successful
# we therefore can turn around an say that the we reached the NOT_DEPLOYED state
FAILED: NOT_DEPLOYED,
FAILED_PERMANENTLY: NOT_DEPLOYED,
REJECTED: NOT_DEPLOYED,
QUESTIONNAIRE: NOT_DEPLOYED,
FAILED: [NOT_DEPLOYED, self.publish_to_user],
FAILED_PERMANENTLY: [NOT_DEPLOYED, self.publish_to_user],
REJECTED: [NOT_DEPLOYED, self.publish_to_user],
QUESTIONNAIRE: [NOT_DEPLOYED, self.publish_to_user],
},
}
self._apply_transition(state_transitions)
......@@ -626,6 +626,7 @@ class DeploymentState(models.Model):
# same state
if self.state != state:
LOGGER.debug(self.msg('Target: {} | State: {} -> {}'.format(self.state_target, self.state, state)))
self.state = state
# reset the failed attempts if not failure
......@@ -634,8 +635,6 @@ class DeploymentState(models.Model):
self.save()
LOGGER.debug(self.msg('Target: {} | State: {} -> {}'.format(self.state_target, self.state, state)))
if publish_to_user:
self.publish_to_user()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment