jx step create pr chart used inside a pipeline cause an error regarding GIT USER and GIT EMAIL
Upgrade to latest platform
The PR should be sent
The PR failed to be sent
The output of jx version is:
NAME VERSION
jx 2.0.757
jenkins x platform 2.0.1296
Kubernetes cluster v1.13.7-gke.8
kubectl v1.15.2
helm client Client: v2.14.3+g0e7f3b6
git 2.20.1 (Apple Git-117)
Operating System Mac OS X 10.14.6 build 18G95
Workaround shown in here:
https://github.com/zeebe-io/zeebe-cluster-helm/blob/master/jenkins-x.yml
Which is adding to the pipeline configuration these env variables:
buildPack: charts
pipelineConfig:
env:
- name: GIT_COMMITTER_EMAIL
value: [email protected]
- name: GIT_AUTHOR_EMAIL
value: [email protected]
- name: GIT_AUTHOR_NAME
value: jenkins-x-bot
- name: GIT_COMMITTER_NAME
value: jenkins-x-bot
Ok, so those env vars aren鈥檛 getting added automatically for some reason. I鈥檒l look into it.
Ok, I think this is due to the relevant env vars normally getting populated via pod templates, but since the charts pack uses an image ref (https://github.com/jenkins-x-buildpacks/jenkins-x-kubernetes/blob/master/packs/charts/pipeline.yaml#L3) rather than a pod template name (i.e., go), the tasks for this pipeline don't base on the pod templates.
A quick and dirty solution would be to switch the pack to use container: go, but our intent is to move away from the pod templates in the first place, so the right way to address this is the more general one of prepopulating things from the pod templates that we know we want to have in place regardless of whether the image specified is an alias for a pod template like go or an explicit image like here. I will investigate.
great insights
/area regression
Investigated this a bit today - a month or so ago, we added pipelineUserEmail to the team settings, but that isn't going to be set in any install from before it was added, obviously, and also not in any install created by jx install rather than jx boot. So we can't set GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL to a meaningful value with any certainty. I guess we could have it fall back on the [email protected]...
Ok, phew, PR up at https://github.com/jenkins-x/jx/pull/5916 - decided to go with the team settings values if configured, and fall back on the "default" values.
Most helpful comment
Ok, so those env vars aren鈥檛 getting added automatically for some reason. I鈥檒l look into it.