Make trigger configuration more flexible
ClosedPublic

Authored by mkrizek on Apr 2 2014, 2:59 PM.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
kparal added inline comments.Apr 3 2014, 9:21 AM
jobtriggers/config.py
20

I wonder, maybe it would be better to consolidate our configuration directories?
For libtaskotron:
/etc/taskotron/(lib)taskotron.yaml
For taskotron-trigger:
/etc/taskotron/trigger.cfg

mkrizek added inline comments.Apr 3 2014, 10:28 AM
jobtriggers/config.py
20

Which rpm would own /etc/taskotron/ directory though? taskotron-trigger or libtaskotron?

kparal added inline comments.Apr 3 2014, 12:07 PM
jobtriggers/config.py
20

Both, at least that's the correct approach, I believe.

ralph added a comment.Apr 3 2014, 1:35 PM

Are there no tests for this?

tflink added a comment.Apr 3 2014, 2:42 PM

Are there no tests for this?

Can you be more specific on what you're looking for - tests in general or a specific part of the config? There are some tests in the code: https://bitbucket.org/fedoraqa/taskotron-trigger/src/6835b51d797441d864fd2d06a536e62e0acff5a2/testing/?at=master

I wonder, maybe it would be better to consolidate our configuration directories?

That's something that I'm hitting with most of the components as well - resultsdb, resultsdb_frontend each have their own config directory. So does fake_fedorainfra, but that's less directly related.

While it would be nice to see config files consolidated into the same directory, would it be worth the potential coupling and dependencies between the different components?

I'm OK with the code as is for now but I'm holding off on accepting the changes in case @kparal or @ralph have stronger objections.

jobtriggers/config.py
20

Can you do that with rpm without having file conflicts?

kparal added inline comments.Apr 3 2014, 3:08 PM
jobtriggers/config.py
20

I'm almost sure that file conflicts do not apply for directories. Quite the opposite, all packages are expected to own all directories they use (except for basic directories inside filesystem package), and it happens quite often that multiple packages own the same directory. But I need to go AFK now, so I can verify tomorrow.

ralph accepted this revision.Apr 3 2014, 4:18 PM
mkrizek added inline comments.Apr 4 2014, 8:28 AM
jobtriggers/config.py
20

According to [1], owning a directory by both packages is indeed the correct approach (note: we must ensure that the ownership and permissions match in both packages). I'll send the change shortly...

[1] https://fedoraproject.org/wiki/Packaging:Guidelines#The_directory_is_owned_by_a_package_which_is_not_required_for_your_package_to_function

mkrizek updated this revision.Apr 4 2014, 8:40 AM

Put conf file into /etc/taskotron

kparal added a comment.Apr 4 2014, 1:36 PM

Apart from that proposal below, the code seems fine, even though I'm not very familiar with taskotron-trigger.

jobtriggers/config.py
20

Maybe it would be better to use the same name for the config file regardless of location? (Therefore ./conf/trigger.cfg).

mkrizek updated this revision.Apr 7 2014, 11:29 AM

Make naming of config files consistent

tflink accepted this revision.Apr 8 2014, 2:45 PM

Looks good to me

mkrizek closed this revision.Apr 8 2014, 2:55 PM

Closed by commit rTRGRd97c2a33ad2d (authored by @mkrizek).