Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
feudalBackend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
16
Issues
16
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
feudal
feudalBackend
Commits
edd43b08
Commit
edd43b08
authored
Sep 25, 2020
by
lukas.burgey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Publish more changes to the DepStates
parent
8fa1b254
Pipeline
#110805
passed with stage
in 1 minute and 34 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
feudal/backend/models/deployments.py
feudal/backend/models/deployments.py
+9
-8
No files found.
feudal/backend/models/deployments.py
View file @
edd43b08
...
...
@@ -414,7 +414,6 @@ class DeploymentState(models.Model):
return
state
,
created
# adds the deployment to our related deployments
def
bind_to_deployment
(
self
,
deployment
):
if
not
self
.
deployments
.
filter
(
id
=
deployment
.
id
).
exists
():
...
...
@@ -507,20 +506,20 @@ class DeploymentState(models.Model):
REJECTED
:
None
,
# client will not execute the deployment
FAILED
:
None
,
# the client will retry this deployment via polling
FAILED_PERMANENTLY
:
None
,
# the client will retry this deployment when it restarts
QUESTIONNAIRE
:
self
.
publish_to_user
,
# needs answers
QUESTIONNAIRE
:
None
,
# needs answers
},
NOT_DEPLOYED
:
{
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
DEPLOYED
:
[
REMOVAL_PENDING
,
self
.
publish_to_client
],
# needs to get removed
DEPLOYMENT_PENDING
:
NOT_DEPLOYED
,
# 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
,
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
]
,
FAILED
:
NOT_DEPLOYED
,
FAILED_PERMANENTLY
:
NOT_DEPLOYED
,
REJECTED
:
NOT_DEPLOYED
,
QUESTIONNAIRE
:
NOT_DEPLOYED
,
},
}
self
.
_apply_transition
(
state_transitions
)
...
...
@@ -594,6 +593,8 @@ class DeploymentState(models.Model):
self
.
save
()
self
.
publish_to_user
()
# always publish to the use when the state changes
def
publish_to_user
(
self
):
if
self
.
user
is
None
:
LOGGER
.
debug
(
self
.
msg
(
'publish_to_user: User is None'
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment