Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
5a474470
Commit
5a474470
authored
Jul 12, 2022
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_pdm: Only cancel if Software Product is invalidated
parent
95e44779
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
27 deletions
+18
-27
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSPDMSkins.py
+11
-2
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMSkins.xml
...teItem/portal_components/test.erp5.testSlapOSPDMSkins.xml
+3
-24
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_reviewUpgrade.py
...nterface_workflow/script_UpgradeDecision_reviewUpgrade.py
+4
-1
No files found.
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMSkins.py
View file @
5a474470
...
@@ -1336,16 +1336,22 @@ ${new_software_release_url}""",
...
@@ -1336,16 +1336,22 @@ ${new_software_release_url}""",
def
testUpgradeDecisionLine_cancel_archived_software_release
(
self
):
def
testUpgradeDecisionLine_cancel_archived_software_release
(
self
):
software_release
=
self
.
_makeSoftwareRelease
()
software_release
=
self
.
_makeSoftwareRelease
()
software_product
=
self
.
_makeSoftwareProduct
()
upgrade_decision
=
self
.
_makeUpgradeDecision
()
upgrade_decision
=
self
.
_makeUpgradeDecision
()
upgrade_decision_line
=
self
.
_makeUpgradeDecisionLine
(
upgrade_decision
)
upgrade_decision_line
=
self
.
_makeUpgradeDecisionLine
(
upgrade_decision
)
upgrade_decision_line
.
setAggregateValueList
([
software_release
])
upgrade_decision_line
.
setAggregateValueList
([
software_release
])
software_release
.
setAggregateValue
(
software_product
)
self
.
tic
()
self
.
tic
()
software_release
.
archive
()
software_release
.
archive
()
upgrade_decision_line
.
UpgradeDecisionLine_cancel
()
self
.
assertEqual
(
'draft'
,
upgrade_decision
.
getSimulationState
())
software_product
.
invalidate
()
upgrade_decision_line
.
UpgradeDecisionLine_cancel
()
upgrade_decision_line
.
UpgradeDecisionLine_cancel
()
self
.
assertEqual
(
'cancelled'
,
upgrade_decision
.
getSimulationState
())
self
.
assertEqual
(
'cancelled'
,
upgrade_decision
.
getSimulationState
())
workflow_history_list
=
upgrade_decision
.
Base_getWorkflowHistoryItemList
(
'upgrade_decision_workflow'
,
display
=
0
)
workflow_history_list
=
upgrade_decision
.
Base_getWorkflowHistoryItemList
(
'upgrade_decision_workflow'
,
display
=
0
)
self
.
assertEqual
(
"Software
Release is archiv
ed."
,
workflow_history_list
[
-
1
].
comment
)
self
.
assertEqual
(
"Software
Product is invalidat
ed."
,
workflow_history_list
[
-
1
].
comment
)
@
simulate
(
'NotificationTool_getDocumentValue'
,
@
simulate
(
'NotificationTool_getDocumentValue'
,
'reference=None'
,
'reference=None'
,
...
@@ -1445,6 +1451,8 @@ ${new_software_release_url}""",
...
@@ -1445,6 +1451,8 @@ ${new_software_release_url}""",
'context.REQUEST["testUpgradeDecisionLine_cancel_destroyed_hs_archived_sr"])'
)
'context.REQUEST["testUpgradeDecisionLine_cancel_destroyed_hs_archived_sr"])'
)
def
testUpgradeDecisionLine_cancel_destroyed_hs_archived_sr
(
self
):
def
testUpgradeDecisionLine_cancel_destroyed_hs_archived_sr
(
self
):
software_release
=
self
.
_makeSoftwareRelease
()
software_release
=
self
.
_makeSoftwareRelease
()
software_product
=
self
.
_makeSoftwareProduct
()
software_release
.
setAggregateValue
(
software_product
)
instance_tree
=
self
.
_makeFullInstanceTree
(
software_release
.
getUrlString
())
instance_tree
=
self
.
_makeFullInstanceTree
(
software_release
.
getUrlString
())
upgrade_decision
=
self
.
_makeUpgradeDecision
()
upgrade_decision
=
self
.
_makeUpgradeDecision
()
...
@@ -1478,9 +1486,10 @@ ${new_software_release_url}""",
...
@@ -1478,9 +1486,10 @@ ${new_software_release_url}""",
)
)
instance_tree
.
requestDestroy
(
**
kw
)
instance_tree
.
requestDestroy
(
**
kw
)
software_release
.
archive
()
software_release
.
archive
()
software_product
.
invalidate
()
self
.
tic
()
self
.
tic
()
upgrade_decision_line
.
UpgradeDecisionLine_cancel
()
upgrade_decision_line
.
UpgradeDecisionLine_cancel
()
self
.
assertEqual
(
'cancelled'
,
upgrade_decision
.
getSimulationState
())
self
.
assertEqual
(
'cancelled'
,
upgrade_decision
.
getSimulationState
())
workflow_history_list
=
upgrade_decision
.
Base_getWorkflowHistoryItemList
(
'upgrade_decision_workflow'
,
display
=
0
)
workflow_history_list
=
upgrade_decision
.
Base_getWorkflowHistoryItemList
(
'upgrade_decision_workflow'
,
display
=
0
)
self
.
assertEqual
(
"Software
Release is archiv
ed."
,
workflow_history_list
[
-
1
].
comment
)
self
.
assertEqual
(
"Software
Product is invalidat
ed."
,
workflow_history_list
[
-
1
].
comment
)
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMSkins.xml
View file @
5a474470
...
@@ -6,12 +6,6 @@
...
@@ -6,12 +6,6 @@
</pickle>
</pickle>
<pickle>
<pickle>
<dictionary>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<item>
<key>
<string>
default_reference
</string>
</key>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testSlapOSPDMSkins
</string>
</value>
<value>
<string>
testSlapOSPDMSkins
</string>
</value>
...
@@ -55,28 +49,13 @@
...
@@ -55,28 +49,13 @@
<item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<key>
<string>
workflow_history
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
</pickle>
...
@@ -89,7 +68,7 @@
...
@@ -89,7 +68,7 @@
<item>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
...
@@ -98,7 +77,7 @@
...
@@ -98,7 +77,7 @@
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
</pickle>
...
...
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_reviewUpgrade.py
View file @
5a474470
...
@@ -10,7 +10,10 @@ if upgrade_decision.getSimulationState() == "cancelled":
...
@@ -10,7 +10,10 @@ if upgrade_decision.getSimulationState() == "cancelled":
return
return
if
software_release
.
getValidationState
()
==
"archived"
:
if
software_release
.
getValidationState
()
==
"archived"
:
upgrade_decision
.
cancel
(
comment
=
"Software Release is archived."
)
software_product
=
software_release
.
getAggregateValue
()
if
software_product
is
not
None
and
\
software_product
.
getValidationState
()
==
"invalidated"
:
upgrade_decision
.
cancel
(
comment
=
"Software Product is invalidated."
)
return
return
if
instance_tree
is
not
None
:
if
instance_tree
is
not
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