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

Add support for merged YAML return from linter #1497

Merged
merged 3 commits into from Jun 20, 2022

Conversation

robbydyer
Copy link

The lint API requires setting the include_merged_yaml option to true to in order for it to return the merged YAML. Since the existing Lint function doesn't take options as a parameter, this adds a new function that sets that option to true. https://docs.gitlab.com/ee/api/lint.html#validate-the-ci-yaml-configuration

validate.go Outdated
}

return l, resp, nil
}
Copy link
Member

Choose a reason for hiding this comment

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

Instead of making a dedicated function like this the general approach is to make an option struct and pass that into the existing Lint function.

I do notice that the existing Lint function already does this different, but the best way forward is to correct that (now that it caught my eye 😉) instead of repeating it...

Copy link
Author

Choose a reason for hiding this comment

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

Would you prefer I make an entirely new function to maintain backward compatibility? Like LintWithOptions or something?

Copy link
Member

@svanharmelen svanharmelen left a comment

Choose a reason for hiding this comment

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

Thanks @robbydyer! I updated the PR so your version replaces the incomplete Lint function that already existed.

I understand this is now a breaking change, but the old version was clearly not implemented correctly (not following the actual API) so in this case I am good with that...

@svanharmelen svanharmelen merged commit 7a7ea97 into xanzy:master Jun 20, 2022
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.

None yet

2 participants