Skip to content
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

Extend project lint result struct with includes #2070

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TheCodear
Copy link
Contributor

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!

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.
@RicePatrick
Copy link
Collaborator

@timofurrer -what're your thoughts about "undocumented" features that are only in the OpenAPI spec? I believe that OpenAPI spec is auto-generated, so it may include fields that aren't technically meant for "public" use, but it seems to me as long as it's present there it seems reasonable to support it.

I suppose we could open a documentation update MR and see what comes from that too; if it's denied to include in the docs, I don't think we should support it here.

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