Skip to content

Fix setting job platforms when props are empty

Cal Pratt requested to merge cpratt34/fix-empty-platform-prop-setting into master

There is a bug here when the platform_requirements dict is empty. The line

select(PlatformEntry.key, PlatformEntry.value).where(or_(*conditions))

Becomes:

select(PlatformEntry.key, PlatformEntry.value).where(or_(*[]))

Which is the same as

select(PlatformEntry.key, PlatformEntry.value)

This leads to a job with no platform properties being assigned them all...

Quick fix is to short circuit on empty values.

Merge request reports