diff --git a/CHANGES/2998.bugfix b/CHANGES/2998.bugfix new file mode 100644 index 000000000..e88d8c62e --- /dev/null +++ b/CHANGES/2998.bugfix @@ -0,0 +1 @@ +Loosen modulemd validation to allow version numbers that have string type but represent integers \ No newline at end of file diff --git a/pulp_rpm/app/modulemd.py b/pulp_rpm/app/modulemd.py index ce1a9f324..fc4fd51bf 100644 --- a/pulp_rpm/app/modulemd.py +++ b/pulp_rpm/app/modulemd.py @@ -164,6 +164,11 @@ def parse_modular(file): # are not enough then we only need to take required data from dict which is # parsed by pyyaml library if parsed_data["document"] == "modulemd": + # the validator currently accepts formatting slightly different to the + # spec due to the misconfiguration of some Rocky Linux 9 repositories + # https://bugs.rockylinux.org/view.php?id=2575 + # further discussion on this issue can be found here: + # https://github.com/pulp/pulp_rpm/issues/2998 validator = Draft7Validator(MODULEMD_SCHEMA) err = [] for error in sorted(validator.iter_errors(parsed_data["data"]), key=str): diff --git a/pulp_rpm/app/schema/modulemd.json b/pulp_rpm/app/schema/modulemd.json index 856d4e3a3..a2f365fcb 100644 --- a/pulp_rpm/app/schema/modulemd.json +++ b/pulp_rpm/app/schema/modulemd.json @@ -5,7 +5,10 @@ "type": "object", "properties": { "name": {"type": "string"}, - "version": {"type": "integer"}, + "version": { + "type": ["integer", "string"], + "pattern": "^[0-9]+$" + }, "context": {"type": ["number", "string"]}, "arch": {"type": "string"}, "summary": {"type": "string"},