#319 Remove Bodhi dependecy
Merged by lholecek. Opened by lholecek.
lholecek/greenwave remove-bodhi-dependecy  into  master

Download 319.patch

Removes dependency on Bodhi - i.e. asking for all build from a Bodhi
update.

This removes cyclic dependency (Bodhi depends on Greenwave) and
simplifies the code.

Decision for bodhi_update no longer expands to include related
koji_build items from the Bodhi update. All builds have to be stated
explicitly in the "subject" field.

Decision change message for bodhi_update is no longer published if a
test results changes for a koji_build in the Bodhi update.

As an side effect, the formerly deprecated "subject" field (replaced
with "subject_identifier" and "subject_type") has to be used to query
for a decision on multiple koji_builds.

Fixes #298

Signed-off-by: Lukas Holecek hluk@email.cz

API documentation for subject field in decision endpoint still states that it's deprecated. Without the field you would need to make multiple requests to the endpoint.

The easiest way now is to allow asking for decision on multiple subjects. There is probably better and more consistent way to do this. So let me hear your ideas.

(I'll have to update the documentation.)

CC @bowlofeggs @sbaird

oh, _decision_subject and _decision_subjects is quite confusing... Can we rename them to distinguish them a little bit better?

Why are you removing this part?

Why not? :D We've put it here since we didn't want to raise an error if someone doesn't want to use the RemoteRule feature. We can maybe put a check in the RemoteRule class...

This block is completely unrelated to this function (which should just serve decisions). The code seems to check whether the application is configured correctly on every decision request. It could done after loading policies and configuration.

BTW, the code is very awkward :) -- I would expect something like:

if ('DIST_GIT_BASE_URL' not in current_app.config or
    'DIST_GIT_URL_TEMPLATE' not in current_app.config or
    'KOJI_BASE_URL' not in current_app.config or 
        any(isinstance(rule, RemoteRule) for ...):
    raise InternalServerError(...)

As I mentioned in comment above, 'subject' (deprecated field since v0.8) is still needed if we want do make decision about multiple bodhi builds in one request.

rebased onto 483d23bc395bb0a29a1ab564c052bd983f821bf7

This block is completely unrelated to this function (which should just serve decisions). The code seems to check whether the application is configured correctly on every decision request. It could done after loading policies and configuration.
BTW, the code is very awkward :) -- I would expect something like:
if ('DIST_GIT_BASE_URL' not in current_app.config or
'DIST_GIT_URL_TEMPLATE' not in current_app.config or
'KOJI_BASE_URL' not in current_app.config or
any(isinstance(rule, RemoteRule) for ...):
raise InternalServerError(...)

so great that you changed it

+1 for me

rebased onto 4c6f92657a07489657378285d9c785d7830f9245

rebased onto 8658b9d5d98f0ed5df4457fe859cfed492380ef1

Pull-Request has been merged by lholecek

Metadata