Page MenuHomePhabricator

Prevent crashes when more than one buildable for an object exists
ClosedPublic

Authored by hach-que on Nov 9 2013, 4:32 AM.
Tags
None
Referenced Files
F14047264: D7543.diff
Thu, Nov 14, 3:14 AM
F14035407: D7543.diff
Sun, Nov 10, 5:47 AM
F14022258: D7543.diff
Wed, Nov 6, 3:49 PM
F13994147: D7543.diff
Wed, Oct 23, 4:12 AM
F13975986: D7543.id17028.diff
Fri, Oct 18, 12:26 PM
F13974710: D7543.id17020.diff
Fri, Oct 18, 6:59 AM
F13965424: D7543.id17020.diff
Oct 16 2024, 2:00 AM
Unknown Object (File)
Oct 9 2024, 3:02 PM

Details

Summary

This prevents a crash in applying build plans when more than one buildable exists for the same object. It also adds a check into the "New Manual Build" page to ensure that users can't create a buildable for an object that already has one.

Test Plan

Tried to create a buildable for an object that already has one and a nice friendly error appeared. Applied a build plan to a buildable whose object has two buildables and didn't get a crash any more.

Diff Detail

Branch
fix-crash
Lint
Lint Errors
SeverityLocationCodeMessage
Errorsrc/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php:233PHL1Unknown Symbol
Unit
No Test Coverage

Event Timeline

It also adds a check into the "New Manual Build" page to ensure that users can't create a buildable for an object that already has one.

At least tentatively, I think this should be allowed. If you're testing build plans, it lets you basically create a copy of some buildable and muck around with it without messing up the "real" one. There probably should be a flag to distinguish the "real" one from synthetic copies, though. For example, I wouldn't want a build to go red and send a bunch of alerts out because I messed up when configuring a new plan or whatever.

The existing code looks up the buildable by the object's PHID when applying a plan, so we'd need to change the code to allow a buildable's PHID to be passed through (otherwise it will always pick the first buildable, and not necessarily the one that you applied the plan to).

hach-que updated this revision to Unknown Object (????).Nov 9 2013, 4:46 AM

Remove change to buildable edit controller.

(Updating libphutil/ should clear that lint -- that class is new.)

Closed by commit rP43847d6bd7bb (authored by @hach-que, committed by @epriestley).