Edward Lesmes | 91bb750 | 2020-11-06 00:50:24 +0000 | [diff] [blame^] | 1 | # Copyright (c) 2020 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | |
| 6 | class OwnersClient(object): |
| 7 | """Interact with OWNERS files in a repository. |
| 8 | |
| 9 | This class allows you to interact with OWNERS files in a repository both the |
| 10 | Gerrit Code-Owners plugin REST API, and the owners database implemented by |
| 11 | Depot Tools in owners.py: |
| 12 | |
| 13 | - List all the owners for a change. |
| 14 | - Check if a change has been approved. |
| 15 | - Check if the OWNERS configuration in a change is valid. |
| 16 | |
| 17 | All code should use this class to interact with OWNERS files instead of the |
| 18 | owners database in owners.py |
| 19 | """ |
| 20 | def __init__(self, host): |
| 21 | self._host = host |
| 22 | |
| 23 | def ListOwnersForFile(self, project, branch, path): |
| 24 | """List all owners for a file.""" |
| 25 | raise Exception('Not implemented') |
| 26 | |
| 27 | def IsChangeApproved(self, change_number): |
| 28 | """Check if the latest patch set for a change has been approved.""" |
| 29 | raise Exception('Not implemented') |
| 30 | |
| 31 | def IsOwnerConfigurationValid(self, change_number, patch): |
| 32 | """Check if the owners configuration in a change is valid.""" |
| 33 | raise Exception('Not implemented') |