Code ownership extension for Sourcegraph
A Sourcegraph extension that shows code owners of the current file.
โ Add to Sourcegraph (see usage instructions for self-hosted Sourcegraph instances)
Features
Works on Sourcegraph.com, self-hosted Sourcegraph instances, and on code hosts (via the Sourcegraph browser extension).
- Code owner of current file displayed in the file header
Only CODEOWNERS
and .github/CODEOWNERS
files are supported right now. File an issue if you want need support for another code ownership scheme.
Usage
Note: Using this extension on private code in the Sourcegraph browser extension requires a self-hosted Sourcegraph instance (because it needs access to the repository's files that define code owners).
- Enable the
sourcegraph/code-ownership
extension:- On Sourcegraph.com, visit https://sourcegraph.com/extensions/sourcegraph/code-ownership to enable it.
- On a self-hosted Sourcegraph instance, select User menu > Extensions, search for
sourcegraph/code-ownership
, and enable it.
- Visit any code file in a repository containing a
CODEOWNERS
or.github/CODEOWNERS
file. - Look in the file header to see the current file's code owner(s).
On your code host
This extension adds the same features on your code host if you're using the Sourcegraph browser extension. To use it on your code host:
- Install the Sourcegraph browser extension.
- If you're using it with a self-hosted Sourcegraph instance, enter the Sourcegraph instance URL into the Sourcegraph browser extension options menu.
- Follow the usage steps above to enable the
sourcegraph/code-ownership
extension. - Visit any code file (on your code host) in a repository containing a
CODEOWNERS
or.github/CODEOWNERS
file. - Look in the file header to see the current file's code owner(s).
Roadmap
- More ways to define code owners (such as by directory-specific CODEOWNERS files, from an external code owners service, etc.)
- Per-repository configuration of how code owners are defined
- Search by code owner (e.g.,
codeowner:alice
in a Sourcegraph search query) - Directory ownership
- Filter a code review to only diffs to files you own