-
Bug
-
Resolution: Unresolved
-
Minor
-
Jenkins: 2.346.3
OS: Linux - 5.10.102.1-microsoft-standard-WSL2
---
ace-editor:1.1
apache-httpcomponents-client-4-api:4.5.13-138.v4e7d9a_7b_a_e61
bouncycastle-api:2.25
branch-api:2.1046.v0ca_37783ecc5
caffeine-api:2.9.3-65.v6a_47d0f4d1fe
cloudbees-folder:6.740.ve4f4ffa_dea_54
command-launcher:1.2
commons-lang3-api:3.12.0-36.vd97de6465d5b_
commons-text-api:1.10.0-27.vb_fa_3896786a_7
credentials:1143.vb_e8b_b_ceee347
credentials-binding:523.vd859a_4b_122e6
display-url-api:2.3.6
durable-task:501.ve5d4fc08b0be
filesystem_scm:2.1
git:4.13.0
git-client:3.13.0
ionicons-api:31.v4757b_6987003
jackson2-api:2.13.4.20221013-295.v8e29ea_354141
jakarta-activation-api:2.0.1-2
jakarta-mail-api:2.0.1-2
javax-activation-api:1.2.0-5
javax-mail-api:1.6.2-5
jaxb:2.3.7-1
jdk-tool:1.0
job-dsl:1.81
jsch:0.1.55.61.va_e9ee26616e7
mailer:435.438.v5b_81173f5b_a_1
pipeline-build-step:2.18
pipeline-groovy-lib:613.v9c41a_160233f
pipeline-input-step:456.vd8a_957db_5b_e9
pipeline-milestone-step:101.vd572fef9d926
pipeline-model-api:2.2118.v31fd5b_9944b_5
pipeline-model-definition:2.2118.v31fd5b_9944b_5
pipeline-model-extensions:2.2118.v31fd5b_9944b_5
pipeline-stage-step:296.v5f6908f017a_5
pipeline-stage-tags-metadata:2.2118.v31fd5b_9944b_5
pipeline-utility-steps:2.13.1
plain-credentials:139.ved2b_9cf7587b
scm-api:621.vda_a_b_055e58f7
script-security:1189.vb_a_b_7c8fd5fde
snakeyaml-api:1.32-86.ve3f030a_75631
ssh-credentials:305.v8f4381501156
sshd:3.0.3
structs:324.va_f5d6774f3a_d
trilead-api:1.67.vc3938a_35172f
variant:59.vf075fe829ccb
workflow-aggregator:590.v6a_d052e5a_a_b_5
workflow-api:1200.v8005c684b_a_c6
workflow-basic-steps:994.vd57e3ca_46d24
workflow-cps:3520.va_8fc49e2f96f
workflow-durable-task-step:1210.va_1e5d77e122b
workflow-job:1207.ve6191ff089f8
workflow-multibranch:716.vc692a_e52371b_
workflow-scm-step:400.v6b_89a_1317c9a_
workflow-step-api:639.v6eca_cd8c04a_a_
workflow-support:839.v35e2736cfd5cJenkins: 2.346.3 OS: Linux - 5.10.102.1-microsoft-standard-WSL2 --- ace-editor:1.1 apache-httpcomponents-client-4-api:4.5.13-138.v4e7d9a_7b_a_e61 bouncycastle-api:2.25 branch-api:2.1046.v0ca_37783ecc5 caffeine-api:2.9.3-65.v6a_47d0f4d1fe cloudbees-folder:6.740.ve4f4ffa_dea_54 command-launcher:1.2 commons-lang3-api:3.12.0-36.vd97de6465d5b_ commons-text-api:1.10.0-27.vb_fa_3896786a_7 credentials:1143.vb_e8b_b_ceee347 credentials-binding:523.vd859a_4b_122e6 display-url-api:2.3.6 durable-task:501.ve5d4fc08b0be filesystem_scm:2.1 git:4.13.0 git-client:3.13.0 ionicons-api:31.v4757b_6987003 jackson2-api:2.13.4.20221013-295.v8e29ea_354141 jakarta-activation-api:2.0.1-2 jakarta-mail-api:2.0.1-2 javax-activation-api:1.2.0-5 javax-mail-api:1.6.2-5 jaxb:2.3.7-1 jdk-tool:1.0 job-dsl:1.81 jsch:0.1.55.61.va_e9ee26616e7 mailer:435.438.v5b_81173f5b_a_1 pipeline-build-step:2.18 pipeline-groovy-lib:613.v9c41a_160233f pipeline-input-step:456.vd8a_957db_5b_e9 pipeline-milestone-step:101.vd572fef9d926 pipeline-model-api:2.2118.v31fd5b_9944b_5 pipeline-model-definition:2.2118.v31fd5b_9944b_5 pipeline-model-extensions:2.2118.v31fd5b_9944b_5 pipeline-stage-step:296.v5f6908f017a_5 pipeline-stage-tags-metadata:2.2118.v31fd5b_9944b_5 pipeline-utility-steps:2.13.1 plain-credentials:139.ved2b_9cf7587b scm-api:621.vda_a_b_055e58f7 script-security:1189.vb_a_b_7c8fd5fde snakeyaml-api:1.32-86.ve3f030a_75631 ssh-credentials:305.v8f4381501156 sshd:3.0.3 structs:324.va_f5d6774f3a_d trilead-api:1.67.vc3938a_35172f variant:59.vf075fe829ccb workflow-aggregator:590.v6a_d052e5a_a_b_5 workflow-api:1200.v8005c684b_a_c6 workflow-basic-steps:994.vd57e3ca_46d24 workflow-cps:3520.va_8fc49e2f96f workflow-durable-task-step:1210.va_1e5d77e122b workflow-job:1207.ve6191ff089f8 workflow-multibranch:716.vc692a_e52371b_ workflow-scm-step:400.v6b_89a_1317c9a_ workflow-step-api:639.v6eca_cd8c04a_a_ workflow-support:839.v35e2736cfd5c
I have a job where I am passing the following Map to the checkout step:
[changelog:false, poll:false, scm:[$class:GitSCM, branches:[[name:develop]], extensions:[[$class:LocalBranch, localBranch:**]], userRemoteConfigs:[[url:https://github.com/DontShaveTheYak/jenkins-std-lib.git]]]]
This should checkout the `develop` branch. And it used too. I have tests in a pipeline that used to pass and no longer do. The output of the step looks okay.
[Pipeline] checkout The recommended git tool is: NONE No credentials specified > git rev-parse --resolve-git-dir /var/jenkins_home/workspace/generic-example/testing/.git # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url https://github.com/DontShaveTheYak/jenkins-std-lib.git # timeout=10 Fetching upstream changes from https://github.com/DontShaveTheYak/jenkins-std-lib.git > git --version # timeout=10 > git --version # 'git version 2.30.2' > git fetch --tags --force --progress -- https://github.com/DontShaveTheYak/jenkins-std-lib.git +refs/heads/*:refs/remotes/origin/* # timeout=10 > git rev-parse origin/develop^{commit} # timeout=10 Checking out Revision c268577b1bfc2c5f74cd2bd61a6c61996099b50f (origin/develop) > git config core.sparsecheckout # timeout=10 > git checkout -f c268577b1bfc2c5f74cd2bd61a6c61996099b50f # timeout=10 > git branch -a -v --no-abbrev # timeout=10 > git branch -D develop # timeout=10 > git checkout -b develop c268577b1bfc2c5f74cd2bd61a6c61996099b50f # timeout=10 Commit message: "Merge pull request #196 from DontShaveTheYak/develop"
But the Map of values returned from the checkout step contains this:
[GIT_BRANCH:origin/master, GIT_COMMIT:c268577b1bfc2c5f74cd2bd61a6c61996099b50f, GIT_LOCAL_BRANCH:master, GIT_PREVIOUS_COMMIT:c268577b1bfc2c5f74cd2bd61a6c61996099b50f, GIT_URL:https://github.com/DontShaveTheYak/jenkins-std-lib.git]
When I verify manually with the `git branch` using `sh` I get this:
[Pipeline] sh + git branch * develop
So `checkout` says were are on `master` but `git` says `develop`. To be fair they do have the same commit at the HEAD. But this used to work correctly and now doesn't.
If someone is going to look into this I can help dig in deeper and might be able to isolate when this stopped working.
Possibly related to https://issues.jenkins.io/browse/JENKINS-45489 ? As this does come after a previous checkout. I first checkout my default branch and then later checkout develop.