Page MenuHomePhorge

Fix call to undefined HarbormasterBuildMessageRestartTransaction::isFailed()
ClosedPublic

Authored by aklapper on Jul 27 2024, 11:21.

Details

Summary

The method HarbormasterBuildMessageRestartTransaction::isFailed() does not exist.

While there is a variety of classes that offer a public isFailed() method (HarbormasterBuildStatus, HarbormasterBuildableStatus, HarbormasterBuild, HarbormasterBuildTarget) which could have been meant instead (the git history provides no hints as this code has always been broken), the error message explicitly refers to a Build. Thus replace !$this->isFailed() with !$build->isFailed().

Test Plan

Run static code analysis; Read/grep the code.

Also, have a repository with at least an already-working Harbormaster Build Plan, and enable the option Restartable = "If Failed", and try to restart a failed build. After the patch it does not crash anymore.

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Tested in my production 🤩 fail before, works after, thanks lol

This revision is now accepted and ready to land.Thu, May 1, 22:27

I am excited to announce that I personally watched @valerio.bozzolan crash Harbormaster's build and then load this awesome code into his PC computer machine and then repeat Harbormaster's build and then Harbormaster's build did not crash anymore. Therefore we decided that this awesome code is very good and as a courtesy to every Harbormaster out there will be made available for free, without any charge.