Add code owner scorings to CodeOwnersInfo

This will provide the scorings that are used to order code owners in the API response.


Testing:
Request:
curl --user admin:pass http://localhost:8080/a/projects/test/branches/master/code_owners/data
Response:
{
  "code_owners": [
    {
      "account": {
        "_account_id": 1000000
      },
      "scorings": {
        "DISTANCE": 0,
        "IS_EXPLICITLY_MENTIONED": 1
      }
    }
  ],
  "owned_by_all_users": true,
  "code_owner_configs": [
    {
      "project": "test",
      "branch": "refs/heads/master",
      "path": "/data/OWNERS"
    },
    {
      "project": "test",
      "branch": "refs/heads/master",
      "path": "/OWNERS"
    }
  ]
}

Change-Id: I92e223d0de0f0d340930b8188b2b9c6f91464a8e
Bug: Google b/349187606
8 files changed
tree: 22f3ee152b46d793a7768221cd28dd2268f11040
  1. java/
  2. javatests/
  3. proto/
  4. resources/
  5. web/
  6. .gitignore
  7. .gitreview
  8. BUILD
  9. LICENSE
  10. README.md
README.md

Gerrit Code Review code-owners plugin

This plugin provides support for defining code owners for files in a repository.

If the code-owners plugin is enabled, changes can only be submitted if all touched files are covered by approvals from code owners.

For a detailed description of the plugin functionality please refer to the plugin documentation.

IMPORTANT: Before installing/enabling the plugin follow the instructions from the setup guide.

NOTE: The plugin documentation only renders correctly when the plugin is installed in Gerrit and the documentation is accessed via https:///plugins/code-owners/Documentation/index.html. If you want to read the documentation before installing the plugin, you can find it properly rendered here.

JavaScript Plugin

From the root of the gerrit repository.

bazel test //plugins/code-owners/web:karma_test

For testing the plugin with the Gerrit FE Dev Helper the command below builds

    bazel build //plugins/code-owners/web:code-owners
    ln -s bazel-bin/plugins/code-owners/web/code-owners.js polygerrit-ui/app/plugins/

and let the Dev Helper redirect from .+/plugins/code-owners/static/code-owners.js to http://localhost:8081/plugins/code-owners.js.