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 an executable target to generate the CODEOWNERS file in the workspace #26

Open
sudoforge opened this issue Feb 15, 2020 · 0 comments

Comments

@sudoforge
Copy link

Output Path

codeowners_register() should take a filepath parameter that defaults to .github/CODEOWNERS (or another one of the valid GitHub CODEOWNERS paths). This will be consumed at build time.


Building

In an ideal world, we'd be able to bazel build ..., and the codeowners() rules would be picked up and compiled into a file that's output to filepath. Unfortunately, we can't do that. What we can do is provide a target that is runnable and does the same work; we'd only need to provide the name -- this would be similar to other rules such as bazelbuild/bazel-gazelle and bazelbuild/buildtools, and would be invoked as such:

$ cat BUILD.bazel
load("@rules_codeowners//:foo.bzl", "generate_codeowners")
generate_codeowners(name = "codeowners")


$ bazel run //:codeowners

This would parse all of the codeowners() rules and create the generated file at the specified output path (from codeowners_register(), above).

I think following the pattern of established tool integrations like bazel-gazelle and buildifier (via buildtools) is a great way forward.


Depends-On: #25
Sourced from: #13 (comment)

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

No branches or pull requests

1 participant