Pipeline triggered through API not showing trigger variables
Summary
I have been triggering a pipeline on gitlab.com for a private project through the API a couple of months ago. Doing this added the triggered
label to the associated jobs and I could see the trigger variables in the right side plane of the job's log page. However new pipeline's triggered recently through the API are no longer being identified as triggered and are not displaying the trigger variables on the jobs log page.
Steps to reproduce
- Setup a trigger in the
Pipeline
sub-tab of the settings tab - Call the new trigger through the API while including tigger variables
- Observe no
trigger
tag under theJobs
sub-tab of thePipelines
tab - Observe no trigger variables present on the jobs log page
Step 2 has been attempted with trigger variables in the query sting or in the body of the POST as from-data
or x-www-from-urlencoded
. In all cases no trigger variables show up.
Example Project
An example project has been set up at Galadirith/trigger-variables-test. A trigger was set up as described in the Steps to reproduce. The trigger was then called through the API with a POST request to
https://gitlab.com/api/v4/projects/4086428/ref/master/trigger/pipeline?token=d1f8e1947b9eb2fa6f14efbde9c316&variables[VARA]=hello&variables[VARB]=world
The job associated with the trigger can be seen at https://gitlab.com/Galadirith/trigger-variables-test/-/jobs/31512259
What is the current bug behavior?
Triggered jobs are not labeled with trigger
and do not report their trigger variables in the right hand panel of the jobs log page.
What is the expected correct behavior?
Trigger jobs should be labeled with trigger
and report their trigger variables in the right hand panel of the jobs log page as is described in the documentation Making use of trigger variables.
Relevant logs and/or screenshots
For my private project new pipeline's triggered recently through the API are no longer being identified as triggered
and are not displaying the trigger variables on the jobs log page.
The trigger variables can be viewed on the right for this job run 2 months ago...
... but using the same API endpoint, the trigger variables can no longer be viewed on the right for this job run recently
These new pipelines were definitely triggered by the API endpoint using
https://gitlab.com/api/v4/projects/:id/ref/master/trigger/pipeline
and you can see the time the job ran is the same as the "Last Used" time under the trigger token, in the example of the image the "Last Used" time under the trigger token reads 23h ago. My .gitlab-ci.yml has a single target configured as
only:
- triggers
The jobs all succeed, I get an output that is correct and only possible if the trigger variables were avilable, so the trigger variables definitely reach the CI script.
Output of checks
This bug happens on GitLab.com
References
This was first reported on forum.gitlab.com and has also been reported on stackoverflow.com.