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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
Romain Courteaud
slapos.core
Commits
f7b3441b
Commit
f7b3441b
authored
Jan 23, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_pdm: drop reviewRegistration
parent
913f0ef7
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1 addition
and
394 deletions
+1
-394
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/InstanceTree_createUpgradeDecision.py
...al_skins/slapos_pdm/InstanceTree_createUpgradeDecision.py
+0
-10
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudUpgradeSlapInterfaceWorkflow.py
.../test.erp5.testSlapOSCloudUpgradeSlapInterfaceWorkflow.py
+1
-196
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_reviewRegistration.py
...ace_workflow/script_UpgradeDecision_reviewRegistration.py
+0
-37
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_reviewRegistration.xml
...ce_workflow/script_UpgradeDecision_reviewRegistration.xml
+0
-84
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/state_draft.xml
..._workflow/upgrade_slap_interface_workflow/state_draft.xml
+0
-1
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/transition_review_registration.xml
...lap_interface_workflow/transition_review_registration.xml
+0
-66
No files found.
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/InstanceTree_createUpgradeDecision.py
View file @
f7b3441b
...
...
@@ -14,16 +14,6 @@ if portal.portal_catalog.getResultValue(
# There is already a upgrade decision, do nothing
return
"""
if decision_in_progress is not None:
if 1:
raise NotImplementedError('reviewRegistration')
decision_in_progress.reviewRegistration(
software_release_url=newer_release.getUrlString())
if decision_in_progress.getSimulationState() != "cancelled":
return
"""
# Check if UpgradeDecision_approveRegistration is running
# XXX we should instead look at the current upgrade decision state
tag
=
"%s_requestUpgradeDecisionCreation_inProgress"
%
instance_tree
.
getUid
()
...
...
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudUpgradeSlapInterfaceWorkflow.py
View file @
f7b3441b
...
...
@@ -233,201 +233,6 @@ class TestSlapOSCoreProjectSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self
.
assertEqual
(
2
,
self
.
portal
.
portal_activities
.
countMessageWithTag
(
tag
))
def
test_upgrade_decision_reviewRegistration_no_software_release_url
(
self
):
self
.
assertRaises
(
TypeError
,
self
.
upgrade_decision
.
reviewRegistration
)
def
test_upgrade_decision_reviewRegistration_draft
(
self
):
# Do nothing as draft
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
software_release
)
def
test_upgrade_decision_reviewRegistration
(
self
):
self
.
_addUpgradeLine
(
self
.
compute_node
)
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
software_release
)
self
.
assertEqual
(
"draft"
,
self
.
upgrade_decision
.
getSimulationState
())
self
.
upgrade_decision
.
plan
()
self
.
tic
()
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
software_release
)
self
.
assertEqual
(
"cancelled"
,
self
.
upgrade_decision
.
getSimulationState
())
def
test_upgrade_decision_reviewRegistration_confirm
(
self
):
self
.
_addUpgradeLine
(
self
.
compute_node
)
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
software_release
)
self
.
assertEqual
(
"draft"
,
self
.
upgrade_decision
.
getSimulationState
())
self
.
upgrade_decision
.
confirm
()
self
.
tic
()
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
software_release
)
self
.
assertEqual
(
"cancelled"
,
self
.
upgrade_decision
.
getSimulationState
())
def
test_upgrade_decision_reviewRegistration_rejected
(
self
):
self
.
_addUpgradeLine
(
self
.
compute_node
)
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
software_release
)
self
.
assertEqual
(
"draft"
,
self
.
upgrade_decision
.
getSimulationState
())
self
.
upgrade_decision
.
reject
()
self
.
tic
()
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
software_release
)
self
.
assertEqual
(
"rejected"
,
self
.
upgrade_decision
.
getSimulationState
())
def
test_upgrade_decision_reviewRegistration_same_url
(
self
):
self
.
_addUpgradeLine
(
self
.
compute_node
)
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
self
.
software_release
.
getUrlString
())
self
.
assertEqual
(
"draft"
,
self
.
upgrade_decision
.
getSimulationState
())
self
.
upgrade_decision
.
plan
()
self
.
tic
()
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
self
.
software_release
.
getUrlString
())
self
.
assertEqual
(
"planned"
,
self
.
upgrade_decision
.
getSimulationState
())
def
test_upgrade_decision_reviewRegistration_confirm_same_url
(
self
):
self
.
_addUpgradeLine
(
self
.
compute_node
)
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
self
.
software_release
.
getUrlString
())
self
.
assertEqual
(
"draft"
,
self
.
upgrade_decision
.
getSimulationState
())
self
.
upgrade_decision
.
confirm
()
self
.
tic
()
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
self
.
software_release
.
getUrlString
())
self
.
assertEqual
(
"confirmed"
,
self
.
upgrade_decision
.
getSimulationState
())
def
test_upgrade_decision_reviewRegistration_rejected_same_url
(
self
):
self
.
_addUpgradeLine
(
self
.
compute_node
)
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
self
.
software_release
.
getUrlString
())
self
.
assertEqual
(
"draft"
,
self
.
upgrade_decision
.
getSimulationState
())
self
.
upgrade_decision
.
reject
()
self
.
tic
()
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
self
.
software_release
.
getUrlString
())
self
.
assertEqual
(
"rejected"
,
self
.
upgrade_decision
.
getSimulationState
())
def
test_upgrade_decision_reviewRegistration_started
(
self
):
self
.
_addUpgradeLine
(
self
.
compute_node
)
software_release
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
software_release
)
self
.
assertEqual
(
"draft"
,
self
.
upgrade_decision
.
getSimulationState
())
self
.
upgrade_decision
.
plan
()
self
.
upgrade_decision
.
start
()
self
.
tic
()
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
software_release
)
self
.
assertEqual
(
"started"
,
self
.
upgrade_decision
.
getSimulationState
())
def
test_upgrade_decision_reviewRegistration_instance_tree
(
self
):
self
.
_makeTree
()
self
.
_addUpgradeLine
(
self
.
instance_tree
)
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
self
.
instance_tree
.
getUrlString
())
self
.
assertEqual
(
"draft"
,
self
.
upgrade_decision
.
getSimulationState
())
self
.
upgrade_decision
.
plan
()
self
.
tic
()
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
self
.
instance_tree
.
getUrlString
())
self
.
assertEqual
(
"cancelled"
,
self
.
upgrade_decision
.
getSimulationState
())
def
test_upgrade_decision_reviewRegistration_instance_tree_confirmed
(
self
):
self
.
_makeTree
()
self
.
_addUpgradeLine
(
self
.
instance_tree
)
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
self
.
instance_tree
.
getUrlString
())
self
.
assertEqual
(
"draft"
,
self
.
upgrade_decision
.
getSimulationState
())
self
.
upgrade_decision
.
confirm
()
self
.
tic
()
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
self
.
instance_tree
.
getUrlString
())
self
.
assertEqual
(
"cancelled"
,
self
.
upgrade_decision
.
getSimulationState
())
def
test_upgrade_decision_reviewRegistration_instance_tree_started
(
self
):
self
.
_makeTree
()
self
.
_addUpgradeLine
(
self
.
instance_tree
)
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
self
.
instance_tree
.
getUrlString
())
self
.
assertEqual
(
"draft"
,
self
.
upgrade_decision
.
getSimulationState
())
self
.
upgrade_decision
.
start
()
self
.
tic
()
self
.
upgrade_decision
.
reviewRegistration
(
software_release_url
=
self
.
instance_tree
.
getUrlString
())
self
.
assertEqual
(
"started"
,
self
.
upgrade_decision
.
getSimulationState
())
@
simulate
(
'InstanceTree_isUpgradePossible'
,
'software_release_url'
,
'return 1'
)
def
test_upgrade_decision_requestUpgrade_instance_tree
(
self
):
...
...
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_reviewRegistration.py
deleted
100644 → 0
View file @
913f0ef7
upgrade_decision
=
state_change
[
"object"
]
from
DateTime
import
DateTime
cancellable_state_list
=
[
'confirmed'
,
'planned'
]
require_state_list
=
[
'rejected'
,
'confirmed'
,
'planned'
]
simulation_state
=
upgrade_decision
.
getSimulationState
()
# Get required arguments
kwargs
=
state_change
.
kwargs
# Required args
# Raise TypeError if all parameters are not provided
try
:
software_release_url
=
kwargs
[
'software_release_url'
]
except
KeyError
:
raise
TypeError
(
"UpgradeDecision_reviewRegistration takes exactly 1 arguments"
)
if
simulation_state
in
require_state_list
:
current_release
=
upgrade_decision
.
UpgradeDecision_getAggregateValue
(
"Software Release"
)
if
not
current_release
:
# This upgrade decision is not valid
return
instance_tree
=
upgrade_decision
.
UpgradeDecision_getAggregateValue
(
"Instance Tree"
)
if
instance_tree
is
not
None
:
current_instance_tree_release
=
instance_tree
.
getUrlString
()
if
current_instance_tree_release
==
software_release_url
:
if
simulation_state
in
cancellable_state_list
:
upgrade_decision
.
cancel
(
comment
=
"Instance tree is already upgraded."
)
return
if
current_release
.
getUrlString
()
==
software_release_url
:
# Cannot cancel because the software releases are the same
return
False
if
simulation_state
in
cancellable_state_list
:
upgrade_decision
.
cancel
()
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_reviewRegistration.xml
deleted
100644 → 0
View file @
913f0ef7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Script"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
state_change
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
script_UpgradeDecision_reviewRegistration
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Script
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
UpgradeDecision_reviewRegistration
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/state_draft.xml
View file @
f7b3441b
...
...
@@ -19,7 +19,6 @@
<string>
destination/portal_workflow/upgrade_slap_interface_workflow/transition_approve_registration
</string>
<string>
destination/portal_workflow/upgrade_slap_interface_workflow/transition_notify
</string>
<string>
destination/portal_workflow/upgrade_slap_interface_workflow/transition_request_upgrade
</string>
<string>
destination/portal_workflow/upgrade_slap_interface_workflow/transition_review_registration
</string>
<string>
destination/portal_workflow/upgrade_slap_interface_workflow/transition_review_upgrade
</string>
</tuple>
</value>
...
...
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/transition_review_registration.xml
deleted
100644 → 0
View file @
913f0ef7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Transition"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
action_name
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/workflow
</string>
<string>
before_script/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_checkConsistency
</string>
<string>
after_script/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_reviewRegistration
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Cancel if the current upgrade isn\'t valid anymore.
</string>
</value>
</item>
<item>
<key>
<string>
guard_permission
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
transition_review_registration
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Transition
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Review Registration
</string>
</value>
</item>
<item>
<key>
<string>
trigger_type
</string>
</key>
<value>
<int>
2
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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