Skip to content

refactor: clean up SSE transport variant#643

Merged
DaleSeo merged 3 commits intomainfrom
clean-up-sse
Feb 18, 2026
Merged

refactor: clean up SSE transport variant#643
DaleSeo merged 3 commits intomainfrom
clean-up-sse

Conversation

@DaleSeo
Copy link
Member

@DaleSeo DaleSeo commented Feb 13, 2026

The SSE transport support was removed in v1.5.0, but the enum variant, error path, match arms, and dedicated test were still hanging around and complicating the transport logic. This PR removes Transport::SSE entirely and cleans up the related code.

@DaleSeo DaleSeo self-assigned this Feb 13, 2026
@apollo-librarian
Copy link

apollo-librarian bot commented Feb 13, 2026

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

0 new, 1 changed, 0 removed
* (developer-tools)/apollo-mcp-server/(latest)/config-file.mdx

Build ID: 2b77fd6116071d4543676779
Build Logs: View logs

URL: https://www.apollographql.com/docs/deploy-preview/2b77fd6116071d4543676779

@DaleSeo DaleSeo added the skip-changeset Used when the changeset verification can be skipped label Feb 13, 2026
@DaleSeo DaleSeo marked this pull request as ready for review February 13, 2026 21:35
@DaleSeo DaleSeo requested review from a team as code owners February 13, 2026 21:35
@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

⏭️ Changeset check skipped via label

@claude
Copy link

claude bot commented Feb 13, 2026

Review Summary

Clean refactoring that fully removes the deprecated SSE transport variant and associated infrastructure. The changes are thorough and include proper test coverage to prevent SSE from being used.

Findings

[Consider] The boxing of auth::Config in Transport::StreamableHttp (changing from Optionauth::Config to Option<Boxauth::Config>) appears to be an optimization to reduce the enum's memory footprint. While this is generally good practice per Chapter 2.3 (clippy's large_enum_variant lint), it's worth confirming this was intentional and not an accidental change, as it wasn't mentioned in the PR description.

Test Coverage Assessment

Good test coverage:

  • New test sse_transport_is_rejected_at_parse_time validates SSE is rejected during YAML parsing
  • Tests for stdio and streamable_http transports confirm they parse correctly
  • Removed test start_sse_server_returns_unsupported_error is no longer needed since SSE fails at parse time

Following Chapter 5 best practices, the test names are descriptive and focused on single behaviors.

Final Recommendation

Approve with suggestions - The code is solid and ready to merge. The auth boxing change is worth confirming as intentional.


Reviewed by Claude Code Sonnet 4.5

/// Authentication configuration
#[serde(default)]
auth: Option<auth::Config>,
auth: Option<Box<auth::Config>>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just want to double check the intent behind this Box. :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Without it, you will run into this linting issue:

error: large size difference between variants
  --> crates/apollo-mcp-server/src/server.rs:59:1
   |
59 | /  pub enum Transport {
60 | |      /// Use standard IO for server <> client communication
61 | |      #[default]
62 | |      Stdio,
   | |      ----- the second-largest variant carries no data at all
...  |
65 | |/     StreamableHttp {
66 | ||         /// Authentication configuration
67 | ||         #[serde(default)]
68 | ||         auth: Option<auth::Config>,
...  ||
84 | ||         host_validation: HostValidationConfig,
85 | ||     },
   | ||_____- the largest variant contains at least 356 bytes
86 | |  }
   | |__^ the entire enum is at least 360 bytes
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#large_enum_variant
   = note: `-D clippy::large-enum-variant` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::large_enum_variant)]`
help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum
   |
68 -         auth: Option<auth::Config>,
68 +         auth: Box<Option<auth::Config>>,
   |

error: could not compile `apollo-mcp-server` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `apollo-mcp-server` (lib test) due to 1 previous error

@claude
Copy link

claude bot commented Feb 18, 2026

Review Summary

This is a clean refactoring that successfully removes all SSE transport remnants from the codebase. The approach of rejecting SSE at parse time (via serde deserialization) rather than at runtime is a better design.

Findings

No new issues found. The previous review correctly identified the auth boxing change, which follows clippy's large_enum_variant lint guidance (Chapter 2.3).

Test Coverage Assessment

Excellent test coverage:

  • Parse-time validation for all transport types with descriptive test names following Chapter 5.1 best practices
  • Proper removal of the obsolete start_sse_server_returns_unsupported_error test

Final Recommendation

Approve - The refactoring is well-executed and improves code clarity by removing dead code paths.


Reviewed by Claude Code Sonnet 4.5

Copy link
Contributor

@mabuyo mabuyo left a comment

Choose a reason for hiding this comment

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

Minor coment on docs addition


<Note>

SSE transport is no longer supported by Apollo MCP Server. Use `streamable_http` for HTTP-based connections.
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be helpful to add a version number here if there's a large chance folks are still using older versions! "no longer supported by Apollo MCP Server as of vx.x.x"

@claude
Copy link

claude bot commented Feb 18, 2026

Review Summary

This refactoring successfully removes all SSE transport code following its deprecation in v1.5.0. The latest commit adds appropriate version context to the deprecation notice in documentation.

Findings

No new issues found beyond what was previously identified in earlier reviews regarding the auth Config boxing optimization.

Test Coverage Assessment

Test coverage is excellent - the new tests ensure SSE is rejected at parse time, and the removal of the obsolete start_sse_server_returns_unsupported_error test is appropriate since SSE now fails during deserialization rather than at runtime.

Final Recommendation

Approve - The refactoring is well-executed, removes dead code paths cleanly, and improves maintainability. The auth boxing change follows Rust best practices per Chapter 2.3 (large_enum_variant lint).


Reviewed by Claude Code Sonnet 4.5

@DaleSeo DaleSeo merged commit 477d0e4 into main Feb 18, 2026
16 of 17 checks passed
@DaleSeo DaleSeo deleted the clean-up-sse branch February 18, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-ai-review skip-changeset Used when the changeset verification can be skipped

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants