Skip to content

A Sourcegraph extension that shows code owners of the current file.

License

Notifications You must be signed in to change notification settings

sourcegraph/sourcegraph-code-ownership

Repository files navigation

Code ownership extension for Sourcegraph

Build Status

⚠️ Deprecation notice

Sourcegraph extensions have been deprecated with the September 2022 Sourcegraph release. Learn more.

The repo and the docs below are kept to support older Sourcegraph versions.

Description

A Sourcegraph extension that shows code owners of the current file.

🗃️ Source code

➕ 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).

  • Displays Code owner(s) of current file when hover on the extension icon in the Sourcegraph extension panel.
  • Code owner(s) of current file displayed in the file header on Code Hosts.

image

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).

  1. Enable the sourcegraph/code-ownership extension:
  2. Visit any code file in a repository containing a CODEOWNERS or .github/CODEOWNERS file.
  3. Hover on the extension icon in the Sourcegraph extension panel 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:

  1. 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.
  2. Follow the usage steps above to enable the sourcegraph/code-ownership extension.
  3. Visit any code file (on your code host) in a repository containing a CODEOWNERS or .github/CODEOWNERS file.
  4. Look in the file header to see the current file's code owner(s).

Screenshot on GitHub

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

About

A Sourcegraph extension that shows code owners of the current file.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published