Page MenuHomePhabricator

Separate "shouldPublishRef()" from "isPermanentRef()" and set "IMPORTED_PERMANENT" more narrowly
ClosedPublic

Authored by epriestley on Jan 22 2021, 10:09 PM.
Tags
None
Referenced Files
F15472651: D21515.id51214.diff
Sat, Apr 5, 3:18 PM
F15469956: D21515.diff
Fri, Apr 4, 6:28 PM
F15446953: D21515.id51214.diff
Thu, Mar 27, 9:02 PM
F15444773: D21515.id51209.diff
Thu, Mar 27, 11:14 AM
F15443861: D21515.id.diff
Thu, Mar 27, 6:35 AM
F15442154: D21515.diff
Wed, Mar 26, 9:51 PM
F15442091: D21515.id.diff
Wed, Mar 26, 9:19 PM
F15437376: D21515.diff
Tue, Mar 25, 7:02 PM
Subscribers
None

Details

Summary

Ref T13591. Currently, the "IMPORTED_PERMANENT" flag (previously "IMPORTED_CLOSEABLE", until D21514) flag is set by using the result of "shouldPublishRef()".

This method returns the wrong value for the flag when there is a repository-level reason not to publish the ref (most commonly, because the repository is currently importing).

Although it's correct that commits should not be published in an importing repository, that's already handled in the "PublishWorker" by testing "shouldPublishCommit()". The "IMPORTED_PERMANENT" flag should only reflect whether a commit is reachable from a permanent ref or not.

  • Move the relevant logic to a new method in Publisher.
  • Fill "IMPORTED_PERMANENT" narrowly from "isPermanentRef()", rather than broadly from "shouldPublishRef()".
  • Deduplicate some logic in "PhabricatorRepositoryRefEngine" which has the same intent as the logic in the Publisher.
Test Plan
  • Ran discovery on a new repository, saw permanent commits marked as permanent from the beginning.
  • See later changes in this patch series for additional testing.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Jan 23 2021, 3:51 AM
This revision was automatically updated to reflect the committed changes.