Changes to YAML and API
90% of features and integrations in Buddy are developed in response to popular demand. The most recent includes support for multiple-trigger conditions, a feature that required us to change the pipeline model in the REST API and YAML to have it shipped. The changes also enable triggering pipelines on new events, like creating and removing branches or issuing pull requests.
What you need to know
Currently all responses return the following header:
X-Buddy-Media-Type: buddy.v1.0.0
To adjust your apps that use REST API with the new model, you will have to update it to version 1.1.0 (it will also be visible in responses):
X-Buddy-Media-Type: buddy.v1.1.0
Trigger conditions
At the moment, the changes in the REST API and YAML involve the fields that are responsibe for setting up the trigger condition in the pipeline and/or action:
yamltrigger_condition trigger_condition_paths trigger_variable_key trigger_variable_value trigger_hours trigger_days zone_id trigger_project_name trigger_pipeline_name
Those fields can now be replaced by the trigger conditions array:
yamltrigger_condtion[] trigger_condtions
YAML example
Each array object has to be provided with the exact same fields:
yamltrigger_conditions: - trigger_condition: "VAR_IS" trigger_variable_value: "expectedValue" trigger_variable_key: "myVar"
REST API example
Each array object has to be provided with the exact same fields:
json"trigger_conditions": [ { "trigger_condition": "VAR_IS", "trigger_variable_value": "expectedValue", "trigger_variable_key": "myVar" } ]
trigger_conditions
array, or sending an empty trigger_conditions: []
will be equivalent of the deprecated trigger_condition: ALWAYS
Trigger modes
ref_type
is no longer availabletrigger_mode
has been replaced withon:
Trigger mode values are replaced with new ones:
MANUAL
→CLICK
ON_EVERY_PUSH
→EVENT
SCHEDULED
→SCHEDULE
BUDDY_EXECUTION_MODE
variable in the pipeline execution.
For on: "CLICK"
and on: "SCHEDULE"
, you can send a collection of refs for which the pipelines is to be executed. For example:
yamlon: "CLICK" refs: - "refs/heads/dev"
For on: EVENT
you need to send array of events:
yamlon: "EVENT" events: - type: "PUSH" refs: - "refs/heads/dev"
master
, tag1
) are no longer supported.
Instead, you need to provide a full ref path. For example:
- Master branch:
refs/heads/master
- Tag t1:
refs/tags/t1
- All branches:
refs/heads/*
- All pull requests:
refs/pull/*
- All refs
*
YAML examples
Old:
yaml- pipeline: "buddy" trigger_mode: "MANUAL" ref_type: "NONE"
New:
yaml- pipeline: "buddy" on: "CLICK"
Old:
yaml- pipeline: "buddy" trigger_mode: "MANUAL" ref_name: "master" ref_type: "BRANCH"
New:
YAML- pipeline: "buddy" on: "CLICK" refs: - "refs/heads/master"
Old:
yaml- pipeline: "buddy" trigger_mode: "ON_EVERY_PUSH" ref_name: "master" ref_type: "BRANCH"
New:
yaml- pipeline: "buddy" on: "EVENT" events: - type: "PUSH" refs: - "refs/heads/master"
REST API examples
Old:
json{ "name": "buddy", "trigger_mode": "MANUAL", "ref_type": "NONE" }
New:
json{ "name": "buddy", "trigger_mode": "MANUAL", "on": "CLICK" }
Old:
json{ "name": "buddy", "trigger_mode": "MANUAL", "ref_name": "master", "ref_type": "BRANCH" }
New:
json{ "name": "buddy", "on": "CLICK", "refs": [ "refs/heads/master" ] }
Old:
JSON{ "nam": "buddy", "trigger_mode": "ON_EVERY_PUSH", "ref_name": "master", "ref_type": "BRANCH" }
New:
json{ "pipeline": "buddy", "on": "EVENT", "events": [ { "type": "PUSH", "refs": [ "refs/heads/master" ] } ] }
Changes to execution mode (API only)
mode
has been replaced withtriggeredOn
triggeredOn
uses the same values as pipelines:CLICK
,SCHEDULE
, andEVENT
- During the grace period, data will be fetched in the old way by default
- If you want to use the new mode, please use the
X-Buddy-Media-Type: buddy.v1.1.0
header - Once the transition period ends,
mode
will no longer be supported andtriggeredOn
will become the default.
Jarek Dylewski
Customer Support
A journalist and an SEO specialist trying to find himself in the unforgiving world of coders. Gamer, a non-fiction literature fan and obsessive carnivore. Jarek uses his talents to convert the programming lingo into a cohesive and approachable narration.