scripts/eddn-report-log-errors: Use a semantic_version comparison

Hardcoding to only **equal** to 'current known latest version' requires
maintenance on any new release of a Sender.  So leverage
`semantic_version.Version.coerce('<version>')` instead so we catch "this
or later versions".
This commit is contained in:
Athanasius 2022-02-17 11:06:01 +00:00
parent ad9503d37b
commit 05d5d0215a

View File

@ -5,6 +5,8 @@
import argparse
import re
import semantic_version
def parse_cl_args() -> str:
"""
@ -59,13 +61,14 @@ def process_file(input_file: str) -> None:
# print(matches.group('sender_ip'))
# print('')
software_version = semantic_version.Version.coerce(matches.group('software_version'))
###################################################################
# Issues we know about and HAVE already alerted their
# developers to.
###################################################################
if matches.group('software_name') == 'EDDiscovery':
# https://github.com/EDDiscovery/EDDiscovery/releases/latest
if matches.group('software_version') == '12.1.7.0':
if software_version >= semantic_version.Version.coerce('12.1.7.0'):
if matches.group('schema_ref') in (
'https://eddn.edcd.io/schemas/shipyard/2',
'https://eddn.edcd.io/schemas/outfitting/2',
@ -79,7 +82,7 @@ def process_file(input_file: str) -> None:
elif matches.group('software_name') == 'EDDLite':
# https://github.com/EDDiscovery/EDDLite/releases/tag/latest
if matches.group('software_version') == '2.0.0':
if software_version >= semantic_version.Version.coerce('2.0.0'):
if matches.group('schema_ref') in (
'https://eddn.edcd.io/schemas/shipyard/2',
'https://eddn.edcd.io/schemas/outfitting/2',
@ -93,12 +96,12 @@ def process_file(input_file: str) -> None:
elif matches.group('software_name') == 'EDDI':
# https://github.com/EDCD/EDDI/releases/latest
if matches.group('software_version') == '4.0.1':
if software_version >= semantic_version.Version.coerce('4.0.1'):
print(line)
elif matches.group('software_name') == 'E:D Market Connector [Windows]':
elif matches.group('software_name').startswith('E:D Market Connector'):
# https://github.com/EDCD/EDMarketConnector/releases/latest
if matches.group('software_version') == '5.2.4':
if software_version >= semantic_version.Version.coerce('5.2.4'):
if matches.group('schema_ref') == 'https://eddn.edcd.io/schemas/codexentry/1':
# <https://github.com/EDCD/EDMarketConnector/issues/1393>
if matches.group('err_msg') != 'Failed Validation "[<ValidationError: "\'\' is too short">]"':
@ -117,6 +120,10 @@ def process_file(input_file: str) -> None:
# <https://github.com/EDCD/EDMarketConnector/issues/1403>
pass
else:
print(matches.group('err_msg'))
print(line)
elif matches.group('schema_ref') == 'https://eddn.edcd.io/schemas/fssdiscoveryscan/1':
if matches.group('err_msg') == 'Failed Validation "[<ValidationError: "None is not of type \'boolean\'">]"':
# <https://github.com/EDCD/EDMarketConnector/issues/1403>
@ -127,7 +134,7 @@ def process_file(input_file: str) -> None:
elif matches.group('software_name') == 'Elite G19s Companion App':
# <https://edcodex.info/?m=tools&entry=212>
if matches.group('software_version') == '3.7.7888.21039':
if software_version >= semantic_version.Version.coerce('3.7.7888.21039'):
if matches.group('schema_ref') == 'https://eddn.edcd.io/schemas/commodity/3':
# Reported via Frontier forums: <https://forums.frontier.co.uk/threads/elite-g19s-companion-app-with-simulated-space-traffic-control.226782/post-9690204>
if matches.group('err_msg') != 'Failed Validation "[<ValidationError: "Additional properties are not allowed (\'Proportion\', \'Name\' were unexpected)">]"':
@ -139,7 +146,7 @@ def process_file(input_file: str) -> None:
elif matches.group('software_name') == 'EDSM':
# It's in-browser, no public source/releases
if matches.group('software_version') == '1.0.1':
if software_version >= semantic_version.Version.coerce('1.0.1'):
if matches.group('schema_ref') == 'https://eddn.edcd.io/schemas/journal/1':
if matches.group('journal_event') == 'Scan':
# <https://github.com/EDSM-NET/FrontEnd/issues/466>
@ -157,7 +164,7 @@ def process_file(input_file: str) -> None:
elif matches.group('software_name') == 'EDSM - Console':
# It's in-browser, no public source/releases
if matches.group('software_version') == '1.0':
if software_version >= semantic_version.Version.coerce('1.0'):
if matches.group('schema_ref') == 'https://eddn.edcd.io/schemas/journal/1':
if matches.group('journal_event') == 'Scan':
# <https://github.com/EDSM-NET/FrontEnd/issues/466>
@ -175,7 +182,7 @@ def process_file(input_file: str) -> None:
elif matches.group('software_name') == 'EDAOS':
# Apparently a Barry Carylon project, but no home page ?
if matches.group('software_version') == '1.2.3':
if software_version >= semantic_version.Version.coerce('1.2.3'):
if matches.group('schema_ref') == 'https://eddn.edcd.io/schemas/journal/1':
if matches.group('journal_event') == 'Docked':
# <https://discord.com/channels/164411426939600896/205369618284544000/929102478954340372>
@ -193,7 +200,7 @@ def process_file(input_file: str) -> None:
elif matches.group('software_name') == 'EliteLogAgent':
# <https://github.com/DarkWanderer/Elite-Log-Agent>
if matches.group('software_version') == '2.0.0.660':
if software_version >= semantic_version.Version.coerce('2.0.0.660'):
print(line)
# Abandoned/unmaintained project