Last active
September 24, 2020 19:40
-
-
Save ricardozanini/4bbdd92b72d42809b3493b85bc1565a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "handle_backend", | |
"name": "HandleBackend", | |
"version": "1.0", | |
"functions": [ | |
], | |
"events": [ | |
{ | |
"name": "BackendNewChange", | |
"source": "/checker/workflow", | |
"type": "backend_changed", | |
"kind": "produced" | |
} | |
], | |
"states": [ | |
{ | |
"name": "CheckBackend", | |
"start": { | |
"kind": "default" | |
}, | |
"type": "switch", | |
"dataConditions": [ | |
{ | |
"condition": "{{ $.[?(@.file == 'backend')] }}", | |
"transition": { | |
"produceEvents": [ | |
{ | |
"eventRef": "BackendNewChange" | |
} | |
], | |
"nextState": "HandleBackend" | |
} | |
}, | |
{ | |
"condition": "{{ $.[?(@.file != 'backend')] }}", | |
"end": { | |
"kind": "default" | |
} | |
} | |
] | |
}, | |
{ | |
"name": "HandleBackend", | |
"type": "operation", | |
"actions": [ | |
{ | |
"name": "addBackendLabels", | |
"functionRef": { | |
"refName": "AddLabels", | |
"parameters": { | |
"labels": "backend" | |
} | |
} | |
}, | |
{ | |
"name": "addBackendReviewers", | |
"functionRef": { | |
"refName": "AddReviewers", | |
"parameters": { | |
"reviewers": "LCaparelli" | |
} | |
} | |
} | |
], | |
"end": { | |
"kind": "default" | |
} | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "handle_frontend", | |
"name": "HandleFrontend", | |
"version": "1.0", | |
"functions": [ | |
], | |
"events": [ | |
{ | |
"name": "FrontendNewChange", | |
"source": "/checker/workflow", | |
"type": "frontend_changed", | |
"kind": "produced" | |
} | |
], | |
"states": [ | |
{ | |
"start": { | |
"kind": "default" | |
}, | |
"name": "CheckFrontend", | |
"type": "switch", | |
"dataConditions": [ | |
{ | |
"condition": "{{ $.[?(@.file == 'frontend')] }}", | |
"transition": { | |
"produceEvents": [ | |
{ | |
"eventRef": "FrontendNewChange" | |
} | |
], | |
"nextState": "HandleFrontend" | |
} | |
}, | |
{ | |
"condition": "{{ $.[?(@.file != 'frontend')] }}", | |
"end": { | |
"kind": "default" | |
} | |
} | |
] | |
}, | |
{ | |
"name": "HandleFrontend", | |
"type": "operation", | |
"actions": [ | |
{ | |
"name": "addFrontendLabels", | |
"functionRef": { | |
"refName": "AddLabelsFrontend", | |
"parameters": { | |
"labels": "frontend" | |
} | |
} | |
}, | |
{ | |
"name": "addFrontendReviewers", | |
"functionRef": { | |
"refName": "AddReviewersFrontend", | |
"parameters": { | |
"reviewers": "Kaitou" | |
} | |
} | |
} | |
], | |
"end": { | |
"kind": "default" | |
} | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "prchecker", | |
"name": "Github PR Checker Workflow", | |
"version": "1.0", | |
"functions": [ | |
{ | |
"name": "FetchPRFiles", | |
"type": "service", | |
"metadata": { | |
"interface": "org.kogito.examples.sw.github.workflow.GitHubService", | |
"operation": "fetchPRFiles" | |
} | |
}, | |
{ | |
"name": "AddLabels", | |
"type": "service", | |
"metadata": { | |
"interface": "org.kogito.examples.sw.github.workflow.GitHubService", | |
"operation": "addLabels" | |
} | |
}, | |
{ | |
"name": "AddReviewers", | |
"type": "service", | |
"metadata": { | |
"interface": "org.kogito.examples.sw.github.workflow.GitHubService", | |
"operation": "addReviewers" | |
} | |
} | |
], | |
"events": [ | |
{ | |
"name": "PullRequest", | |
"source": "http://github.com/ricardozanini/kogito-sw-demo", | |
"type": "dev.knative.source.github.pull_request", | |
"kind": "consumed" | |
}, | |
{ | |
"name": "PRVerified", | |
"source": "/checker/workflow", | |
"type": "pr_verified", | |
"kind": "produced" | |
} | |
], | |
"states": [ | |
{ | |
"name": "HandleOpenPR", | |
"type": "event", | |
"start": { | |
"kind": "default" | |
}, | |
"onEvents": [ | |
{ | |
"eventRefs": [ | |
"PullRequest" | |
], | |
"actions": [ | |
{ | |
"functionRef": { | |
"refName": "FetchPRFiles" | |
} | |
} | |
] | |
} | |
], | |
"transition": { | |
"nextState": "DecoratePullRequest" | |
} | |
}, | |
{ | |
"name": "DecoratePullRequest", | |
"type": "parallel", | |
"branches": [ | |
{ | |
"name": "HandleBackendSubFlow", | |
"workflowId": "handle_backend" | |
}, | |
{ | |
"name": "HandleFrontendSubFlow", | |
"workflowId": "handle_frontend" | |
} | |
], | |
"end": { | |
"kind": "default", | |
"produceEvents": [ | |
{ | |
"eventRef": "PRVerified" | |
} | |
] | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment