Verified Commit ee462694 authored by Baptiste Beauplat's avatar Baptiste Beauplat
Browse files

Utilize outcome and severity to pass on info to user in rfstemplate plugin

parent cf4f505b
...@@ -91,6 +91,9 @@ class RfsTemplatePlugin(BasePlugin): ...@@ -91,6 +91,9 @@ class RfsTemplatePlugin(BasePlugin):
upstream_license = "[fill in]" upstream_license = "[fill in]"
package_changelog = "[your most recent changelog entry]" package_changelog = "[your most recent changelog entry]"
outcome = "RFS: license, author and changelog parsed"
severity = constants.PLUGIN_SEVERITY_INFO
package_changelog = self.changes.get('Changes', '').strip() package_changelog = self.changes.get('Changes', '').strip()
if len(package_changelog.split('\n')) > 2: if len(package_changelog.split('\n')) > 2:
...@@ -100,8 +103,15 @@ class RfsTemplatePlugin(BasePlugin): ...@@ -100,8 +103,15 @@ class RfsTemplatePlugin(BasePlugin):
if 'author' in copyright_info: if 'author' in copyright_info:
upstream_author = copyright_info['author'] upstream_author = copyright_info['author']
else:
outcome = "RFS: author info missing"
severity = constants.PLUGIN_SEVERITY_WARNING
if 'license' in copyright_info: if 'license' in copyright_info:
upstream_license = copyright_info['license'] upstream_license = copyright_info['license']
else:
outcome = "RFS: no dep5 license"
severity = constants.PLUGIN_SEVERITY_ERROR
data = { data = {
'upstream-author': upstream_author, 'upstream-author': upstream_author,
...@@ -109,8 +119,6 @@ class RfsTemplatePlugin(BasePlugin): ...@@ -109,8 +119,6 @@ class RfsTemplatePlugin(BasePlugin):
'package-changelog': package_changelog, 'package-changelog': package_changelog,
} }
outcome = "RFS template information"
severity = constants.PLUGIN_SEVERITY_INFO
self.passed(outcome, data, severity) self.passed(outcome, data, severity)
......
<div class="qa-header">
${str(o.outcome)}
</div>
%if o.rich_data:
%if o.severity != 3:
<div class="qa-content">
%if o.severity == 2:
Upstream-Contact: was not found in d/copyright.<br/>
RFS will not autocomplete the Upstream author.
%else:
<dt>Author</dt>
<dd>${o.rich_data['upstream-author']}</dd>
%endif
<dt>License</dt>
<dd>${o.rich_data['upstream-license']}</dd>
<dt>Changelog</dt>
<dd><pre>${o.rich_data['package-changelog']}</pre></dd>
</dl>
</div>
%endif
%endif
%for field, contents in sorted(o.rich_data.items()):
${field}: ${contents}
%endfor
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment