Skip to content

Incorrect username on automatically triggered jobs

Hello,

I am noticing an issue with username set on automatically triggered jobs in gitlab CI.

Summary

Username is not set correctly on automatically triggered jobs

Steps to reproduce

UserA initiates the pipeline. The pipeline has an Initiate release manual trigger that triggers deployments to 2 different environments automatically. Let's say UserB clicks Initiate release button. I expect my automatic jobs to show Job #XXXX triggered about 19 hours ago by UserB. But the automatic jobs show Job #XXXX triggered about 19 hours ago by UserA. This is a typical workflow for us. The developer that makes a commit is not necessarily responsible for releasing the change. In this case, UserB may be releasing multiple commits by various developers and having the pipeline initiator name as the releaser is not accurate.

What is the current bug behavior?

Job page for automatic jobs on gitlab shows Job #XXXX triggered about 19 hours ago by UserA. Please note that the Initiate release shows as Job #XXXX triggered about 19 hours ago by UserB. We are seeing this on gitlab UI and also the API.

What is the expected correct behavior?

Job page for automatic jobs on gitlab shows Job #XXXX triggered about 19 hours ago by UserB

Relevant logs and/or screenshots

image

stages:
 - "Initiate release"
 - "Production deployment"

initiate release:
  stage: "Initiate release"
  only:
  - gitlab_fix
  allow_failure: false
  when: manual
  script:
  - echo "No-op stage that triggers production deployment"

production deploy:
  stage: "Production deployment"
  environment:
    name: production
  only:
  - gitlab_fix
  when: on_success
  script: 
  - echo "PROD deploy"

DR deploy:
  stage: "Production deployment"
  environment:
    name: ashburn
  only:
  - gitlab_fix
  when: on_success
  script: 
  - echo "DR deploy" 
Edited by nuppala