Draft: Emit some issue events to AutoFlow
What does this MR do and why?
This change set introduces some new events for issues:
- created
- updated
- closed
- reopened
They are based on the EventStore.
The events come with associated workers to forward those events to AutoFlow as part of AutoFlow PoC: configurable automation for issue... (&12571).
We will most definitely have to adjust the worker configurations to meet AutoFlows requirements - once properly specified.
Refs Add more triggers for autoflow (#443486)
Testing
- You may setup AutoFlow in GDK as described in https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/autoflow.md
- Enable feature flags (
autoflow_enabled
andautoflow_issue_events_enabled
) - Implement basic Flow script in some project in
.gitlab/autoflow/main.star
:
def output_event_data(w, ev):
print("Handling test event: " + ev["type"] + " with data: " + str(ev["data"]))
on_event(
type="com.gitlab.events.issue_created",
handler=output_event_data,
)
on_event(
type="com.gitlab.events.issue_updated",
handler=output_event_data,
)
on_event(
type="com.gitlab.events.issue_closed",
handler=output_event_data,
)
on_event(
type="com.gitlab.events.issue_reopened",
handler=output_event_data,
)
- Create, Update, Close and Reopen an issue in that project
- Verify KAS output that you see the prints from the
output_event_data
handler of the Flow script.
Edited by Timo Furrer