Expose arbitrary artifacts via MR widget
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
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
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