mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Add an owners API that will be used by Depot Tools to interact with OWNERS files. The API will be implemented using both owners.py and the Gerrit Code-Owners plugin REST API. All Depot Tools code will be modified to use this API. Change-Id: I7cf059a0895dbae105a2f0b26568fd7b47068f43 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2517985 Reviewed-by: Anthony Polito <apolito@google.com> Commit-Queue: Anthony Polito <apolito@google.com>
34 lines
1.2 KiB
Python
34 lines
1.2 KiB
Python
# Copyright (c) 2020 The Chromium Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
|
|
class OwnersClient(object):
|
|
"""Interact with OWNERS files in a repository.
|
|
|
|
This class allows you to interact with OWNERS files in a repository both the
|
|
Gerrit Code-Owners plugin REST API, and the owners database implemented by
|
|
Depot Tools in owners.py:
|
|
|
|
- List all the owners for a change.
|
|
- Check if a change has been approved.
|
|
- Check if the OWNERS configuration in a change is valid.
|
|
|
|
All code should use this class to interact with OWNERS files instead of the
|
|
owners database in owners.py
|
|
"""
|
|
def __init__(self, host):
|
|
self._host = host
|
|
|
|
def ListOwnersForFile(self, project, branch, path):
|
|
"""List all owners for a file."""
|
|
raise Exception('Not implemented')
|
|
|
|
def IsChangeApproved(self, change_number):
|
|
"""Check if the latest patch set for a change has been approved."""
|
|
raise Exception('Not implemented')
|
|
|
|
def IsOwnerConfigurationValid(self, change_number, patch):
|
|
"""Check if the owners configuration in a change is valid."""
|
|
raise Exception('Not implemented')
|