test: fix commit-server missing argocd in path#28876
Conversation
Adds ./dist to PATH in commit-server's process, so the argocd binary used as git credential helper is found, and applies ARGOCD_GIT_CONFIG the same way as repo-server. Signed-off-by: Jan Kučera <jankucera254@gmail.com>
❗ Preview Environment deployment failed on BunnyshellSee: Environment Details | Pipeline Logs Available commands (reply to this comment):
|
PR Summary by QodoFix e2e Procfiles so commit-server finds argocd credential helper
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Bundle ReportBundle size has no change ✅ |
| redis: sh -c "/usr/local/bin/redis-server --save "" --appendonly no --port ${ARGOCD_E2E_REDIS_PORT:-6379}" | ||
| repo-server: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_GNUPGHOME=${ARGOCD_GNUPGHOME:-/tmp/argocd-local/gpg/keys} ARGOCD_PLUGINSOCKFILEPATH=${ARGOCD_PLUGINSOCKFILEPATH:-./test/cmp} ARGOCD_GPG_DATA_PATH=${ARGOCD_GPG_DATA_PATH:-/tmp/argocd-local/gpg/source} ARGOCD_BINARY_NAME=argocd-repo-server $COMMAND --loglevel debug --port ${ARGOCD_E2E_REPOSERVER_PORT:-8081} --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379}" | ||
| commit-server: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "FORCE_LOG_COLORS=1 ARGOCD_BINARY_NAME=argocd-commit-server $COMMAND --loglevel debug --port ${ARGOCD_E2E_COMMITSERVER_PORT:-8086}" | ||
| commit-server: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "export PATH=\$(pwd)/dist:\$PATH && [ -n \"\$ARGOCD_GIT_CONFIG\" ] && export GIT_CONFIG_GLOBAL=\$ARGOCD_GIT_CONFIG && export GIT_CONFIG_NOSYSTEM=1; FORCE_LOG_COLORS=1 ARGOCD_BINARY_NAME=argocd-commit-server $COMMAND --loglevel debug --port ${ARGOCD_E2E_COMMITSERVER_PORT:-8086}" |
There was a problem hiding this comment.
It's weird that this is necessary for commit-server but not for repo-server. How is repo server getting access to the binary?
There was a problem hiding this comment.
This Procfile is for containerized e2e and commit-server works in it as it is.
The change of PATH is not needed here, because git is already in /usr/bin from the docker image and argocd is in the mounted ./dist directory, which is also in PATH (defined in Dockerfile).
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewPowered by Qodo |
| redis: sh -c "/usr/local/bin/redis-server --save "" --appendonly no --port ${ARGOCD_E2E_REDIS_PORT:-6379}" | ||
| repo-server: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_GNUPGHOME=${ARGOCD_GNUPGHOME:-/tmp/argocd-local/gpg/keys} ARGOCD_PLUGINSOCKFILEPATH=${ARGOCD_PLUGINSOCKFILEPATH:-./test/cmp} ARGOCD_GPG_DATA_PATH=${ARGOCD_GPG_DATA_PATH:-/tmp/argocd-local/gpg/source} ARGOCD_BINARY_NAME=argocd-repo-server $COMMAND --loglevel debug --port ${ARGOCD_E2E_REPOSERVER_PORT:-8081} --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379}" | ||
| commit-server: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "FORCE_LOG_COLORS=1 ARGOCD_BINARY_NAME=argocd-commit-server $COMMAND --loglevel debug --port ${ARGOCD_E2E_COMMITSERVER_PORT:-8086}" | ||
| commit-server: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "export PATH=\$(pwd)/dist:\$PATH && [ -n \"\$ARGOCD_GIT_CONFIG\" ] && export GIT_CONFIG_GLOBAL=\$ARGOCD_GIT_CONFIG && export GIT_CONFIG_NOSYSTEM=1; FORCE_LOG_COLORS=1 ARGOCD_BINARY_NAME=argocd-commit-server $COMMAND --loglevel debug --port ${ARGOCD_E2E_COMMITSERVER_PORT:-8086}" |
There was a problem hiding this comment.
This Procfile is for containerized e2e and commit-server works in it as it is.
The change of PATH is not needed here, because git is already in /usr/bin from the docker image and argocd is in the mounted ./dist directory, which is also in PATH (defined in Dockerfile).
| redis: sh -c "/usr/local/bin/redis-server --save "" --appendonly no --port ${ARGOCD_E2E_REDIS_PORT:-6379}" | ||
| repo-server: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "FORCE_LOG_COLORS=1 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_GNUPGHOME=${ARGOCD_GNUPGHOME:-/tmp/argocd-local/gpg/keys} ARGOCD_PLUGINSOCKFILEPATH=${ARGOCD_PLUGINSOCKFILEPATH:-./test/cmp} ARGOCD_GPG_DATA_PATH=${ARGOCD_GPG_DATA_PATH:-/tmp/argocd-local/gpg/source} ARGOCD_BINARY_NAME=argocd-repo-server $COMMAND --loglevel debug --port ${ARGOCD_E2E_REPOSERVER_PORT:-8081} --redis localhost:${ARGOCD_E2E_REDIS_PORT:-6379}" | ||
| commit-server: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "FORCE_LOG_COLORS=1 ARGOCD_BINARY_NAME=argocd-commit-server $COMMAND --loglevel debug --port ${ARGOCD_E2E_COMMITSERVER_PORT:-8086}" | ||
| commit-server: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "export PATH=\$(pwd)/dist:\$PATH && [ -n \"\$ARGOCD_GIT_CONFIG\" ] && export GIT_CONFIG_GLOBAL=\$ARGOCD_GIT_CONFIG && export GIT_CONFIG_NOSYSTEM=1; FORCE_LOG_COLORS=1 ARGOCD_BINARY_NAME=argocd-commit-server $COMMAND --loglevel debug --port ${ARGOCD_E2E_COMMITSERVER_PORT:-8086}" |
There was a problem hiding this comment.
if GIT_CONFIG_GLOBAL and GIT_CONFIG_NOSYSTEM go to commit server, they probably the should go to repo-server as well
This PR fixes some e2e tests when run with the local toolchain. (Splitted from #28857)
Adds ./dist to PATH in commit-server's process, so the argocd binary used as git credential helper is found, and applies ARGOCD_GIT_CONFIG the same way as repo-server.
TestHydratorWithAuthenticatedRepoLog
10:56:37 commit-server | {"level":"info","msg":"Initializing https://localhost:9443/argo-e2e/testdata.git to /tmp/_commit-service/070d0e51-c84a-4ede-a624-b755acf4ea1a","time":"2026-07-21T10:56:37+02:00"} 10:56:37 commit-server | {"branch":"env/test","drySHA":"184f55e37367a6df0e7b2558e9b212dcfc9fcd7b","level":"debug","msg":"Fetching repo https://localhost:9443/argo-e2e/testdata.git","repo":"https://localhost:9443/argo-e2e/testdata.git","time":"2026-07-21T10:56:37+02:00"} 10:56:37 commit-server | {"dir":"/tmp/_commit-service/070d0e51-c84a-4ede-a624-b755acf4ea1a","execID":"02236","level":"info","msg":"git fetch origin --tags --force --prune","time":"2026-07-21T10:56:37+02:00"} 10:56:37 commit-server | {"duration":96413833,"execID":"02236","level":"debug","msg":"","time":"2026-07-21T10:56:37+02:00"} 10:56:37 commit-server | {"execID":"02236","level":"error","msg":"`git fetch origin --tags --force --prune` failed exit status 128: error: cannot run argocd: No such file or directory\nfatal: could not read Username for 'https://localhost:9443': terminal prompts disabled","time":"2026-07-21T10:56:37+02:00"} 10:56:37 commit-server | {"args":"[git fetch origin --tags --force --prune]","dir":"/tmp/_commit-service/070d0e51-c84a-4ede-a624-b755acf4ea1a","level":"info","msg":"Trace","operation_name":"exec git","time":"2026-07-21T10:56:37+02:00","time_ms":96.5495} 10:56:37 commit-server | {"branch":"env/test","drySHA":"184f55e37367a6df0e7b2558e9b212dcfc9fcd7b","error":"failed to init git client: failed to clone repo: `git fetch origin --tags --force --prune` failed exit status 128: error: cannot run argocd: No such file or directory\nfatal: could not read Username for 'https://localhost:9443': terminal prompts disabled","level":"error","msg":"failed to handle commit request","output":"","time":"2026-07-21T10:56:37+02:00"}Checklist: