Skip to content

Commit

Permalink
fix: 🐛 reorder output of triggers to make more sense
Browse files Browse the repository at this point in the history
  • Loading branch information
joscha committed Oct 17, 2019
1 parent 303b4ed commit eacebd4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/__tests__/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,14 @@ exports[`buildkite-graph general serialization complex yaml 1`] = `
- wait: ~
- label: Update checkpoint
command: production/test/jobs/advance_branch.sh \\"checkpoint/web/green/editor\\"
- label: Deploy to tech
trigger: web-deploy
- trigger: web-deploy
label: Deploy to tech
build:
env:
FLAVOR: tech
RELEASE_PATH: some/path/
- label: Deploy to usertesting
trigger: web-deploy
- trigger: web-deploy
label: Deploy to usertesting
build:
env:
FLAVOR: usertesting
Expand Down
16 changes: 8 additions & 8 deletions src/__tests__/__snapshots__/trigger.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ Object {

exports[`buildkite-graph Steps Trigger async yaml 1`] = `
"steps:
- label: Label
trigger: another
- trigger: another
label: Label
async: true
"
`;

exports[`buildkite-graph Steps Trigger async yaml 2`] = `
"steps:
- label: Label
trigger: another
- trigger: another
label: Label
"
`;

Expand Down Expand Up @@ -370,8 +370,8 @@ Object {

exports[`buildkite-graph Steps Trigger limit branches yaml 1`] = `
"steps:
- branches: master
trigger: another
- trigger: another
branches: master
"
`;

Expand Down Expand Up @@ -402,7 +402,7 @@ Object {

exports[`buildkite-graph Steps Trigger with a label yaml 1`] = `
"steps:
- label: Trigger another pipeline
trigger: another
- trigger: another
label: Trigger another pipeline
"
`;
2 changes: 1 addition & 1 deletion src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export class LabeledStep extends BranchLimitedStep {

async toJson(): Promise<object> {
return {
...(await super.toJson()),
label: this.label,
...(await super.toJson()),
};
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/steps/trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export class TriggerStep extends LabeledStep implements Serializable {

async toJson(): Promise<object> {
return {
...(await super.toJson()),
trigger: this.trigger,
...(await super.toJson()),
async: this._async || undefined,
build: await (this.build as BuildImpl<this>).toJson(),
};
Expand Down

0 comments on commit eacebd4

Please sign in to comment.