Skip to content

Expose arbitrary artifacts via MR widget

Fabio Pitino requested to merge expose-artifacts-to-merge-request-widget into master

What does this MR do?

  • Allow user to specify artifacts:expose_as in CI config
  • Save :has_exposed_artifacts in job metadata for queries
  • Find exposed artifacts in build metadata model
  • Expose API endpoint for frontend to fetch this data

Related issue: #15018 (closed)

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Performance and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

QA

test-multi-1:
  script:
    - echo time > time.txt
    - mkdir job-test
    - echo time > job-test/time2.html
  artifacts:
    paths: [time.txt, job-test/time2.html]
    expose_as: "more_artifacts-available_here"

test-multi-2:
  script:
    - mkdir job-test
    - echo time > job-test/time1.html
    - echo time > job-test/time2.html
  artifacts:
    paths: [job-test/]
    expose_as: "this is a - directory"

test-single-1:
  script:
    - echo time > time.txt
  artifacts:
    paths: [time.txt]
    expose_as: "time is here"

test-single-2:
  script:
    - mkdir job-test
    - echo time > job-test/time2.html
  artifacts:
    paths: [job-test/time2.html]
    expose_as: "time2 is here"

test-single-3:
  script:
    - echo time > time.txt
  artifacts:
    paths: [time.txt]
    expose_as: "time is here"

#test-error:
#  script:
#    - echo time > time.txt
#  artifacts:
#    paths: ['*.txt']
#    expose_as: "should not show"
  • Then open a merge request
  • artifacts should appear in the widget area
  • make a change to the yaml and see the artifacts area changing
Edited by Rémy Coutable

Merge request reports