Skip to content

Commit 17ff3a9

Browse files
committed
Resort scope versions so drafts go after non-drafts
Signed-off-by: Matthias Büchse <matthias.buechse@alasca.cloud>
1 parent f1a5f48 commit 17ff3a9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

compliance-monitor/monitor.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,13 @@ async def get_scope(
733733
):
734734
spec = get_scopes()[scopeuuid].spec
735735
versions = spec['versions']
736-
relevant = sorted([name for name, version in versions.items() if version['_explicit_validity']])
736+
# sort by name, and all drafts after all non-drafts
737+
column_data = [
738+
(version['_explicit_validity'].lower() == 'draft', name)
739+
for name, version in versions.items()
740+
if version['_explicit_validity']
741+
]
742+
relevant = [name for _, name in sorted(column_data)]
737743
modules_chart = {}
738744
for name in relevant:
739745
for include in versions[name]['include']:

0 commit comments

Comments
 (0)