Skip to content

Address review feedback for MCP backend session affinity#4116

Merged
JAORMX merged 1 commit intomainfrom
fix/mcp-backend-session-affinity-followup
Mar 12, 2026
Merged

Address review feedback for MCP backend session affinity#4116
JAORMX merged 1 commit intomainfrom
fix/mcp-backend-session-affinity-followup

Conversation

@JAORMX
Copy link
Collaborator

@JAORMX JAORMX commented Mar 12, 2026

Summary

Follow-up to #3992, addressing review feedback from @yrobla and code review findings:

  • Extract ensureBackendServices from DeployWorkload to reduce cyclomatic complexity and drop //nolint:gocyclo
  • Add debug-level logging to deleteIfExists so finalization is observable for troubleshooting
  • Downgrade slog.Info("applied statefulset") to slog.Debug per logging guidelines (silent success)
  • Remove stale //nolint:gosec comment
  • Fix test conventions: context.Background()t.Context(), inline func() *int32ptr.To(int32(1))

Test plan

  • task lint-fix passes (0 issues)
  • task test passes (unit tests for changed packages)
  • No behavioral changes, only code quality improvements

🤖 Generated with Claude Code

- Extract ensureBackendServices from DeployWorkload to reduce cyclomatic
  complexity and remove the nolint:gocyclo directive
- Downgrade slog.Info to slog.Debug for statefulset apply (silent success)
- Remove stale nolint:gosec comment on statefulset log line
- Add debug-level logging to deleteIfExists for finalization visibility
- Fix test conventions: context.Background() to t.Context(), inline
  func to ptr.To, add ptr import

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Mar 12, 2026
@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 65.21739% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.79%. Comparing base (cf8b6fa) to head (77500ae).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/container/kubernetes/client.go 71.42% 3 Missing and 3 partials ⚠️
...d/thv-operator/controllers/mcpserver_controller.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4116      +/-   ##
==========================================
- Coverage   68.84%   68.79%   -0.06%     
==========================================
  Files         458      458              
  Lines       46274    46280       +6     
==========================================
- Hits        31859    31839      -20     
- Misses      11953    11979      +26     
  Partials     2462     2462              

☔ 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.

@JAORMX JAORMX merged commit d91bff2 into main Mar 12, 2026
70 of 71 checks passed
@JAORMX JAORMX deleted the fix/mcp-backend-session-affinity-followup branch March 12, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants