Skip to content

Draft: Merge Request Widget for Generic Reports

What does this MR do and why?

This merge request collates the job artifacts introduced by !93357 (closed) and adds a merge request widget for it

How to set up and validate locally

  1. Create a project containing the following .gitlab-ci.yml
build:
    image: busybox
    script:
        - echo "Done"
    artifacts:
        reports:
            generic: generic-one.json
test:
    image: busybox
    script:
        - echo "Test"
    artifacts:
        reports:
            generic: generic-two.json

and two json files: generic-one.json

[
    {
      "id": "MesOne",
      "header": "First Message",
      "text": "This is the text of the first message",
      "icon": {
        "name": "neutral"
      },
      "children": [
        {
          "id": "SubMesOne",
          "header": "This is the header of the submessage",
          "text": "SubmessageText",
          "icon": {
            "name": "severityCritical"
          }
        }
      ]
    }
]

generic-two.json

[
    {
      "id": "SecondMessage",
      "header": "Message Two",
      "text": "This is a second message"
    }
]
  1. Create a merge request with any change that leaves these files intact
  2. See the messages on the merge request widget

Screenshots

Screenshot_2022-07-28_16-40-34

Still a bit clunky view if you add a link:

Screenshot_2022-07-28_16-46-26

Open points

  • Should collated messages overwrite each other? They do right now
  • Should the messages be ordered by job they are from or flattened?
  • Should we use the more generic MR Widget V2?
  • Needs test for child pipelines
  • Needs tests in general

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Felix Winterhalter

Merge request reports