Skip to content

Draft: Make pre- and post-get-sources-scripts globally configurable

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA

What does this MR do?

Allow pre|post_get_sources_script to be configured globally for all runners.

Why was this MR needed?

This is for pre- and post-get-sources actions that every job on a runner's host might need to do. And adding copy-pasting the same scripts to every [[runners]] config would make for duplication. For example:

  • importing certificates
  • logging custom job metadata
  • cleanups

Why does this MR cover only one of the things asked in the original issue?

The original issue is about allowing environment, pre|post_get_sources_script, pre|post_build_script be configured globally for all runners. After looking at where and how these three configs are consumed and processed, I'd like to suggest splitting up the implementation of the issue into (at least) three MRs, one for each of the three runner settings, and possibly more in case more work is needed around this implementation.

Reasons:

  • if introduced on the global scope plainly, each of these settings
    • opens up different questions
    • some of them seem easier to implement than the others
  • this is my first contribution, so I might need more commits to iron it out 😅, so small steps to keep it under the 10 commits limit for MRs

What's the best way to test this MR?

What are the relevant issue numbers?

#37399

Edited by Kirill Sybin

Merge request reports