Skip to content

Fix bug with incorrect request payload for groups (Branch Restrictions) #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 25, 2021

Conversation

zahiar
Copy link
Contributor

@zahiar zahiar commented Nov 22, 2021

The API expects the group slug to be passed in, without this, API returns a HTTP 400 error. Also, fixed branchRestrictionsBodyGroup struct, specifically the inner links struct which accidentally included full_slug & slug - both of which should be at the root level.

Previously a request with this payload

{"kind":"push","pattern":"develop","links":{"self":{"href":""}},"value":null,"id":0,"users":null,"groups":[{"name":"za-test"}]}

Would return

{"type":"error","error":{"message":"malformed groups"}}

With the fixed payload, we now get a success response.

{"kind":"push","pattern":"develop","links":{"self":{"href":""}},"value":null,"id":0,"users":null,"groups":[{"slug":"za-test"}]}

The API expects the group slug to be passed in, without this, API returns a HTTP 400 error. Also, fixed `branchRestrictionsBodyGroup` struct, specifically the inner `links` struct which accidentally included `full_slug` & `slug` - both of which should be at the root level.

Previously a request with this payload
```
{"kind":"push","pattern":"develop","links":{"self":{"href":""}},"value":null,"id":0,"users":null,"groups":[{"name":"za-test"}]}
```

Would return
```
{"type":"error","error":{"message":"malformed groups"}}
```

With the fixed payload, we now get a success response.
```
{"kind":"push","pattern":"develop","links":{"self":{"href":""}},"value":null,"id":0,"users":null,"groups":[{"slug":"za-test"}]}
```
Copy link
Owner

@ktrysmt ktrysmt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ktrysmt ktrysmt merged commit c4d4a8c into ktrysmt:master Nov 25, 2021
@zahiar zahiar deleted the fix-branch-restriction-group-bug branch November 25, 2021 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants