Skip job request and warn when runner token is empty

What does this MR do?

When the runner token is empty or whitespace-only in config.toml, the runner is silently skipped during job polling (no log spam), and a single operator-facing warning is emitted once per config load.

Why was this MR needed?

When token is missing from a [[runners]] entry in config.toml (by mistake or misconfiguration), the runner was still sending a job request on every poll. GitLab rejected each one with 400 Bad Request. The logged errors did not surface the root cause, forcing operators to cross-reference failures against config.toml to discover the token was missing.

Root cause: There was no guard for an empty token before a runner was fed into the workers channel, so invalid runners reached processRunner and triggered network calls.

Fix — two concerns, two places:

  1. feedRunner (silent gate): When runner.Token is empty or whitespace-only, feedRunner increments runnerWorkersFeedFailures and returns immediately — no log. This matches the existing isHealthy gate exactly and keeps the invalid runner out of the worker pipeline without producing log spam on every poll cycle.

  2. reloadConfig (once-per-load warning): The operator-facing warning is emitted in the per-runner loop inside reloadConfig(), alongside the existing WarnOnLegacyCIURL() call. This fires exactly once at startup and once on each config reload — when the misconfiguration is actionable. No sync.Map or per-runner dedup state is needed: the config-version boundary is the natural throttle.

What is the best way to test this MR?

  1. Add a [[runners]] entry to config.toml with an empty or missing token field.
  2. Start the runner and observe that:
    • No job requests are sent to GitLab for that runner.
    • A warning is logged once at startup (and once on each reload).
    • No repeated warnings appear during normal polling.
  3. Run the unit tests: go test -run TestFeedRunner_EmptyToken|TestReloadConfig_EmptyTokenWarning ./commands/

What are the relevant issue numbers?

Closes #39495

Edited by Duo Developer

Merge request reports

Loading