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

Parse lint and breaking ignore paths in buf.yaml v2 #2661

Merged
merged 3 commits into from
Dec 14, 2023

Conversation

oliversun9
Copy link
Contributor

In buf.yaml v2, we want paths for ignore and ignore_only in lint and breaking to be relative to the workspace root, but paths in a CheckConfig should be relative to module roots, i.e. they are import paths. This PR adds this transformation for read and write.

…ne about v1beta1: are those paths relative to the module root or build root in v1beta1?
if err != nil {
return nil, err
}
// TODO: we do no validation of paths now
Copy link
Contributor Author

@oliversun9 oliversun9 Dec 13, 2023

Choose a reason for hiding this comment

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

This TODO is left as-is: in bufcheck/internal, newConfigForRuleBuilders does validation for these paths, which is also the behavior on main. Note that newConfigForRuleBuilders is called only for buf lint or buf breaking.

One interesting implication is that a user can have a semi-invalid buf.yaml (a file with the correct shape but invalid ignore paths) and they can successfully run buf build but not buf lint. I verified that this is the case with main. (The easiest way to try this out is to add "." to ignore and run buf build and buf lint)

@oliversun9 oliversun9 merged commit 414ee32 into bufmod Dec 14, 2023
4 of 8 checks passed
@oliversun9 oliversun9 deleted the osun/handle-lint-breaking-path branch December 14, 2023 18:16
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