Skip to content

Commit

Permalink
Merge pull request #27 from klarna-incubator/partially-revert-25
Browse files Browse the repository at this point in the history
Partially revert #25
  • Loading branch information
robertoaloi authored Feb 24, 2021
2 parents 96898a2 + 1908ac9 commit b090bfb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/bitbucket.erl
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ get_branch_restrictions(ProjectKey, RepoSlug) ->
case bitbucket_api:get_branch_restrictions(ProjectKey, RepoSlug) of
{ok, Response} ->
Values = maps:get(<<"values">>, Response),
{ok, lists:sort([maps:remove(id, X) ||
X <- [bec_branch_restriction_t:from_map(V) || V <- Values]])};
{ok, lists:sort([bec_branch_restriction_t:from_map(V) || V <- Values])};
{error, Reason} ->
{error, Reason}
end.
Expand Down
11 changes: 9 additions & 2 deletions test/bec_proper_gen.erl
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,20 @@ path() ->
%% PR Restrictions
%%==============================================================================
pr_restrictions() ->
?LET( {MergeConfig, AllApprovers, AllTasks, Approvers, Builds}
, {merge_config(), bool(), bool(), nat(), nat()}
?LET( { MergeConfig
, AllApprovers
, AllTasks
, Approvers
, Builds
, UnapproveOnUpdate
}
, {merge_config(), bool(), bool(), nat(), nat(), bool()}
, #{ 'merge-config' => MergeConfig
, 'required-all-approvers' => AllApprovers
, 'required-all-tasks-complete' => AllTasks
, 'required-approvers' => Approvers
, 'required-successful-builds' => Builds
, 'unapprove-on-update' => UnapproveOnUpdate
}).

merge_config() ->
Expand Down

0 comments on commit b090bfb

Please sign in to comment.