zalando-stups / kio

The application registry in the STUPS ecosystem
http://docs.stups.io/en/latest/components/kio.html
Other
23 stars 11 forks source link

Fix active state toggle #116

Closed thilp closed 4 years ago

thilp commented 4 years ago

Make it possible again to toggle the state of an application from "active" to "inactive".

Screenshot from 2019-09-24T14-25-49

Previously, the use of (merge-with #(or %2 %1)) meant that "updating" a boolean field would simply set that field to true as long as the old or new field was true (truth table of or). Replacing that with a simple (merge) solves the problem, as long as there can't be new nil fields.

To be able to write unit tests for that use-case, most of the changes in this PR are just extraction of existing features from create-or-update-application! into pure functions.

hjacobs commented 4 years ago

Thanks!

ethercrow commented 4 years ago

:+1:

ethercrow commented 4 years ago

:+1:

thilp commented 4 years ago

:+1: