Skip to content

fix(ci): use k8s pod env vars for API keys instead of GitHub secrets - #782

Merged
slin1237 merged 1 commit into
mainfrom
slin/remove-secret-env-overrides
Mar 17, 2026
Merged

slin1237 merged 1 commit into
mainfrom
slin/remove-secret-env-overrides

Conversation

@slin1237

@slin1237 slin1237 commented Mar 17, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Removes GitHub secret references for API keys from workflow env blocks
  • API keys are now injected as env vars on k8s runner pods via secretKeyRef

Problem

GitHub secrets (HF_TOKEN, OPENAI_API_KEY, CLAUDE_API_KEY, XAI_API_KEY) were removed from the repo. The workflow env blocks ANTHROPIC_API_KEY: ${{ secrets.CLAUDE_API_KEY }} resolved to empty strings, overriding the pod-level env vars and causing all external API tests to fail.

What changed

  • e2e-gpu-job.yml: Removed HF_TOKEN, OPENAI_API_KEY, XAI_API_KEY, ANTHROPIC_API_KEY
  • pr-test-rust.yml: Removed HF_TOKEN, OPENAI_API_KEY, XAI_API_KEY, ANTHROPIC_API_KEY from 3 env blocks
  • nightly-benchmark.yml: Removed HF_TOKEN from 3 env blocks

Test plan

  • E2E tests pick up API keys from pod env vars
  • anthropic-messages job no longer fails with "ANTHROPIC_API_KEY not set"

Summary by CodeRabbit

  • Chores
    • Updated CI/CD workflow configurations to streamline test and benchmark execution environments.

API keys (HF_TOKEN, OPENAI_API_KEY, ANTHROPIC_API_KEY, XAI_API_KEY) are
now injected as env vars directly on k8s runner pods via secretKeyRef.

The workflow env: blocks were overriding pod env vars with empty strings
because the GitHub secrets were removed, causing all external API tests
to fail with "ANTHROPIC_API_KEY not set".

What changed:
- .github/workflows/e2e-gpu-job.yml: remove HF_TOKEN, OPENAI_API_KEY,
  XAI_API_KEY, ANTHROPIC_API_KEY from env block
- .github/workflows/pr-test-rust.yml: remove HF_TOKEN, OPENAI_API_KEY,
  XAI_API_KEY, ANTHROPIC_API_KEY from 3 env blocks
- .github/workflows/nightly-benchmark.yml: remove HF_TOKEN from 3
  env blocks

Signed-off-by: Simo Lin <linsimo.mark@gmail.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@github-actions github-actions Bot added the ci CI/CD configuration changes label Mar 17, 2026
@coderabbitai

coderabbitai Bot commented Mar 17, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a556d500-c42c-4541-95c7-e9124e65bf71

📥 Commits

Reviewing files that changed from the base of the PR and between 56f31bb and 2b91a48.

📒 Files selected for processing (3)
  • .github/workflows/e2e-gpu-job.yml
  • .github/workflows/nightly-benchmark.yml
  • .github/workflows/pr-test-rust.yml
💤 Files with no reviewable changes (3)
  • .github/workflows/nightly-benchmark.yml
  • .github/workflows/e2e-gpu-job.yml
  • .github/workflows/pr-test-rust.yml

📝 Walkthrough

Walkthrough

Environment variables containing API keys and tokens (HF_TOKEN, OPENAI_API_KEY, XAI_API_KEY, ANTHROPIC_API_KEY) are removed from multiple GitHub Actions workflow files across E2E test and benchmark job steps.

Changes

Cohort / File(s) Summary
E2E Test Workflows
.github/workflows/e2e-gpu-job.yml, .github/workflows/pr-test-rust.yml
Removed HF_TOKEN, OPENAI_API_KEY, XAI_API_KEY, and ANTHROPIC_API_KEY environment variables from E2E test job steps.
Benchmark Workflows
.github/workflows/nightly-benchmark.yml, .github/workflows/pr-test-rust.yml
Removed HF_TOKEN environment variable from benchmark and Go OAI server test job steps.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • #550 — Modifies CI workflow files to adjust how e2e jobs handle secrets and Dependabot gating
  • #411 — Changes job environment variables in nightly-benchmark.yml workflow
  • #633 — Manages credentials and environment variable mapping in E2E workflows

Suggested labels

ci, tests

Suggested reviewers

  • CatherineSue
  • key4ng

Poem

🐰 A rabbit hops through workflows clean,
Removing secrets from the scene,
No tokens passed through morning air,
Just tests that run with utmost care! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing GitHub secrets from workflow files and relying on Kubernetes pod environment variables for API keys instead.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch slin/remove-secret-env-overrides
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2b91a48dc9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 665 to 667
- name: Run E2E tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.CLAUDE_API_KEY }}
BRAVE_MCP_HOST: ${{ matrix.setup_agentic_deps && 'brave-search-mcp' || '' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep vendor API keys wired for e2e-vendor jobs

This step now relies entirely on runner-level API key environment variables, but in the checked-in ARC runner configs (scripts/k8s-runner-resources/runner-values-*.yaml) the runner container env only defines Docker-related vars and does not inject OPENAI_API_KEY, XAI_API_KEY, or ANTHROPIC_API_KEY. The vendor test fixture fails hard when those vars are absent (e2e_test/fixtures/setup_backend.py checks api_key_env and calls pytest.fail), so deployments that follow the repo’s runner manifests will fail these jobs after this change unless a fallback (for example GitHub secrets) is kept or the runner env injection is added in-repo.

Useful? React with 👍 / 👎.

@slin1237
slin1237 merged commit 3282dc1 into main Mar 17, 2026
59 of 61 checks passed
@slin1237
slin1237 deleted the slin/remove-secret-env-overrides branch March 17, 2026 07:44
smfirmin pushed a commit to smfirmin/smg that referenced this pull request Mar 20, 2026
smfirmin pushed a commit to smfirmin/smg that referenced this pull request Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD configuration changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant