Skip to content

Add resource option for directly injecting resource data for real-time

Tao Guo requested to merge astao/add-direct-payload-processing into master

What does this MR do and why?

This MR is to kick off the iteration for No-code workflow automation. For more context, please see demo1 and demo2.

For the first iteration of the workflow automation, I'm planning to fire off a resque job from inside the GitLab code base whenever an issue/epic/MR/branch changes. The job contains the entity's payload, based on the API's payload schema, and a triage policy for workers to execute.

The change in this MR is to allow the entity (resource) to be passed into the gem, e.g.

  class WorkflowProcessor
    def perform(resource)
      options = Gitlab::Triage::Options.new.tap do |o|
        o.resource = resource
        o.host_url = Gitlab.config.build_gitlab_ci_url
        o.token = token
      end
      Gitlab::Triage::Engine.new(policies: policies, options: options).perform
    end
  end

Merge request reports