Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions cylc/flow/cfgspec/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2158,49 +2158,58 @@ def upg(
'8.0.0',
['cylc', 'task event mail interval'],
['cylc', 'mail', 'task event batch interval'],
remove_at='8.9'
)
u.deprecate(
'8.0.0',
['runtime', '__MANY__', 'suite state polling'],
['runtime', '__MANY__', 'workflow state polling'],
is_section=True,
remove_at='8.9'
)
u.obsolete(
'8.0.0', ['runtime', '__MANY__', 'workflow state polling', 'host'])
'8.0.0', ['runtime', '__MANY__', 'workflow state polling', 'host']
)
u.obsolete(
'8.0.0', ['runtime', '__MANY__', 'workflow state polling', 'user'])
'8.0.0', ['runtime', '__MANY__', 'workflow state polling', 'user']
)

u.deprecate(
'8.3.0',
['runtime', '__MANY__', 'workflow state polling', 'run-dir'],
['runtime', '__MANY__', 'workflow state polling', 'alt-cylc-run-dir'],
remove_at='8.9'
)

u.deprecate(
'8.0.0',
['cylc', 'parameters'],
['task parameters'],
is_section=True,
remove_at='8.9'
)
u.deprecate(
'8.0.0',
['cylc', 'parameter templates'],
['task parameters', 'templates'],
is_section=True,
remove_at='8.9'
)
# Whole workflow task mail settings
for mail_setting in ['to', 'from', 'footer']:
u.deprecate(
'8.0.0',
['cylc', 'events', f'mail {mail_setting}'],
['cylc', 'mail', mail_setting],
remove_at='8.9'
)
# Task mail settings in [runtime][TASK]
for mail_setting in ['to', 'from']:
u.deprecate(
'8.0.0',
['runtime', '__MANY__', 'events', f'mail {mail_setting}'],
['runtime', '__MANY__', 'mail', mail_setting],
remove_at='8.9'
)
u.deprecate(
'8.0.0',
Expand All @@ -2210,6 +2219,7 @@ def upg(
'DELETED (OBSOLETE) - use "global.cylc[scheduler][mail]smtp" '
'instead')
),
remove_at='8.9'
)
u.deprecate(
'8.0.0',
Expand All @@ -2219,20 +2229,23 @@ def upg(
'DELETED (OBSOLETE) - use "global.cylc[scheduler][mail]smtp" '
'instead')
),
remove_at='8.9'
)
u.deprecate(
'8.0.0',
['scheduling', 'max active cycle points'],
['scheduling', 'runahead limit'],
cvtr=converter(
lambda x: f'P{int(x) - 1}' if x != '' else '',
'"{old}" -> "{new}"'
'"{old}" -> "{new}"',
),
remove_at='8.9'
)
u.deprecate(
'8.0.0',
['scheduling', 'hold after point'],
['scheduling', 'hold after cycle point'],
remove_at='8.9'
)

