Skip to content

test: fix commit-server missing argocd in path#28876

Open
kuci-JK wants to merge 1 commit into
argoproj:masterfrom
kuci-JK:fix/commit-server-path
Open

test: fix commit-server missing argocd in path#28876
kuci-JK wants to merge 1 commit into
argoproj:masterfrom
kuci-JK:fix/commit-server-path

Conversation

@kuci-JK

@kuci-JK kuci-JK commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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.

TestHydratorWithAuthenticatedRepo

  • commit-server does not have argocd in path - causing it to fail to process the git request
  • the argocd is used as the git password helper
  • in the CI the ./dist folder is in PATH, making the argocd accessible
  • fix: set the env the same way repo-server has it in the Procfiles
Log 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:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Title of the PR
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
    • did not find any relevant issues to close
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
    • no changes necessary
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

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>
Copilot AI review requested due to automatic review settings July 23, 2026 15:04
@kuci-JK
kuci-JK requested review from a team as code owners July 23, 2026 15:04
@bunnyshell

bunnyshell Bot commented Jul 23, 2026

Copy link
Copy Markdown

❗ Preview Environment deployment failed on Bunnyshell

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix e2e Procfiles so commit-server finds argocd credential helper

🐞 Bug fix ⚙️ Configuration changes 🧪 Tests 🕐 10-20 Minutes


AI Description

• Add ./dist to PATH for commit-server in local and container Procfiles.
• Apply ARGOCD_GIT_CONFIG via GIT_CONFIG_GLOBAL/NOSYSTEM, matching repo-server.
• Fix local e2e hydrator auth flows where git needs the argocd credential helper.
Diagram

graph TD
  E2E["E2E test"] --> P[/"Procfile(s)"/] --> CS["commit-server"] --> ES("Env setup") --> A("argocd helper") --> GF["git fetch"] --> REPO{{"Remote repo"}}

  subgraph Legend
    direction LR
    _cfg[/"Config"/] ~~~ _svc["Service"] ~~~ _env("Env vars") ~~~ _ext{{"External"}}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Set PATH/GIT_CONFIG in the e2e harness runner (outside Procfiles)
  • ➕ Centralizes test-specific env setup in one place
  • ➕ Avoids duplicating env logic across multiple Procfiles
  • ➖ Harder to keep parity with how services are launched in CI/other dev flows
  • ➖ More indirect; future Procfile-based launches could regress again
2. Make commit-server explicitly configure the credential helper path in code
  • ➕ More robust than relying on environment PATH
  • ➕ Works regardless of how the process is launched
  • ➖ Moves a local-toolchain/test concern into production code paths
  • ➖ Still needs coordination with how repo-server and other components handle git config

Recommendation: Keep the Procfile-based fix: it matches repo-server behavior, preserves CI/local parity, and confines the change to test/service-launch configuration rather than production code.

Files changed (2) +2 / -2

Other (2) +2 / -2
ProcfileInject ./dist PATH and ARGOCD_GIT_CONFIG into commit-server startup +1/-1

Inject ./dist PATH and ARGOCD_GIT_CONFIG into commit-server startup

• Updates the commit-server command to export PATH=$(pwd)/dist:$PATH so git can run the argocd credential helper. Also applies ARGOCD_GIT_CONFIG by exporting GIT_CONFIG_GLOBAL and GIT_CONFIG_NOSYSTEM=1, mirroring repo-server’s environment setup.

Procfile

ProcfileAlign containerized commit-server env with local/CI (PATH + git config) +1/-1

Align containerized commit-server env with local/CI (PATH + git config)

• Modifies the container Procfile’s commit-server entry to add ./dist to PATH and apply ARGOCD_GIT_CONFIG via git environment variables. This prevents authenticated git operations from failing when argocd is not otherwise on PATH.

test/container/Procfile

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

Comment thread test/container/Procfile
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}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's weird that this is necessary for commit-server but not for repo-server. How is repo server getting access to the binary?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@qodo-code-review

Copy link
Copy Markdown

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 review

Powered by Qodo

Comment thread test/container/Procfile
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}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment thread test/container/Procfile
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}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if GIT_CONFIG_GLOBAL and GIT_CONFIG_NOSYSTEM go to commit server, they probably the should go to repo-server as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants