Skip to content

Commit

Permalink
Merge pull request #75 from klarna/remove-unsupported-webhook-fields
Browse files Browse the repository at this point in the history
Remove unsupported webhook fields
  • Loading branch information
jesperes authored Dec 5, 2023
2 parents a9a82ea + 56dfe98 commit 989ec10
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
platform: [ubuntu-latest]
otp-version: [23, 24, 25, 26]
otp-version: [25, 26]
runs-on: ${{ matrix.platform }}
container:
image: erlang:${{ matrix.otp-version }}
Expand Down
3 changes: 1 addition & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
]
}
, { deps
, [ {jesse, "1.5.5"}
, {meck, "0.8.12"}
, [ {meck, "0.8.12"}
, {proper, {git, "https://github.com/proper-testing/proper.git", {tag, "v1.3"}}}
, {proper_contrib, "0.3.2"}
, {redbug, "1.2.1"}
Expand Down
4 changes: 2 additions & 2 deletions scripts/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '2'

services:
bitbucket:
image: atlassian/bitbucket-server:7.17.1
image: atlassian/bitbucket-server:8.14.2
restart: always
networks:
- bridge
Expand All @@ -22,7 +22,7 @@ services:
test: ['CMD', 'bash', '-c', 'curl -s http://localhost:7990/status | grep RUNNING']
interval: 5s
start_period: 10s
retries: 10
retries: 20
mem_limit: 4G

networks:
Expand Down
8 changes: 5 additions & 3 deletions src/bec_webhook_t.erl
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@
from_map(#{ <<"configuration">> := Config
, <<"events">> := Events
} = Map) ->
keys_to_atoms(Map#{ <<"configuration">> => keys_to_atoms(Config)
, <<"events">> => lists:sort(Events)
}).
Map0 = maps:remove(<<"sslVerificationRequired">>, Map),
Map1 = maps:remove(<<"scopeType">>, Map0),
keys_to_atoms(Map1#{ <<"configuration">> => keys_to_atoms(Config)
, <<"events">> => lists:sort(Events)
}).

-spec to_map(webhook()) -> map().
to_map(#{ configuration := Config
Expand Down
2 changes: 1 addition & 1 deletion test/prop_api.erl
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ get_webhooks_pre(S) ->
get_webhooks_post(S, _Args, {ok, WebHooks0}) ->
Generated = [id, createdDate, updatedDate],
Webhooks = [lists:foldl(fun maps:remove/2, WH, Generated)|| WH <- WebHooks0],
?assertEqual(lists:sort(Webhooks), lists:sort(maps:get(webhooks, S))),
?assertEqual(lists:sort(maps:get(webhooks, S)), lists:sort(Webhooks)),
true.

%%------------------------------------------------------------------------------
Expand Down

0 comments on commit 989ec10

Please sign in to comment.