Extend project lint result struct with includes #2070
+78
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Gitlab API exposes a list of (recursive) includes when linting a projects ci configuration. The ProjectLintResult struct representing the API response does not reflect this list, so a user of the SDK cannot use this information from the API. It is also not possible to grab this information via response body parsing outside of the go-gitlab client, as the body is already closed when the client code can access it.
So, in short, this change allows the client code to access the list of includes returned by the Gitlab API.
My only concern is the documentation of the includes type. It is not documented in the api docs of the lint API (see https://docs.gitlab.com/ee/api/lint.html#validate-a-projects-cicd-configuration). Instead, one can find the specification in the openapi spec, see https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/api/openapi/openapi_v2.yaml?plain=1#L52442. But relying on this spec is inconsistent with the rest of the go-gitlab library...
Please let me know if this still is an acceptable change - and of course whether there is anything else missing (e.g. if further tests are required).
Thank you!