Page MenuHomePhabricator

Implement build generations in Harbormaster
ClosedPublic

Authored by hach-que on Aug 21 2014, 12:40 PM.
Tags
None
Referenced Files
F14062184: D10321.id24847.diff
Mon, Nov 18, 10:58 AM
F14057089: D10321.diff
Sun, Nov 17, 12:21 AM
F14030903: D10321.id24849.diff
Sat, Nov 9, 8:27 AM
F14026913: D10321.id24847.diff
Fri, Nov 8, 3:36 AM
F14020690: D10321.id24850.diff
Wed, Nov 6, 1:37 AM
F14020565: D10321.id24847.diff
Wed, Nov 6, 12:45 AM
F14015544: D10321.id24847.diff
Sun, Nov 3, 8:55 PM
F14002778: D10321.id24846.diff
Fri, Oct 25, 10:23 PM
Subscribers

Details

Summary

Ref T5932. Ref T5936. This implements build generations in Harbormaster, which provides the infrastructure required to both show users the previous states of restarted builds and to allow users to forcefully abort builds (and their targets).

You can view previous generations of a build by adding ?g=<n> to the URI, but this isn't exposed in the UI anywhere yet.

Test Plan

Ran a build plan with a Sleep step in it. Reconfigured it for various sleep times and viewed previous generations of the build after restarting it.

Diff Detail

Repository
rP Phabricator
Branch
build-gen
Lint
Lint Passed
SeverityLocationCodeMessage
Advicesrc/applications/harbormaster/engine/HarbormasterBuildEngine.php:134XHP16TODO Comment
Unit
No Test Coverage
Build Status
Buildable 2309
Build 2313: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

hach-que edited edge metadata.

Move the restarts above "Status" so the padding doesn't look weird

resources/sql/autopatches/20140821.harbormasterbuildgen.1.sql
3

These should probably be INT UNSIGNED unless you have scary plans for negative generations

src/applications/harbormaster/engine/HarbormasterBuildEngine.php
132

This gets saved as soon as we return. Can we omit this?

src/applications/harbormaster/query/HarbormasterBuildQuery.php
115–116

Can we use withBuildGenerations() here instead of foreach below?

src/applications/harbormaster/query/HarbormasterBuildQuery.php
115–116

No, because the generation number is particular to each build PHID, so there's no way to say "with build PHIDs and associated build generations". For example, if I'm fetching two builds, one at generation 1 and another at generation 2, I don't want to retrieve generation 1 targets on the generation 2 build, thus the foreach is required to do filtering.

I can probably throw array_unique in there, but it's questionable how many results that will reduce it by.

Changes requested in code review

epriestley edited edge metadata.
epriestley added inline comments.
src/applications/harbormaster/query/HarbormasterBuildQuery.php
115–116

Oh, right.

We could do some kind of magic junk here where pass pairs in, but since restarts are hypothetically rare anyway this seems reasonable as-is.

This revision now requires changes to proceed.Aug 21 2014, 12:54 PM
This revision is now accepted and ready to land.Aug 21 2014, 12:54 PM
hach-que updated this revision to Diff 24850.

Closed by commit rPefadfbbc97f9 (authored by @hach-que).