-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Private repos and restart builds #8
Conversation
@@ -59,6 +65,16 @@ public function fetchRepository($slug) | |||
return $repository; | |||
} | |||
|
|||
public function restartBuild($build) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you might want to move Client::restartBuild($build)
, to maybe Build::restart()
that uses $build->id internally.
That way you could do something like...
$repository = $client->fetchRepository('org/repo-name');
$repsotory->getLastBuild()->restart();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because there is no instance of $client
within a Build
there are two options:
- Pass the client to the build (ok)
$repsotory->getLastBuild()->restart($client);
- Add a
__construct()
to bothRepository
andBuild
that includes$client
, and enable directly calling$build->restart();
(better)
Suggesting going for the full meal deal and allow for Travis objects to perform operations. The build restart action is just the first of many. Question: it ok to go forward with this pull request before doing so?
A new API endpoint is almost available to restart builds... |
Work linking to my fork, which is mostly to accomplish this... |
What is left to be done here ? Would love to help if necessary : ) |
Updated the library to allow public repos in order to allow restarting builds via API. Found trouble using the
file_get_contents()
with authentication headers from within a framework. Curl is better for such things... and POST requests.Notes:
setApiUrlPrivate()
function and private variable.tokenAuthListener
to extend Buzz and allow the correct authorization header.$clientInterface
for curl, and$token
param in the__construct()
function, which uses an event listener in the Buzz library.Curl
interface.$client->restartBuild($build)
method.See here:
Addresses: