-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Env variable like GITLAB_OA_IID are not set when a MR job is triggered manually from Jenkins #293
Comments
I don't think this is possible. |
Thank very much for your feedback @Turiok. We have changed to use env variables that are set in both the manually triggered case and the GitLab triggered case.
We are now missing some more information such as:
Start of the log in the GitLab triggered case:
Start of the log in the manually triggered case:
In both cases we are going trough the code that reads the MR: gitlab-branch-source-plugin/src/main/java/io/jenkins/plugins/gitlabbranchsource/GitLabSCMSource.java Lines 265 to 271 in ad1ce6d
So the information would be available, since the MR is read from GitLab in both cases. Would it be possible to expose some of the MR attributes as environment variables that could be reused later in the Jenkins job? For example Line 27 in ad1ce6d
Any hint is very much appreciated. |
Jenkins and plugins versions report
Environment
What Operating System are you using (both controller, and any agents involved in the problem)?
Linux
Reproduction steps
Have a project configured:
Open an MR in GitLab.
This triggers a job in the MR view:
On one Job in this MR view click on "Build" (or "Build with parameter" if the Jenkinsfile defines some parameter) to trigger a manual job.
Expected Results
I would like the env variables (like
GITLAB_OA_IID
,GITLAB_OA_SOURCE_BRANCH
,GITLAB_OA_LAST_COMMIT_ID
...) to be set as it is the case when the Job is triggered from GitLab.Actual Results
All the
GITLAB_
env variable are not set in case of a manually triggered job.Anything else?
Maybe I should rewrite my Jenkinsfile to use other env variable that are present in both the GitLab triggered and the Manually triggered case:
CHANGE_BRANCH
seems to beGITLAB_OA_SOURCE_BRANCH
CHANGE_ID
seems to beGITLAB_OA_IID
But I could not find a equivalent of
GITLAB_OA_LAST_COMMIT_ID
The text was updated successfully, but these errors were encountered: