-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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 CODEOWNERS #9529
Conversation
FYI @bep |
Thanks for this; I don't mind adding a new dependency, but I had a look at the code and it walks from the root and upwards until it finds a I see there's a Other than that this looks fine. I will need to do some cleanups in this area, but that's on me. |
@bep thanks, I have adjusted our implementation to only look for I think the current implementation (and my original one) is technically incomplete because some providers support overriding I think just looking at the conventional paths off the root is good enough for now and we can do something more complex later on if there is demand for it. WDYT? |
I think as soon as you start looking at anything other than the conventional paths off the root, things get messy. For example, a logical content directory that consists of a physical content directory with the addition of a couple of mounted content modules. |
@jmooring I agree with you. The use case you cited regarding mounts is a particularly compelling reason to explicitly never support anything other than conventional paths off the root. Not only would anything else be messy from an implementation perspective, but I don't think users would expect for remote |
In the array of returned codeowners, can you only include those elements beginning with If I have a private repository, and I use a theme that leverages the CODEOWNERS data, I could inadvertently expose email addresses that should be kept private. There may be other privacy/security concerns here, but this is the first one that's occurred to me. EDIT: Thinking through this a bit more, would it wise to enable access to the CODEOWNERS data separately from the |
@marshall007 While the filename is a single word (
|
@jmooring this is no different than the current
I have no strong opinion here but I am so accustomed to seeing |
I will merge this once the test passes; I may change the name of the method before I release, though, but I think it makes sense to have this under one flag -- theres certainly no broader privacy concerns for the CODEOWNERS compared to the GitInfo object. |
@bep can you rerun the tests again? I don't think the failure is my fault. Looks like a timeout on fetching a dependency. |
@marshall I spent some time last night figuring out how I would use this, and it works really well. Thanks! Here's an example that retrieves and displays the code owners' information from GitLab and GitHub: git clone --single-branch -b hugo-github-issue-9529 https://github.com/jmooring/hugo-testing hugo-github-issue-9529
cd hugo-github-issue-9529
hugo server Creating the partial for this was a non-trivial exercise, and while doing so it occurred to me that there is a difference between what is exposed in a page's
My concern here is not about bad actors (one could use I'm fine proceeding as is, but I did want to take the opportunity to fully describe my concern. Thanks again for this; works great! |
@jmooring thanks, I really appreciate you taking the time to produce such a detailed example! Your Perhaps as a followup we could consider adding a built-in shortcode for this? Recommending use of the shortcode might be a good way to guard against exposure of email addresses without limiting the core implementation for more advanced/internal use cases. |
Sure, but that is the thing with lots of things in life. The CODEOWNERS file obviously needs to be maintained carefully to be of value. |
@marshall007 While performing some code review for a |
@jayaddison-collabora yes that is intentional. It is there to test the functionality of parsing |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixes #9474
This currently depends on
hairyhenderson/go-codeowners
. Please let me know if you would prefer to incorporate the implementation into this repo or inbep/gitmap
.Even though it has no explicit dependency on
git
, this is behind the sameenableGitInfo
config option.I have not updated all the markdown files under
docs/
. I couldn't figure out if these were auto generated or not.Cheers!