Make gitlabstub API responses more explicit
What does this MR do?
While working on !856 (merged), I had some trouble to understand how to create new stubbed responses for the gitlabstub
API.
Over the weekend, I took some time to rewrite that part of the code with the goal to make it more straightforward by leveraging go type system to define the stubbed responses.
I intentionally removed the calculated responses based on a given path. My goal is to have a more declarative way to stub the responses and be very explicit about where the files are coming from. Although it's a bit more verbose, the logic in the code, IMHO, is easier to follow and the overall api_responses.go
file is easier to read.
TODO
-
Feature flag
-
Added feature flag: -
This feature does not require a feature flag
-
-
I added the Changelog
trailer to the commits that need to be included in the changelog (e.g.Changelog: added
) -
I added unit tests or they are not required -
I added acceptance tests or they are not required -
I added documentation (or it's not required) -
I followed code review guidelines -
I followed Go Style guidelines
Edited by Kassio Borges