Trigger changes for the task-discover functinality (docker/distgit testing)
ClosedPublic

Authored by jskladan on Oct 18 2016, 12:01 PM.

Details

Summary

Split-up and rewrite of the discover_tasks() method, so the logical steps
are not all tied together, and so we have better starting place for further
changes.

The discover 'reaction' in the task configuration can now be like:

 {discover: {
     repo: 'URL of the git branch to clone',
     branch: 'branch to clone, master by default',
     fallback_branch: 'what branch to clone if `branch` can not be cloned',
     base_dir: 'relative path to a directory in the repo. The path is used as root for the task discovery'
     }
}

I'm not sure the fallback_branch is necessary, but the previous code had
a concept of checking out 'master' when the provided branch could not be cloned
so I wanted to introduce a way to do the same, but explicitly.

Test Plan

Unittests

Diff Detail

Repository
rTRGR taskotron-trigger
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
jskladan retitled this revision from to Trigger changes for the task-discover functinality (docker/distgit testing).Oct 18 2016, 12:01 PM
jskladan updated this object.
jskladan edited the test plan for this revision. (Show Details)
jskladan added a reviewer: taskotron-trigger.
jskladan updated this object.Oct 18 2016, 1:56 PM

I have also tested the functionality locally with docker - the trigger correctly crawls a repo, finds all the instances of runtask.yml and schedules tasks.
There are buildbot related changes necessary, those will be in another diff

Guys, could you have a look at this? It's been quite a while, and is still rather relevant... @tflink @mkrizek

mkrizek accepted this revision.Dec 12 2016, 10:51 AM

Didn't look at the tests, code looks good to me.

This revision is now accepted and ready to land.Dec 12 2016, 10:51 AM
This revision was automatically updated to reflect the committed changes.