fix(e2e): support compatible credential migration#5380
Conversation
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a hosted-inference fixture and Vitest support tests, updates the live credential-migration E2E to use the fixture for credential/provider/model resolution, and adjusts CI workflows to set env vars that exercise the compatible-provider migration path. ChangesHosted Inference Configuration and Integration
Sequence DiagramsequenceDiagram
participant Workflow as CI Workflow
participant TestSetup as Test Setup
participant HostedInference as requireHostedInferenceConfig
participant MigrationTest as Credential Migration Test
participant Secrets as Environment/Secrets
Workflow->>TestSetup: set NVIDIA_INFERENCE_API_KEY and NEMOCLAW_* env
TestSetup->>HostedInference: call requireHostedInferenceConfig(secrets, env, options)
HostedInference->>Secrets: read required secrets and NEMOCLAW_* env
HostedInference-->>TestSetup: return HostedInferenceConfig
TestSetup->>MigrationTest: stage credential and set child env
MigrationTest->>MigrationTest: run migration and assert results
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
E2E Advisor RecommendationRequired E2E: None Full advisor summaryE2E Recommendation AdvisorFailed: Could not parse JSON from advisor output; see /home/runner/work/NemoClaw/NemoClaw/artifacts/e2e-advisor/e2e-advisor-raw-output.txt |
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: None Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorFailed: Could not parse JSON from advisor output; see /home/runner/work/NemoClaw/NemoClaw/artifacts/e2e-advisor/e2e-scenario-advisor-raw-output.txt |
PR Review AdvisorFindings: 0 needs attention, 1 worth checking, 0 nice ideas Review findings🛠️ Needs attention
🔎 Worth checking
🌱 Nice ideas
Consider writing more tests for
This is an automated advisory review. A human maintainer must make the final merge decision. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/e2e-scenario/fixtures/hosted-inference.ts`:
- Around line 41-44: The apiKey resolution in the apiKey const currently checks
secrets.optional("NVIDIA_INFERENCE_API_KEY") before honoring the configured
nvidiaSecretName, which breaks precedence; change the fallback order so it first
attempts secrets.optional(nvidiaSecretName), then
secrets.optional("NVIDIA_INFERENCE_API_KEY"), and finally
secrets.required(nvidiaSecretName) (i.e., use secrets.optional(nvidiaSecretName)
?? secrets.optional("NVIDIA_INFERENCE_API_KEY") ??
secrets.required(nvidiaSecretName)) so that nvidiaSecretName takes precedence;
update the apiKey assignment that uses secrets.optional and secrets.required
accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 521d0520-e195-4b12-8c4e-f25fe904bd85
📒 Files selected for processing (5)
.github/workflows/e2e-vitest-scenarios.yaml.github/workflows/nightly-e2e.yamltest/e2e-scenario/fixtures/hosted-inference.tstest/e2e-scenario/live/credential-migration.test.tstest/e2e-scenario/support-tests/hosted-inference.test.ts
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/e2e-scenario/support-tests/hosted-inference.test.ts (1)
36-52: 💤 Low valueConsider asserting
NEMOCLAW_COMPAT_MODELin env map.The fixture sets
NEMOCLAW_COMPAT_MODEL: modelat line 51, but this test doesn't verify it. For completeness and to catch regressions if that field is accidentally removed:Suggested addition
expect(cfg.env).toMatchObject({ NEMOCLAW_PROVIDER: "custom", NEMOCLAW_ENDPOINT_URL: "https://inference-api.nvidia.com/v1", NEMOCLAW_MODEL: "nvidia/nvidia/nemotron-3-super-v3", + NEMOCLAW_COMPAT_MODEL: "nvidia/nvidia/nemotron-3-super-v3", COMPATIBLE_API_KEY: "sk-compatible-key", });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/e2e-scenario/support-tests/hosted-inference.test.ts` around lines 36 - 52, Add an assertion that the compatibility model env var is present: inside the "accepts a compatible-provider credential when CI enables the compatibility flag" test (the it block using requireHostedInferenceConfig and cfg), extend the existing env assertions to include NEMOCLAW_COMPAT_MODEL with the expected model value from the test fixture (e.g., add expect(cfg.env).toHaveProperty("NEMOCLAW_COMPAT_MODEL", model) or include "NEMOCLAW_COMPAT_MODEL": <expected-model> in the toMatchObject call) so the test verifies the compat model is set.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@test/e2e-scenario/support-tests/hosted-inference.test.ts`:
- Around line 36-52: Add an assertion that the compatibility model env var is
present: inside the "accepts a compatible-provider credential when CI enables
the compatibility flag" test (the it block using requireHostedInferenceConfig
and cfg), extend the existing env assertions to include NEMOCLAW_COMPAT_MODEL
with the expected model value from the test fixture (e.g., add
expect(cfg.env).toHaveProperty("NEMOCLAW_COMPAT_MODEL", model) or include
"NEMOCLAW_COMPAT_MODEL": <expected-model> in the toMatchObject call) so the test
verifies the compat model is set.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 0ad086aa-be86-43f7-9c47-b1f092b1a84c
📒 Files selected for processing (2)
test/e2e-scenario/fixtures/hosted-inference.tstest/e2e-scenario/support-tests/hosted-inference.test.ts
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Teach the migrated credential-migration Vitest E2E to treat the repository
NVIDIA_INFERENCE_API_KEYsecret as the hosted OpenAI-compatible service credential forhttps://inference-api.nvidia.com/v1. The test now migrates that source secret into the custom provider'sCOMPATIBLE_API_KEYcredential instead of asserting annvapi-/Build NVIDIA provider contract.Changes
NVIDIA_INFERENCE_API_KEYas the source secret and configures the customcompatible-endpointroute.COMPATIBLE_API_KEYand assert thecompatible-endpointgateway provider.COMPATIBLE_API_KEYout of workflow secrets/env.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesnpm run docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
Tests
Chores