Page MenuHomeDevCentral

Add support for build trigger payloads
ClosedPublic

Authored by dereckson on Aug 2 2016, 21:39.
Tags
Referenced Files
F3717021: D596.diff
Tue, Nov 5, 23:37
Unknown Object (File)
Mon, Nov 4, 00:00
Unknown Object (File)
Thu, Oct 31, 13:18
Unknown Object (File)
Wed, Oct 30, 16:24
Unknown Object (File)
Sun, Oct 27, 07:36
Unknown Object (File)
Sun, Oct 27, 07:36
Unknown Object (File)
Sun, Oct 27, 07:35
Unknown Object (File)
Sun, Oct 27, 07:35
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 Passed
Unit
Tests Passed
Branch
payloads
Build Status
Buildable 874
Build 1015: arc lint + arc unit

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
28

Test me.

46

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.