Page MenuHomePhabricator

Reference to patch branch fails when building docker images using CI
Open, Needs TriagePublic

Description

We tried to build images with the branch as part of the docker image tag name in mobileapps CI.
It looks like referencing setup.branch returns null where the branch name was expected.

Here is what we tried:
https://gerrit.wikimedia.org/r/c/mediawiki/services/mobileapps/+/851612

And here is the output of the jenkins job:

stage setup completed. exported: ['stage':'setup', 'pipeline':'publish', 'logURL':https://integration.wikimedia.org/ci/job/mobileapps-pipeline-publish/52/console, 'params.ZUUL_URL':'git://contint1001.wikimedia.org', 'params.ZUUL_BRANCH':'restbase-sunset', 'params.ZUUL_REF':'refs/zuul/restbase-sunset/Zf6e02ec5d38d44e6bd359c14677d15ee', 'params.DOC_SUBPATH':'restbase-sunset', 'params.ZUUL_CHANGE':'851612', 'params.MW_COMPOSER_MERGE_MW_IN_VENDOR':'1', 'params.BASE_LOG_PATH':'12/851612/1', 'params.ZUUL_PIPELINE':'postmerge', 'params.ZUUL_CHANGES':'mediawiki/services/mobileapps:restbase-sunset:refs/changes/12/851612/1', 'params.ZUUL_PATCHSET':'1', 'params.LOG_PATH':'12/851612/1/postmerge/trigger-mobileapps-pipeline-publish/f586adf', 'params.ZUUL_PROJECT':'mediawiki/services/mobileapps', 'params.DOC_PROJECT':'mediawiki-services-mobileapps', 'params.ZUUL_VOTING':'1', 'params.ZUUL_CHANGE_IDS':'851612,1', 'params.ZUUL_COMMIT':'81eac17c622a48a9c23f5cc088bcc72804202384', 'params.PLIB_PIPELINE':'publish', 'params.ZUUL_UUID':'f586adf6f6c34e7daeeea4a0e02525aa', 'project':'mediawiki/services/mobileapps', 'projectShortName':'mobileapps', 'commit':'81eac17c622a48a9c23f5cc088bcc72804202384', 'branch':null, 'remote':'git://contint1001.wikimedia.org/mediawiki/services/mobileapps', 'tag':'', 'GIT_AUTHOR_EMAIL':'releng@lists.wikimedia.org', 'GIT_AUTHOR_NAME':'Wikimedia CI', 'GIT_BRANCH':'detached', 'GIT_COMMIT':'81eac17c622a48a9c23f5cc088bcc72804202384', 'GIT_COMMITTER_EMAIL':'releng@lists.wikimedia.org', 'GIT_COMMITTER_NAME':'Wikimedia CI', 'GIT_PREVIOUS_COMMIT':'ac7fc010c151efbd7551bddb9e9b6628b64e9986', 'GIT_PREVIOUS_SUCCESSFUL_COMMIT':'ac7fc010c151efbd7551bddb9e9b6628b64e9986', 'GIT_URL':'git://contint1001.wikimedia.org/mediawiki/services/mobileapps', 'timestamp':'2022-11-02-132305', 'imageLabels':['jenkins.job':'mobileapps-pipeline-publish', 'jenkins.build':'52', 'zuul.commit':'81eac17c622a48a9c23f5cc088bcc72804202384', 'ci.project':'mediawiki/services/mobileapps', 'ci.pipeline':'publish']]

Is there a proper way to add the branch in the docker image tag? Maybe using ZUUL_BRANCH instead?