Page MenuHomePhabricator

Make Owners behavior when multiple packages own the same path with different dominion rules more consistent
ClosedPublic

Authored by epriestley on Jun 1 2017, 9:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 13 2024, 10:45 AM
Unknown Object (File)
Feb 13 2024, 7:46 AM
Unknown Object (File)
Feb 3 2024, 4:07 PM
Unknown Object (File)
Jan 30 2024, 6:38 PM
Unknown Object (File)
Jan 23 2024, 1:44 PM
Unknown Object (File)
Jan 15 2024, 6:51 AM
Unknown Object (File)
Jan 1 2024, 8:56 PM
Unknown Object (File)
Dec 27 2023, 11:22 AM
Subscribers

Details

Summary

Fixes T12789. See that task for discussion. Currently, when multiple packages own the same path but have different dominion rules we get some weird/aribtrary/inconsistent results.

Instead, implement these rules:

  • If zero or more weak and one or more strong packages claim a path, the strong packages (exactly) all own it.
  • If one or more weak packages and zero strong packages claim a path, the weak packages all own it.

The major change here is that instead of keeping the first weak package we run into, we keep all the weak packages with the longest claim that we run into.

This needs to be implemented twice because Owners has two different near-copies of this logic, only one of which has test coverage. Some day maybe this will get fixed.

Test Plan
  • Added failing unit tests, made them pass.
  • Viewed all A/B strong/weak combinations in Diffusion, saw sensible ownership results.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lvital added a subscriber: lvital.
lvital added inline comments.
src/applications/owners/storage/__tests__/PhabricatorOwnersPackageTestCase.php
103–191

awwyiss

This revision is now accepted and ready to land.Jun 1 2017, 9:28 PM
This revision was automatically updated to reflect the committed changes.