Page MenuHomePhabricator

When loading packages affected by a change to a particular path, ignore archived packages
ClosedPublic

Authored by epriestley on Sep 16 2016, 7:09 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 1:02 AM
Unknown Object (File)
Wed, Apr 17, 2:41 PM
Unknown Object (File)
Tue, Apr 16, 5:05 PM
Unknown Object (File)
Tue, Apr 16, 5:05 PM
Unknown Object (File)
Sat, Apr 6, 8:20 PM
Unknown Object (File)
Fri, Apr 5, 5:58 PM
Unknown Object (File)
Fri, Apr 5, 1:59 AM
Unknown Object (File)
Fri, Apr 5, 1:59 AM
Subscribers
None

Details

Summary

Ref T11650. Currently, we load packages and then discard the archived ones.

However, this gets "dominion" rules (where a more-general package gives up ownership if a more-specific package exists) wrong if the more-specific package is archived: we incorrectly give up ownership.

Instead, just ignore these packages completely when loading affected packages. This is slightly simpler.

(There are technically two pieces of code we have to do this for, which should be a single piece of code but which haven't yet been unified.)

Test Plan
  • Created packages:
    • Package A, on "/" (strong dominion, autoreview).
    • Package B, on "/x/" (weak dominion, autoreview).
    • Package C, on "/x/y" (archived, autoreview).
  • Create a revision affecting "/x/y".
  • Saw correct path ownership in table of contents ("B", strongest package only).
  • Saw correct autoreview behavior (A + B).
  • (Prior to patch, in master, reproduced the problem behaviors described in T11650, with bad dominion rules and failure to autoreview B.)

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to When loading packages affected by a change to a particular path, ignore archived packages.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad edited edge metadata.
This revision is now accepted and ready to land.Sep 16 2016, 7:25 PM
epriestley edited edge metadata.
  • Version with testing.
This revision was automatically updated to reflect the committed changes.
src/applications/owners/query/PhabricatorOwnersPackageQuery.php
361–366

This isn't technically necessary because callers already specify active-packages-only. I think it's reasonable to bake the rule "archived packages can never control paths" into this API, but it's something that might eventually merit adjustment, particularly if we're eventually able to get all of the code running through this logic.