Allow for git_commit type
ClosedPublic

Authored by jskladan on Feb 8 2017, 8:37 AM.

Details

Summary

Add a git_commit type to the list of the allowed ones

Test Plan

unittests pass

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.
jskladan retitled this revision from to Allow for git_commit type.Feb 8 2017, 8:37 AM
jskladan updated this object.
jskladan edited the test plan for this revision. (Show Details)
jskladan added a reviewer: libtaskotron.
kparal added a subscriber: kparal.Feb 8 2017, 8:41 AM

Can you explain what this will be used for? Will this cover Pagure/Github/other services? Will this need the extra input data support in libtaskotron to be useful? Are you going to replace dist_git_commit with this in the future?

mkrizek added a subscriber: mkrizek.Feb 8 2017, 8:42 AM

I think the new type should be added also to ReportType enum in libtaskotron/check.py? I don't remember how much is it needed though.

In D1119#20851, @kparal wrote:

Can you explain what this will be used for? Will this cover Pagure/Github/other services?

Will be used wherever we want to consume raw git commit. If github starts posting fedmessages, we sure can add a consumer, and it would make sense to just have 'git_commit' type there. Currently, it's Pagure.

Will this need the extra input data support in libtaskotron to be useful?

No, why should it? dist_git_commit also does not need it. It will be nicer, once we are able to do it, for sure, but that's about it.

Are you going to replace dist_git_commit with this in the future?

Not now, and can not speak of the future. Might make sense, may not. It is not the time to decide.

I think the new type should be added also to ReportType enum in libtaskotron/check.py? I don't remember how much is it needed though.

Not honestly sure what the ReportType was/is for but it only covers about half the allowed types anyway. So, while I can add it, I don't see a reason to do it. Do you?

kparal added a comment.Feb 8 2017, 9:31 AM

Will this need the extra input data support in libtaskotron to be useful?

No, why should it?

So how will the item look like?

I think the new type should be added also to ReportType enum in libtaskotron/check.py? I don't remember how much is it needed though.

Not honestly sure what the ReportType was/is for but it only covers about half the allowed types anyway. So, while I can add it, I don't see a reason to do it. Do you?

The documentation says:

:ivar str report_type: a definition of the type of the object being checked;
                       for example 'a Koji build', 'a Bodhi update' or 'a
                       yum repository name'. The allowed values are
                       attributes in :class:`ReportType`. You don't have to
                       fill this in (or you can provide a custom string
                       value), but the reporting directives react only to
                       the known types (you can always find it in ResultsDB,
                       though).

But it seems this is some forgotten piece of code, because I don't see the report_type values checked against ReportType anywhere. So the he reporting directives react only to the known types information is probably wrong. Also, we should consolidate _ITEM_TYPES and ReportType structure to have just a single one. Anyone thinks otherwise?

mkrizek accepted this revision.Feb 8 2017, 9:35 AM
mkrizek added a reviewer: mkrizek.

I think the new type should be added also to ReportType enum in libtaskotron/check.py? I don't remember how much is it needed though.

Not honestly sure what the ReportType was/is for but it only covers about half the allowed types anyway. So, while I can add it, I don't see a reason to do it. Do you?

The documentation says:

:ivar str report_type: a definition of the type of the object being checked;
                       for example 'a Koji build', 'a Bodhi update' or 'a
                       yum repository name'. The allowed values are
                       attributes in :class:`ReportType`. You don't have to
                       fill this in (or you can provide a custom string
                       value), but the reporting directives react only to
                       the known types (you can always find it in ResultsDB,
                       though).

But it seems this is some forgotten piece of code, because I don't see the report_type values checked against ReportType anywhere. So the he reporting directives react only to the known types information is probably wrong. Also, we should consolidate _ITEM_TYPES and ReportType structure to have just a single one. Anyone thinks otherwise?

Agreed, let's fix that.

Anyway, looks good to me.

This revision is now accepted and ready to land.Feb 8 2017, 9:35 AM
In D1119#20856, @kparal wrote:

So how will the item look like?

Similarly as in the dist_git_commit, it will be a composed value. See D1110 for more details. Relevant line of code:

item = "%s/%s#%s#%s" % (server, repo, branch, end_commit)

Not honestly sure what the ReportType was/is for but it only covers about half the allowed types anyway. So, while I can add it, I don't see a reason to do it. Do you?

The documentation says:

:ivar str report_type: a definition of the type of the object being checked;
                       for example 'a Koji build', 'a Bodhi update' or 'a
                       yum repository name'. The allowed values are
                       attributes in :class:`ReportType`. You don't have to
                       fill this in (or you can provide a custom string
                       value), but the reporting directives react only to
                       the known types (you can always find it in ResultsDB,
                       though).

But it seems this is some forgotten piece of code, because I don't see the report_type values checked against ReportType anywhere. So the he reporting directives react only to the known types information is probably wrong. Also, we should consolidate _ITEM_TYPES and ReportType structure to have just a single one. Anyone thinks otherwise?

Honestly, I'd just get rid of the ReportType completely, but this is not in the scope of this Diff. Let's create a ticket for that, and discuss. For this specific diff, I don't see a reason to add git_commit to ReportType as it is incomplete as it is, and does not seem to be used anyway.

kparal accepted this revision.Feb 8 2017, 1:10 PM
kparal added a reviewer: kparal.
Closed by commit rLTRN1d2c340316ba: Allow for git_commit type (authored by Josef Skladanka <jskladan@redhat.com>). · Explain WhyFeb 9 2017, 1:46 PM
This revision was automatically updated to reflect the committed changes.