Conversation
There was a problem hiding this comment.
Bug: LogBody Function Causes Panics and Data Loss
The logBody function reads the HTTP response body for logging. This introduces two issues: it does not check if response.Body is nil, which can cause a panic; and it consumes the body, making it unavailable for subsequent reads by other components (e.g., client.go, uhttp framework) that expect to process it.
pkg/onprem/helpers.go#L12-L25
baton-gitlab/pkg/onprem/helpers.go
Lines 12 to 25 in 10fa8a8
Bug: API Error Masked as Success
The ListExternalGroupMembers function incorrectly returns a nil error and potentially invalid users data when the GitLab API responds with a 403 Forbidden status code. This misrepresents an API error as a successful operation, leading to consumers receiving corrupted or incomplete data.
pkg/connector/gitlab/groups_endpoints.go#L59-L76
baton-gitlab/pkg/connector/gitlab/groups_endpoints.go
Lines 59 to 76 in 10fa8a8
Was this report helpful? Give feedback by reacting with 👍 or 👎
luisina-santos
left a comment
There was a problem hiding this comment.
we should remove gitlabSDK usages for all versions as part of this change
luisina-santos
left a comment
There was a problem hiding this comment.
I think it's okay as initial PR, we could remove the sdk in a next PR?
Description
Useful links: