#1000 Fix target handling in make_task
Merged by mikem. Opened by tkopecek.
tkopecek/koji issue998  into  master

Download 1000.patch

Fixes: https://pagure.io/koji/issue/998

None target means null-target, in koji-shadow it could be None.
I think if there's no target in parameters, target shouldn't be put in policy_data

Wondering if hastarget is necessary, can we use if target instead?

Add test (note for me)

We should not add a target value where there is none defined. No target defined is different from an explicit target value of None. I think instead that we should have some of the tests handle this more gracefully.

  1. BoolTest could default to false when the field is absent. Policies that care about the difference can use the has test to distinguish.
  2. Similarly our other base tests that use fields (MatchTest and CompareTest) could return False if there is no field to match
  3. We could add an explicit target test (subclass of MatchTest, similar to other such tests), that is friendlier than using the match test directly. (This part could maybe be deferred a little).

rebased onto 3d9445c33a4db4c5b6be84417f4e315749dbf787

I've fixed the PR. @mikem Do we want to track those tests' improvements in separate issue?

Commit cd761147 fixes this pull-request

Pull-Request has been merged by mikem

I;ve filed #1038 and #1040 for the policy test follow ups

Metadata