klarna / bec

The BitBucket Erlang Client
Apache License 2.0
47 stars 12 forks source link

Fix non-string locationCount and version fields #11

Open robertoaloi opened 3 years ago

robertoaloi commented 3 years ago

Consider a repo with the following config:

hooks:
  - key: de.aeffle.stash.plugin.stash-http-get-post-receive-hook:http-get-post-receive-hook
    enabled: true
    settings:
      locationCount: 2
      # ...config for 2 post receive hooks...

This config is broken, because locationCount needs to be a string and we also need a version field for the 2nd post receive hook to work.

Now let's consider this bogus config has already been enforced by BEC, and then someone wants to fix the problem:

hooks:
  - key: de.aeffle.stash.plugin.stash-http-get-post-receive-hook:http-get-post-receive-hook
    enabled: true
    settings:
      locationCount: '2'
      version: '3'
      # ...comfig for 2 post receive hooks...

The issue is that BEC won't detect the inconsistency between the desired and actual config, and hence won't enforce the change.