Improvements to the dist-git directive.
ClosedPublic

Authored by ralph2 on Dec 9 2016, 1:41 PM.

Details

Summary

Our use case is that we want to be able to run the modlint tool in
response to dist-git commits to modulemd.yaml files. modlint is kind
of like rpmlint, except for module definitions.

We want to run those checks in response to dist-git commits via
taskotron-trigger.

We were excited to see that a dist-git directive already exists, but it
assumed that you were specifying your request in terms of an rpm NEVR
which we do not have in our use case.

This changes opens it up to be able to pull down any file from any
namespace of dist-git repo, on any branch. It is up to the caller of
the dist-git directive to specify all of that information.

Also, allow dist_git_commit as a possible item_type. This is for
https://github.com/mmathesius/check_modulemd/pull/1

Also, I originally filed this as https://phab.qadevel.cloud.fedoraproject.org/D1055,
but I had issues updating the reviewers, so I've recreated it here.

Test Plan
Run the test suite.

Diff Detail

Repository
rLTRN libtaskotron
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ralph2 retitled this revision from to Improvements to the dist-git directive..Dec 9 2016, 1:41 PM
ralph2 updated this object.
ralph2 edited the test plan for this revision. (Show Details)
ralph2 added reviewers: tflink, jskladan, mkrizek, kparal.
jskladan accepted this revision.Dec 12 2016, 5:36 AM

Good work, thanks you! Sorry for taking so long to review...

This revision is now accepted and ready to land.Dec 12 2016, 5:36 AM
Closed by commit rLTRNc63217671804: Improvements to the dist-git directive. (authored by Ralph Bean <rbean@redhat.com>). · Explain WhyDec 12 2016, 2:52 PM
This revision was automatically updated to reflect the committed changes.

I have one concern about this, with the current change this makes it harder to use from koji_build tasks (where you receive NEVR as item). Before this you could have simply provided it as an argument. Now you need to parse it, and you need to do that manually in an external script, similarly to what you do for check_modulemd:

- name: split the given commit identifier into useful pieces
  python:
    file: split_string.py
    callable: run
    string: ${dist_git_commit}
  export: c

The best approach would be if we provided structured input data from the start (so that koji_build would be immediately also available as ${koji_build.name}, ${koji_build.version} etc). That might be a bigger change, so I'll probably provide a quick compatibility patch for distgit directive in the meantime and add a new option to accept NEVR, so that this is still easy to use for distgit rpm tasks. Thoughts?