commit | fd62fcdf9626bf86c1b152a83e969152c3b47554 | [log] [tgz] |
---|---|---|
author | Edwin Kempin <ekempin@google.com> | Fri Jul 16 17:07:02 2021 +0200 |
committer | Edwin Kempin <ekempin@google.com> | Fri Jul 16 17:16:43 2021 +0200 |
tree | 2a7b8c507035de43a6dca40c59e1dc60daf50e8d | |
parent | 60d92c8f1dddbc23f33ed3bb4e1a578234dd28ed [diff] |
GetCodeOwnersForPathInChange: Use a hash of the change number as a seed If code owners have the same score they should be returned in a random order, however for one change the same random order should be consistently applied across requests. This is achieved by using the change number as a seed for the randomisation. However it turned out that with java.util.Random nearby seeds are prone to produce the same random numbers. This is bad for change series, where the change IDs only differ by 1, so all seeds are nearby and hence always the same code owners will be suggested for all changes in the series. To avoid this we are now using a hash of the change ID as a seed for the randomisation (instead of the change ID itself). This way the seeds that are used for a change series are ensured to be distant and hence the randomisation should work better now. While we are fixing this also add a test that ensures that using different seeds produces a different order at least once. FWIW this test was also succeeding with the old code. Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: Idd038765f5e512280b4804d23e32a63b15b73573
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.
Also see resources/Documentation/about.md.
IMPORTANT: Before installing/enabling the plugin follow the instructions from the setup guide, see resources/Documentation/setup-guide.md.