Page MenuHomePhabricator

Don't crash when users fail to specify additional working copies
Closed, ResolvedPublic

Description

My current dev environment is destroyed in a number of interesting ways for unrelated reasons so I can't get the actual error output to show, but I just ran into this. The error happens here:

https://secure.phabricator.com/diffusion/P/browse/master/src/applications/harbormaster/step/HarbormasterLeaseWorkingCopyBuildStepImplementation.php;1a4e5931f86f49dffff6c244c5c3a8d87d1f5cb2$159

and is caused by assuming that you'll have other repositories cloned, when none are specified, you aren't returned something iterable:

https://secure.phabricator.com/diffusion/P/browse/master/src/applications/harbormaster/step/HarbormasterLeaseWorkingCopyBuildStepImplementation.php;1a4e5931f86f49dffff6c244c5c3a8d87d1f5cb2$137

Event Timeline

yelirekim updated the task description. (Show Details)
yelirekim added a subscriber: yelirekim.

As a workaround, editing + saving the step should populate this with an empty array. But we can be a little more defensive in the actual implementation.

Specifically, I think this was only for steps created prior to the introduction of the "Other Working Copies" field. New ones should work OK without specifying additional working copies.

(If that sounds wrong, I can try harder to repro this.)

I did do at least this to try to get this to disappear:

  • Add another working copy to clone (everything worked fine)
  • Removed that working copy (crashed again)
  • Looked in the DB and saw null as the value for this field.

I don't think it populates the value as [], which is what I was expecting. Maybe that's what customfield tries to do, but harbormaster step values clobber it somewhere?

Yeah it's busted by default including newly created steps

New build step:

           id: 21
         phid: PHID-HMCS-4wte5ckkt72jykp2tcxs
buildPlanPHID: PHID-HMCP-ntxfv6ctnevgvys4bbav
    className: HarbormasterLeaseWorkingCopyBuildStepImplementation
      details: {"dependsOn":[],"name":"poop"}
  dateCreated: 1445807887
 dateModified: 1445807887
     sequence: 0
         name: Lease Working Copy
  description: 
  stepAutoKey: NULL

added another working copy:

           id: 21
         phid: PHID-HMCS-4wte5ckkt72jykp2tcxs
buildPlanPHID: PHID-HMCP-ntxfv6ctnevgvys4bbav
    className: HarbormasterLeaseWorkingCopyBuildStepImplementation
      details: {"dependsOn":[],"name":"poop","repositoryPHIDs":"[\"PHID-REPO-r4tw2addi52ipxgnyuu3\"]"}
  dateCreated: 1445807887
 dateModified: 1445807967
     sequence: 0
         name: Lease Working Copy
  description: 
  stepAutoKey: NULL

removed that working copy:

           id: 21
         phid: PHID-HMCS-4wte5ckkt72jykp2tcxs
buildPlanPHID: PHID-HMCP-ntxfv6ctnevgvys4bbav
    className: HarbormasterLeaseWorkingCopyBuildStepImplementation
      details: {"dependsOn":[],"name":"poop","repositoryPHIDs":null}
  dateCreated: 1445807887
 dateModified: 1445807981
     sequence: 0
         name: Lease Working Copy
  description: 
  stepAutoKey: NULL