Skip to content

Make GITLAB_TOKEN and GITLAB_USERNAME optional (pair or neither)

Klaus Wölfel requested to merge make-gitlab-env-optional into master

Previously both GITLAB_TOKEN and GITLAB_USERNAME were required, causing the process to abort if either was missing. Now they are optional:

  • Both set → askpass helper is created for HTTPS git auth (as before)
  • Neither set → git runs without askpass; may prompt or use other credential helpers
  • Only one set → configuration error, raises ValueError / SystemExit

Changes:

  • klausagent/env.py: gitlab vars are optional; error only on inconsistent pair (one set, other missing)
  • klausagent/tools/git_tools_server.py: _check_gitlab_env() allows neither-set; _run() skips askpass when neither is set; error only when exactly one is set
  • run.sh: remove hard GITLAB_TOKEN/GITLAB_USERNAME checks; add consistency check (both or neither)
  • README.md: document gitlab vars as optional pair
  • tests/test_env.py: update for optional semantics
  • tests/test_startup_env_check.py: update for optional semantics
  • tests/test_askpass.py: test_run_skips_askpass_when_no_gitlab_env
  • tests/test_auto_push.py: remove gitlab env mocking (no longer needed)

Merge request reports