for job_setting in [
Expand All @@ -2246,6 +2259,7 @@ def upg(
'8.0.0',
['runtime', '__MANY__', 'job', job_setting],
['runtime', '__MANY__', job_setting],
remove_at='8.9'
)

# Workflow timeout is now measured from start of run.
Expand All @@ -2266,6 +2280,7 @@ def upg(
'8.0.0',
['cylc', 'events', old],
['cylc', 'events', new],
remove_at='8.9',
)

for old in [
Expand All @@ -2288,6 +2303,7 @@ def upg(
'8.0.0',
['runtime', '__MANY__', 'events', old],
['runtime', '__MANY__', 'events', f"{old}s"],
remove_at='8.9',
)

for old in [
Expand All @@ -2298,13 +2314,14 @@ def upg(
'abort if inactivity handler fails',
'abort if stalled handler fails',
]:
u.obsolete('8.0.0', ['cylc', 'events', old])
u.obsolete('8.0.0', ['cylc', 'events', old,])

u.deprecate(
'8.0.0',
['cylc'],
['scheduler'],
is_section=True,
remove_at='8.9'
)
u.upgrade()

Expand Down Expand Up @@ -2359,7 +2376,8 @@ def upgrade_graph_section(cfg: Dict[str, Any], descr: str) -> None:
if keys:
msg = (
'graph items were automatically upgraded '
f'in "{descr}":\n'
f'in "{descr}" - support for the old item will be '
'removed at Cylc 8.9:\n'
f' * (8.0.0) {msg_old} -> {msg_new}'
)
if list_cp:
Expand Down
12 changes: 9 additions & 3 deletions cylc/flow/parsec/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self, cfg: dict, descr: str, broadcast: bool = False):

def deprecate(
self, vn, oldkeys, newkeys=None,
cvtr=None, is_section=False,
cvtr=None, is_section=False, remove_at=None
):
"""Replace a deprecated key from a config
Args:
Expand All @@ -84,6 +84,8 @@ def deprecate(
description of that function.
is_section (bool):
Is a section heading.
remove_at (str):
Cylc version when this upgrader will be removed
"""
if vn not in self.upgrades:
self.upgrades[vn] = []
Expand All @@ -92,7 +94,7 @@ def deprecate(
self.upgrades[vn].append(
{
'old': oldkeys, 'new': newkeys, 'cvt': cvtr,
'is_section': is_section
'is_section': is_section, 'remove_at': remove_at
})

def obsolete(self, vn, oldkeys, is_section=False):
Expand Down Expand Up @@ -182,7 +184,7 @@ def expand(self, upg):
'old': pre + [m] + post,
'new': None,
'cvt': upg['cvt'],
'is_section': upg['is_section'],
'is_section': upg['is_section']
})
return exp_upgs
npre = []
Expand All @@ -200,6 +202,7 @@ def expand(self, upg):
'new': npre + [m] + npost,
'cvt': upg['cvt'],
'is_section': upg['is_section'],
'remove_at': upg.get('remove_at')
})
return exp_upgs

