From f82e887a102f8b39b2dcdb50206b77b85c831ad1 Mon Sep 17 00:00:00 2001 From: Lukas Holecek Date: Jun 02 2021 11:00:35 +0000 Subject: Add "testcase" for fetched-gating-yaml satisfied requirement Existing scripts/tools/client may expect all requirements to have this field. Also adds example for a fetched-gating-yaml satisfied requirement. --- diff --git a/docs/decision_requirements.rst b/docs/decision_requirements.rst index ae812b2..6299f3f 100644 --- a/docs/decision_requirements.rst +++ b/docs/decision_requirements.rst @@ -165,3 +165,19 @@ if a policy has ``excluded_packages`` attribute containing ``python2-*``. "type": "excluded", "subject_identifier": "python2-flask-1.0.2-1.rawhide", } + +Fetched remote rule +------------------- + +If the requested policy contains a ``RemoteRule`` and the remote rule file is +found and successfully retrieved, a satisfied requirement is created. + +.. code-block:: json + + { + "type": "fetched-gating-yaml", + "testcase": "fetched-gating-yaml", + "source": "http://dist-git.example.com/cgit/rpms/bash/plain/gating.yaml?id=abcdef01234", + "subject_identifier": "bash-4.4.20-1.el8_4", + "subject_type": "koji_build" + } diff --git a/greenwave/policies.py b/greenwave/policies.py index dba3ea2..5ace576 100644 --- a/greenwave/policies.py +++ b/greenwave/policies.py @@ -365,6 +365,7 @@ class FetchedRemoteRuleYaml(RuleSatisfied): def to_json(self): return { 'type': 'fetched-gating-yaml', + 'testcase': 'fetched-gating-yaml', 'subject_type': self.subject.type, 'subject_identifier': self.subject.identifier, 'source': self.source,