Skip to content

Inject BackendReplicas and Redis session config into MCPServer RunConfig#4368

Merged
yrobla merged 1 commit intomainfrom
issue-4218
Mar 26, 2026
Merged

Inject BackendReplicas and Redis session config into MCPServer RunConfig#4368
yrobla merged 1 commit intomainfrom
issue-4218

Conversation

@yrobla
Copy link
Copy Markdown
Contributor

@yrobla yrobla commented Mar 25, 2026

Summary

Populates ScalingConfig in the MCPServer RunConfig ConfigMap from spec.backendReplicas and spec.sessionStorage. Adds SessionRedisConfig (address, db, keyPrefix) to runner.ScalingConfig; the Redis password is intentionally excluded and injected as a pod env var instead. Both fields use nil-passthrough so unset specs leave the RunConfig fields absent (HPA/external controllers remain authoritative).

Fixes #4218

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

  • Unit tests (task test)
  • E2E tests (task test-e2e)
  • Linting (task lint-fix)
  • Manual testing (describe below)

Changes

File Change

Does this introduce a user-facing change?

Special notes for reviewers

@yrobla yrobla requested a review from Copilot March 25, 2026 15:49
@github-actions github-actions bot added the size/S Small PR: 100-299 lines changed label Mar 25, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the operator-generated MCPServer RunConfig (stored in a ConfigMap) to include scaling hints and Redis session storage connection parameters needed by the proxy runner, while keeping sensitive Redis credentials out of the ConfigMap.

Changes:

  • Add SessionRedis (address/db/keyPrefix) to runner.ScalingConfig via a new SessionRedisConfig type.
  • Populate runConfig.ScalingConfig.BackendReplicas and runConfig.ScalingConfig.SessionRedis from MCPServer.spec.backendReplicas and MCPServer.spec.sessionStorage when explicitly configured.
  • Add controller-level unit tests covering nil-passthrough behavior and Redis config injection.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
pkg/runner/config.go Extends ScalingConfig with optional Redis session connection settings (SessionRedisConfig).
cmd/thv-operator/controllers/mcpserver_runconfig.go Injects backend replica count + Redis session config into the generated RunConfig via populateScalingConfig.
cmd/thv-operator/controllers/mcpserver_runconfig_test.go Adds tests validating scaling/redis fields are present only when configured.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions github-actions bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Mar 25, 2026
@yrobla yrobla requested a review from Copilot March 25, 2026 15:55
Copy link
Copy Markdown

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

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: 11580bf3c3

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.43%. Comparing base (aa18184) to head (436e49b).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4368      +/-   ##
==========================================
- Coverage   69.48%   69.43%   -0.05%     
==========================================
  Files         485      485              
  Lines       49542    49576      +34     
==========================================
+ Hits        34422    34424       +2     
- Misses      12454    12484      +30     
- Partials     2666     2668       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yrobla yrobla requested a review from Copilot March 25, 2026 16:03
@github-actions github-actions bot added size/M Medium PR: 300-599 lines changed and removed size/S Small PR: 100-299 lines changed labels Mar 25, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jerm-dro
jerm-dro previously approved these changes Mar 25, 2026
@yrobla yrobla force-pushed the feat/thv-0047-crd-type-changes branch 3 times, most recently from 31e22a5 to 6788d84 Compare March 26, 2026 10:12
Base automatically changed from feat/thv-0047-crd-type-changes to main March 26, 2026 10:26
@yrobla yrobla dismissed jerm-dro’s stale review March 26, 2026 10:26

The base branch was changed.

@github-actions github-actions bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels Mar 26, 2026
@yrobla yrobla requested review from Copilot and jerm-dro March 26, 2026 12:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Populates ScalingConfig in the MCPServer RunConfig ConfigMap from
spec.backendReplicas and spec.sessionStorage. Adds SessionRedisConfig
(address, db, keyPrefix) to runner.ScalingConfig; the Redis password
is intentionally excluded and injected as a pod env var instead.
Both fields use nil-passthrough so unset specs leave the RunConfig
fields absent (HPA/external controllers remain authoritative).

Closes: #4218
@github-actions github-actions bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels Mar 26, 2026
@yrobla yrobla merged commit f7ab64a into main Mar 26, 2026
69 of 71 checks passed
@yrobla yrobla deleted the issue-4218 branch March 26, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Medium PR: 300-599 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inject BackendReplicas and Redis session config into MCPServer RunConfig

5 participants