Add job to /api/v4/job/allowed_agents context
What does this MR do and why?
This way, the log fields meta.project
and meta.root_namespace
get
automatically filled with the job's project and root namespace, which is
very useful for identifying the source of a request.
See https://gitlab.com/gitlab-org/configure/general/-/issues/286#note_1124050509
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
- Create a CI job in your GDK
- Grab its token, e.g.
CI::Job.last.token
- Call
/api/v4/job/allowed_agents
with the job token (docs) - Find the corresponding log entry in
$GDK/gitlab/log/api_json.log
(search forallowed_agents
). Notice thatmeta.job_id
,meta.pipeline_id
,meta.project
,root_namespace
are all filled now.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.