Spike: Render GLQL output based on type + FFI wrapper

What does this MR do and why?

I've built a PoC to demonstrate how we can pivot on the type field to produce different outputs.

Rather than adding new types I've borrowed existing ones and set the output as follows:

  • For type=incident we assume a REST API, so the output could be a JSON object representing a RESP API request
  • For type=testcase we assume a Rails API, so the output could be a JSON object that we could be parsed and feed into Rails finders attributes for types that do not have a corresponding graphql schema
  • any other type defaults to graphql

(these are just examples - the output format will need to be agreed on)

input: type = mergerequests and label = "bug"
output: query mergeRequests(label = "bug") { ... }

input: type = incident and label = "bug"
output: {
        "method": "POST",
        "path": "/api/v4/testendpoint",
        "body": {
            "label": "bug"
         }
}

input: type = testcase and label = "bug"
output: {finder_params: {limit: 100, where: {label: "bug", type: "TESTCASE"}}}

I've also added some code to make Rust code available to Rails through FFI (needed for gitlab-org/gitlab!190552)

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Daniele Rossetti

Merge request reports

Loading