(Some values are ofuscated)
We have a QB configuration with a simple "Repository > Checkout" step.
Our QB is v14.0.7.
The repository definition has a simple config as:
Name | Git Repository |
Fetch URL | ${vars.getValue("GIT_REPO_URL")} |
Branch Name | ${vars.getValue("GIT_TTB")} |
Where vars
are defined in runtime and take values as:
GIT_REPO_URL: git_user@git.repo.local:dms/srv-proxy.git
GIT_TTB: feature/logPropsCertificate
The issue detected is that when step performs the clone
from repository we are getting a older version than expected.
Our repo have these branches/commits:
4761eb4326 | cert properties | feature/logPropsCertificate |
Jane Doe 2025-03-28 13:15:38 +0100 |
f11359eaaa | cert properties | Jane Doe 2025-03-26 16:32:32 +0100 | |
96f5dfdc7a | repo init | master 1.0.2 develop |
John Doe 28 dic 2023, 12:53:33 +0100 |
What we expect is that when we configure the feature/logPropsCertificate
in the vars, the step would clone the 4761eb4326
commit.
What we are getting is the clone from the 96f5dfdc7a
commit.
Enabling the TRACE debug level we get these logs:
13:14:37,168 INFO - Checking step execute condition...
13:14:37,169 INFO - Step execute condition satisfied, executing...
13:14:37,290 INFO - Executing pre-execute action...
13:14:37,290 INFO - Running step...
13:14:37,290 INFO - Checking out revision '96f5dfdc7a93d7b851c6ceb070c5ac6bb5a212ad' of repository 'Git repository'...
13:14:37,291 DEBUG - sync working directory [/tmp/quickbuild/workspaces/root/RHEL/Dms7.X/ServiciosProxy/source/srv-proxy]...
13:14:37,291 DEBUG - Detect whether repository settings have been changed ...
13:14:37,291 DEBUG - Loading scm rc file ...
13:14:37,291 WARN - Repository RC file /tmp/quickbuild/workspaces/root/RHEL/Dms7.X/ServiciosProxy/source/srv-proxy/.qbcache/qb-scm.xml doesn't exist!
13:14:37,291 INFO - Repository does not exist, creating...
13:14:37,291 DEBUG - Creating git repository to directory [/tmp/quickbuild/workspaces/root/RHEL/Dms7.X/ServiciosProxy/source/srv-proxy] ...
13:14:37,292 DEBUG - Executing command: git clone --no-checkout alm_gitea@gitea.grupoci.local:dms/srv-proxy.git /tmp/quickbuild/workspaces/root/RHEL/Dms7.X/ServiciosProxy/source/srv-proxy
.../...
13:14:37,297 DEBUG - Cloning into '/tmp/quickbuild/workspaces/root/RHEL/Dms7.X/ServiciosProxy/source/srv-proxy'...
13:14:37,662 DEBUG - Executing command: git remote prune origin
.../...
13:14:37,911 DEBUG - Executing command: git fetch
13:14:37,912 DEBUG - Command working directory: /tmp/quickbuild/workspaces/root/RHEL/Dms7.X/ServiciosProxy/source/srv-proxy
.../...
13:14:38,254 DEBUG - Executing command: git fetch origin feature/logPropsCertificate
13:14:38,254 DEBUG - Command working directory: /tmp/quickbuild/workspaces/root/RHEL/Dms7.X/ServiciosProxy/source/srv-proxy
.../...
13:14:38,556 ERROR - From gitea.grupoci.local:dms/srv-proxy
13:14:38,556 ERROR - * branch feature/logPropsCertificate -> FETCH_HEAD
13:14:38,568 DEBUG - Saving scm rc file ...
13:14:38,571 DEBUG - Saving scm rc file ...
13:14:38,573 DEBUG - Executing command: git checkout -f 96f5dfdc7a93d7b851c6ceb070c5ac6bb5a212ad
13:14:38,573 DEBUG - Command working directory: /tmp/quickbuild/workspaces/root/RHEL/Dms7.X/ServiciosProxy/source/srv-proxy
.../...
13:14:38,581 WARN - Note: checking out '96f5dfdc7a93d7b851c6ceb070c5ac6bb5a212ad'.
13:14:38,581 WARN -
13:14:38,581 WARN - You are in 'detached HEAD' state. You can look around, make experimental
13:14:38,581 WARN - changes and commit them, and you can discard any commits you make in this
13:14:38,581 WARN - state without impacting any branches by performing another checkout.
13:14:38,581 WARN -
13:14:38,581 WARN - If you want to create a new branch to retain commits you create, you may
13:14:38,581 WARN - do so (now or later) by using -b with the checkout command again. Example:
13:14:38,581 WARN -
13:14:38,581 WARN - git checkout -b new_branch_name
13:14:38,581 WARN -
13:14:38,581 INFO - HEAD is now at 96f5dfd... Inicializando repositorio.
13:14:38,583 INFO - Executing post-execute action...
Some notes:
- the ERROR logs aren't errors, is just the system.out from git
- at the very step's beginning it decides that commit to clone will be the
96f5dfd
:
13:14:37,290 INFO - Checking out revision '96f5dfdc7a93d7b851c6ceb070c5ac6bb5a212ad' of repository 'Git repository'...
- if we perform all the steps manually, we get the same result, a clone of 'wrong' commit
We can't see any configuration to perform the desired result (the clone of the branch commit).
Is it possible to achieve this goal using step "Repository > Checkout"?