Expand Down Expand Up @@ -232,6 +235,9 @@ def upgrade(self):
old=old,
new=upg['cvt'].convert(old)
)
if (remove_at := upg.get('remove_at')) is not None:
msg += (f' - support for the old item will be '
f'removed at Cylc {remove_at}')
warnings.setdefault(vn, [])
warnings[vn].append(msg)
self.del_item(upg['old'])
Expand Down
58 changes: 29 additions & 29 deletions tests/functional/deprecations/01-cylc8-basic/validation.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,41 @@ WARNING - * (8.0.0) [cylc][environment] - DELETED (OBSOLETE)
WARNING - * (8.0.0) [cylc][reference test] - DELETED (OBSOLETE)
Comment thread
Scott-Owen-James marked this conversation as resolved.
Outdated
WARNING - * (8.0.0) [cylc][simulation]disable suite event handlers - DELETED (OBSOLETE)
WARNING - * (8.0.0) [cylc][simulation] - DELETED (OBSOLETE)
WARNING - * (8.0.0) [cylc]task event mail interval -> [cylc][mail]task event batch interval - value unchanged
WARNING - * (8.0.0) [runtime][foo, cat, dog][suite state polling] -> [runtime][foo, cat, dog][workflow state polling] - value unchanged
WARNING - * (8.0.0) [cylc][parameters] -> [task parameters] - value unchanged
WARNING - * (8.0.0) [cylc][parameter templates] -> [task parameters][templates] - value unchanged
WARNING - * (8.0.0) [cylc][events]mail to -> [cylc][mail]to - value unchanged
WARNING - * (8.0.0) [cylc][events]mail from -> [cylc][mail]from - value unchanged
WARNING - * (8.0.0) [cylc][events]mail footer -> [cylc][mail]footer - value unchanged
WARNING - * (8.0.0) [runtime][foo, cat, dog][events]mail to -> [runtime][foo, cat, dog][mail]to - value unchanged
WARNING - * (8.0.0) [runtime][foo, cat, dog][events]mail from -> [runtime][foo, cat, dog][mail]from - value unchanged
WARNING - * (8.0.0) [cylc][events]mail smtp - DELETED (OBSOLETE) - use "global.cylc[scheduler][mail]smtp" instead
WARNING - * (8.0.0) [cylc]task event mail interval -> [cylc][mail]task event batch interval - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [runtime][foo, cat, dog][suite state polling] -> [runtime][foo, cat, dog][workflow state polling] - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [cylc][parameters] -> [task parameters] - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [cylc][parameter templates] -> [task parameters][templates] - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [cylc][events]mail to -> [cylc][mail]to - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [cylc][events]mail from -> [cylc][mail]from - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [cylc][events]mail footer -> [cylc][mail]footer - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [runtime][foo, cat, dog][events]mail to -> [runtime][foo, cat, dog][mail]to - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [runtime][foo, cat, dog][events]mail from -> [runtime][foo, cat, dog][mail]from - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [cylc][events]mail smtp - DELETED (OBSOLETE) - use "global.cylc[scheduler][mail]smtp" instead - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [runtime][foo, cat, dog][events]mail smtp - DELETED (OBSOLETE) - use "global.cylc[scheduler][mail]smtp" instead
WARNING - * (8.0.0) [scheduling]max active cycle points -> [scheduling]runahead limit - "2" -> "P1"
WARNING - * (8.0.0) [scheduling]hold after point -> [scheduling]hold after cycle point - value unchanged
WARNING - * (8.0.0) [runtime][foo, cat, dog][job]execution polling intervals -> [runtime][foo, cat, dog]execution polling intervals - value unchanged
WARNING - * (8.0.0) [runtime][foo, cat, dog][job]execution retry delays -> [runtime][foo, cat, dog]execution retry delays - value unchanged
WARNING - * (8.0.0) [runtime][foo, cat, dog][job]execution time limit -> [runtime][foo, cat, dog]execution time limit - value unchanged
WARNING - * (8.0.0) [runtime][foo, cat, dog][job]submission polling intervals -> [runtime][foo, cat, dog]submission polling intervals - value unchanged
WARNING - * (8.0.0) [runtime][foo, cat, dog][job]submission retry delays -> [runtime][foo, cat, dog]submission retry delays - value unchanged
WARNING - * (8.0.0) [cylc][events]timeout -> [cylc][events]stall timeout - value unchanged
WARNING - * (8.0.0) [cylc][events]abort on timeout -> [cylc][events]abort on stall timeout - value unchanged
WARNING - * (8.0.0) [cylc][events]inactivity -> [cylc][events]inactivity timeout - value unchanged
WARNING - * (8.0.0) [cylc][events]abort on inactivity -> [cylc][events]abort on inactivity timeout - value unchanged
WARNING - * (8.0.0) [cylc][events]startup handler -> [cylc][events]startup handlers - value unchanged
WARNING - * (8.0.0) [cylc][events]shutdown handler -> [cylc][events]shutdown handlers - value unchanged
WARNING - * (8.0.0) [cylc][events]timeout handler -> [cylc][events]stall timeout handlers - value unchanged
WARNING - * (8.0.0) [cylc][events]stalled handler -> [cylc][events]stall handlers - value unchanged
WARNING - * (8.0.0) [cylc][events]aborted handler -> [cylc][events]abort handlers - value unchanged
WARNING - * (8.0.0) [cylc][events]inactivity handler -> [cylc][events]inactivity timeout handlers - value unchanged
WARNING - * (8.0.0) [scheduling]max active cycle points -> [scheduling]runahead limit - "2" -> "P1" - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [scheduling]hold after point -> [scheduling]hold after cycle point - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [runtime][foo, cat, dog][job]execution polling intervals -> [runtime][foo, cat, dog]execution polling intervals - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [runtime][foo, cat, dog][job]execution retry delays -> [runtime][foo, cat, dog]execution retry delays - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [runtime][foo, cat, dog][job]execution time limit -> [runtime][foo, cat, dog]execution time limit - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [runtime][foo, cat, dog][job]submission polling intervals -> [runtime][foo, cat, dog]submission polling intervals - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [runtime][foo, cat, dog][job]submission retry delays -> [runtime][foo, cat, dog]submission retry delays - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [cylc][events]timeout -> [cylc][events]stall timeout - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [cylc][events]abort on timeout -> [cylc][events]abort on stall timeout - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [cylc][events]inactivity -> [cylc][events]inactivity timeout - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [cylc][events]abort on inactivity -> [cylc][events]abort on inactivity timeout - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [cylc][events]startup handler -> [cylc][events]startup handlers - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [cylc][events]shutdown handler -> [cylc][events]shutdown handlers - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [cylc][events]timeout handler -> [cylc][events]stall timeout handlers - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [cylc][events]stalled handler -> [cylc][events]stall handlers - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [cylc][events]aborted handler -> [cylc][events]abort handlers - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [cylc][events]inactivity handler -> [cylc][events]inactivity timeout handlers - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - * (8.0.0) [cylc][events]abort on stalled - DELETED (OBSOLETE)
WARNING - * (8.0.0) [cylc][events]abort if startup handler fails - DELETED (OBSOLETE)
WARNING - * (8.0.0) [cylc][events]abort if shutdown handler fails - DELETED (OBSOLETE)
WARNING - * (8.0.0) [cylc][events]abort if timeout handler fails - DELETED (OBSOLETE)
WARNING - * (8.0.0) [cylc][events]abort if inactivity handler fails - DELETED (OBSOLETE)
WARNING - * (8.0.0) [cylc][events]abort if stalled handler fails - DELETED (OBSOLETE)
WARNING - * (8.0.0) [cylc] -> [scheduler] - value unchanged
WARNING - graph items were automatically upgraded in "workflow definition":
WARNING - * (8.0.0) [cylc] -> [scheduler] - value unchanged - support for the old item will be removed at Cylc 8.9
WARNING - graph items were automatically upgraded in "workflow definition" - support for the old item will be removed at Cylc 8.9:
* (8.0.0) [scheduling][dependencies][X]graph -> [scheduling][graph]X - for X in:
P1D
12 changes: 8 additions & 4 deletions tests/integration/scripts/test_validate_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def test_validate_simple_graph(flow, validate, caplog):
validate(id_)
expect = (
'graph items were automatically upgraded'
' in "workflow definition":'
' in "workflow definition" - support for the old item will be '
'removed at Cylc 8.9:'
'\n * (8.0.0) [scheduling][dependencies]graph -> [scheduling][graph]R1'
)
assert expect in caplog.messages
Expand Down Expand Up @@ -156,8 +157,10 @@ def test_pre_cylc8(flow, validate, caplog):
(
' * (8.0.0) [runtime][foo, cat, dog][suite state polling]'
' -> [runtime][foo, cat, dog][workflow state polling]'
' - value unchanged'),
' * (8.0.0) [cylc] -> [scheduler] - value unchanged'
' - value unchanged - support for the old item will be '
'removed at Cylc 8.9'),
(' * (8.0.0) [cylc] -> [scheduler] - value unchanged'
' - support for the old item will be removed at Cylc 8.9')
):
assert warning in caplog.messages

Expand Down Expand Up @@ -211,7 +214,8 @@ def test_graph_upgrade_msg_graph_equals2(flow, validate, caplog, log_filter):
validate(id_)
expect = (
'graph items were automatically upgraded in'
' "workflow definition":'
' "workflow definition" - support for the old item will be '
'removed at Cylc 8.9:'
'\n * (8.0.0) [scheduling][dependencies][X]graph'
' -> [scheduling][graph]X - for X in:'
'\n P1Y, graph'
Expand Down
Loading