Skip to content

feat(uds): paths#8894

Merged
aaronArinder merged 11 commits intodevfrom
aaron/uds-paths
Mar 12, 2026
Merged

feat(uds): paths#8894
aaronArinder merged 11 commits intodevfrom
aaron/uds-paths

Conversation

@aaronArinder
Copy link
Copy Markdown
Contributor

@aaronArinder aaronArinder commented Feb 17, 2026


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • PR description explains the motivation for the change and relevant context for reviewing
  • PR description links appropriate GitHub/Jira tickets (creating when necessary)
  • Changeset is included for user-facing changes
  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Metrics and logs are added3 and documented
  • Tests added and passing4
    • Unit tests
    • Integration tests
    • Manual tests, as necessary

Exceptions

Note any exceptions here

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. A lot of (if not most) features benefit from built-in observability and debug-level logs. Please read this guidance on metrics best-practices.

  4. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

@aaronArinder aaronArinder requested review from a team as code owners February 17, 2026 21:39
@apollo-librarian
Copy link
Copy Markdown
Contributor

apollo-librarian bot commented Feb 17, 2026

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

0 new, 4 changed, 0 removed
* graphos/routing/(latest)/configuration/yaml.mdx
* graphos/routing/(latest)/customization/coprocessor/index.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/selectors.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/spans.mdx

Build ID: e88179e03589c1cfa39a88e4
Build Logs: View logs

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


⚠️ AI Style Review — 3 Issues Found

Summary

This pull request updates the documentation to align with several style guide sections. Framing changes prioritize direct, reader-centric instructions using the imperative 'Specify' and referring to 'your' custom paths. Voice and tone are enhanced by incorporating encouraging framing and natural contractions like 'isn't' and 'can't'. Text formatting updates ensure code font is used for the 'url' argument and '.sock' file extensions. Structural elements now consistently introduce lists and code blocks with colons, while avoiding negative phrasing. Finally, product-specific guidance was followed by removing articles before standalone product names like 'Router'.

Duration: 2806ms
Review Log: View detailed log

This review is AI-generated. Please use common sense when accepting these suggestions, as they may not always be accurate or appropriate for your specific context.

@aaronArinder aaronArinder marked this pull request as draft February 17, 2026 21:55
@aaronArinder aaronArinder force-pushed the aaron/uds-paths branch 3 times, most recently from f77101a to ed38fd0 Compare February 18, 2026 14:30
@aaronArinder aaronArinder marked this pull request as ready for review February 18, 2026 14:42
Copy link
Copy Markdown
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 comments taking Librarian suggestions as well as keeping similar paragraphs consistent between the pages.

Pre-approving since these changes are non-blocking on docs side!

Comment thread docs/source/routing/configuration/yaml.mdx Outdated
Comment thread docs/source/routing/configuration/yaml.mdx Outdated
Comment thread docs/source/routing/customization/coprocessor/index.mdx Outdated
Comment thread apollo-router/src/services/mod.rs Outdated
pub(crate) const MULTIPART_SUBSCRIPTION_SPEC_VALUE: &str = "1.0";

pub(crate) const DEFAULT_SOCKET_PATH: &str = "/";
pub(crate) const PATH_PREFIX: &str = "path=";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: should this be named PATH_QUERY_PARAM ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

works for me!

pub(crate) const MULTIPART_SUBSCRIPTION_SPEC_PARAMETER: &str = "subscriptionSpec";
pub(crate) const MULTIPART_SUBSCRIPTION_SPEC_VALUE: &str = "1.0";

pub(crate) const DEFAULT_SOCKET_PATH: &str = "/";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this one be #[cfg(unix)] otherwise its dead code on non-unix platforms?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh yeah, good eye

Comment on lines +302 to 307
let converted_uri: http::Uri = if let Some(path) = uri.strip_prefix("unix://") {
let (socket_path, http_path) = parse_unix_socket_url(path);
hyperlocal::Uri::new(&socket_path, &http_path).into()
} else {
uri.parse()?
};
Copy link
Copy Markdown
Contributor

@theJC theJC Feb 18, 2026

Choose a reason for hiding this comment

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

Would it make sense/be better to do the parse_unix_socket_url call once at configuration time and not on the every request hot-path (similar to whats done in plugins/override_url.rs new) ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

maybe but only if it proves to be a problem; I suspect it won't be, but changing the APIs of both the router and supergraph builders will introduce a lot of mess

happy to have @carodewig say otherwise though; details: we'd need to add uri to the router and supergraph builders in the external service, and we'd also need to string through the right uri from the relevant callsites (eg, for router, we'd need to inject it from both the router request and response stages for coprocessors)

Copy link
Copy Markdown
Contributor

@theJC theJC Feb 21, 2026

Choose a reason for hiding this comment

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

I agree with your assessment and maybe its something to consider doing later down the road if deemed necessary or more natural with the rest of the codebase. Im just in the habit of trying by default to shed anything possible from the hot request codepath....


#[cfg(unix)]
#[cfg(test)]
mod unix_socket_url_tests {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 additional tests should be added here:

  • parse_socket_path_with_empty_path_param: ?path
  • parse_socket_path_without_leading_slash: ?path=no_leading_slash

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done! and rstest-ified

Comment thread .changesets/feat_uds_paths.md Outdated
@@ -0,0 +1,6 @@
### Enable Unix Domain Socket paths ([PR #8894](https://github.com/apollographql/router/pull/8894))

Enables Unix Domain Socket (UDS) paths for both coprocessors and subgraphs. The paths _must_ use `?path=` as their delimiter: `unix:///tmp/some.sock?path=some_path`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think ?path= is really the delimiter - isn't it ?? Based on url_path.find('?')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ahh, it is, yeah; I was trying to stress that folks must use ?path= rather than something like ?whatever= because we match on path

I'll think through better wording

Comment thread apollo-router/src/services/mod.rs Outdated
/// Requires:
/// - when using query params, the param must be denoted by `?path=`
#[cfg(unix)]
pub(crate) fn parse_unix_socket_url(url_path: &str) -> (String, String) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nitpick, but is there any reason why this can't return (&str, &str)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

nope! fixing

@theJC
Copy link
Copy Markdown
Contributor

theJC commented Feb 25, 2026

I dont have permission to mark my feedback items as resolved, but please consider them resolved/freel free to close them out.

)]
fn parse_socket_url(
#[case] input: &str,
#[case] expected_socket: &str,
Copy link
Copy Markdown
Contributor

@carodewig carodewig Feb 27, 2026

Choose a reason for hiding this comment

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

Nit: it looks like all the tests have the same expected_socket, so this param could be removed

@theJC
Copy link
Copy Markdown
Contributor

theJC commented Mar 6, 2026

Checking in here. We've upgraded to 2.12.0, and are anxiously awaiting this capability ;)

@aaronArinder
Copy link
Copy Markdown
Contributor Author

aaronArinder commented Mar 6, 2026 via email

@aaronArinder aaronArinder merged commit 7770530 into dev Mar 12, 2026
15 checks passed
@aaronArinder aaronArinder deleted the aaron/uds-paths branch March 12, 2026 14:27
smyrick pushed a commit that referenced this pull request Mar 17, 2026
Co-authored-by: Michelle Mabuyo <michelle@apollographql.com>
smyrick pushed a commit that referenced this pull request Mar 20, 2026
Co-authored-by: Michelle Mabuyo <michelle@apollographql.com>
@abernix abernix mentioned this pull request Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants