Page MenuHomeDevCentral

Add support for build trigger payloads
ClosedPublic

Authored by dereckson on Aug 2 2016, 21:39.
Tags
Referenced Files
F2849882: D596.id1450.diff
Thu, Apr 25, 08:31
Unknown Object (File)
Sun, Apr 21, 21:47
Unknown Object (File)
Thu, Apr 18, 00:38
Unknown Object (File)
Tue, Apr 16, 12:35
Unknown Object (File)
Sun, Apr 14, 10:58
Unknown Object (File)
Fri, Apr 12, 03:42
Unknown Object (File)
Thu, Apr 11, 13:05
Unknown Object (File)
Tue, Apr 9, 23:44
Subscribers
None

Details

Summary

Payloads to use when triggering a build to select what
exactly should be built.

Documentation is sparse, so this is based on examples
given at the /~/settings/automated-builds/ repo page
on Docker Hub.

Ref T965

Test Plan

Run tests, fire build with JSON encoded version of these payloads.

Diff Detail

Repository
rKDOCKERHUB Keruald Docker Hub
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson retitled this revision from to Add support for build trigger payloads.
dereckson updated this object.
dereckson edited the test plan for this revision. (Show Details)
dereckson added a reviewer: dereckson.
dereckson added inline comments.
src/Build/Payloads/SourceRepositoryBuildPayload.php
10

Abstract this.

"Tag" or "Branch" are internal kitchen and doesn't need to be exposed to the other classes.

29

Throw an exception if tag isn't the expected type.

In C#, I'd say throw an enum, but I don't have a good feeling with enums in PHP when we've to add a dependency.

Oh, and class constants aren't the way to write "Tag" is probably easier than "SourceRepositoryBuildPayload::TAG" or even SourceRepository::TAG.

src/Build/TriggerBuild.php
13

This class

dereckson edited edge metadata.

Single responsibility.

dereckson marked 2 inline comments as done.
dereckson added inline comments.
src/Build/Payloads/SourceRepositoryBuildPayload.php
29

Test me.

47

Test me.

src/Build/TriggerBuild.php
89

@param $branch

100

@param $tag

src/Build/TriggerBuild.php
13

We'll do that in a separate commit.

78

.

96

.

dereckson marked 6 inline comments as done.
dereckson edited edge metadata.

Switch to a static approach for isValidType, more tests.

Rebased against D597.

dereckson edited edge metadata.
dereckson marked 2 inline comments as done.
This revision is now accepted and ready to land.Aug 3 2016, 19:34
dereckson edited edge metadata.

Explanation for NotExistingObjectBuildPayloadMock.

This revision was automatically updated to reflect the committed changes.