Page MenuHomePhabricator

When a previously non-permanent ref is marked permanent, unpublished commits reachable from that ref are not published
Open, LowPublic


See PHI1225. I haven't actually walked through these repro steps so this is slightly hypothetical, but:

  • Create a repository R with only branch X as a permanent ref.
  • Push commit C to branch Y.
  • Mark branch Y as permanent.

Expected behavior: C is published (it is now reachable from permanent ref Y).

Actual behavior: C remains unpublished.

Workarounds: Probably, push another commit to Y, or push C to another permanent ref.

In PhabricatorRepositoryRefEngine, we should close every reachable commit on Y if it becomes a permanent ref. We'll currently skip this step because we won't create a new cursor for it.

Likely adjacent is that the RefPosition table should likely store (a) is this ref the repository default ref and (b) is this ref a permanent ref. We probably need to do (b) to fix this (automatically publish commits when a ref becomes permanent). Doing both (a) and (b) will let us query a list of branches with a more human-readable ordering (see D20493).

Related, see PHI1264. If users interact with an unpublished commit after it has imported, it currently does not send email/notifications/etc. This is incorrect: explicit user interaction with unpublished commits should work normally.

Event Timeline

epriestley triaged this task as Low priority.May 3 2019, 5:34 PM
epriestley created this task.
epriestley updated the task description. (Show Details)May 3 2019, 5:37 PM

Probably, push another commit to Y

This usually won't work. In the RefEngine, we identify new commits reachable from permanent refs like this:

  • Store a list of the old heads of all the permanent refs we know about (A, B, C, ...) ($all_closing_heads).
  • Pull a list of the new heads of all the permanent refs from disk.
  • For each new ref X which does not match our old list, git log X --not A B C to find commits which are newly ancestors of a permanent ref.

When branch aardvark is not a permanent ref and points at commit Q, but then you change the configuration to make it a permanent ref, the next RefEngine update sees it as one of the old positions of a permanent ref, so it is never selected as a new ancestor. It remains unpublished.

epriestley moved this task from Backlog to "Track Only" on the Diffusion board.May 9 2019, 5:03 PM
epriestley updated the task description. (Show Details)May 20 2019, 11:47 AM
mves added a subscriber: mves.May 21 2019, 6:59 AM