Skip to content

feat(http_extensions): Add extension methods for http::Extensions#356

Open
Everod52 wants to merge 18 commits intomainfrom
u/evrodriguez/extensions-ext
Open

feat(http_extensions): Add extension methods for http::Extensions#356
Everod52 wants to merge 18 commits intomainfrom
u/evrodriguez/extensions-ext

Conversation

@Everod52
Copy link
Copy Markdown

@Everod52 Everod52 commented Apr 1, 2026

No description provided.

@Everod52
Copy link
Copy Markdown
Author

Everod52 commented Apr 1, 2026

@microsoft-github-policy-service agree company="Microsoft"

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (8f34f95) to head (bb1d228).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #356   +/-   ##
=======================================
  Coverage   100.0%   100.0%           
=======================================
  Files         221      222    +1     
  Lines       15995    16001    +6     
=======================================
+ Hits        15995    16001    +6     

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

@geeknoid
Copy link
Copy Markdown
Member

geeknoid commented Apr 6, 2026

@Everod52 Hi there, to fix the static analysis issue, you need to update the readme files so they match the current module docs. You can do this using 'just readmes'.

@Everod52 Everod52 marked this pull request as ready for review April 10, 2026 14:28
Copilot AI review requested due to automatic review settings April 10, 2026 14:28
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

Adds a new extension trait to centralize URL template label extraction on http::Extensions, and wires existing request helpers to use it for consistent behavior across request/extension call sites.

Changes:

  • Introduce ExtensionsExt::url_template_label() for http::Extensions, including unit tests.
  • Refactor RequestExt::url_template_label() to delegate to ExtensionsExt.
  • Update crate docs and README to document/export the new extension trait.

Reviewed changes

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

Show a summary per file
File Description
crates/http_extensions/src/lib.rs Documents and re-exports the new ExtensionsExt trait from the crate root.
crates/http_extensions/src/extensions/request_ext.rs Simplifies request label extraction by delegating to ExtensionsExt.
crates/http_extensions/src/extensions/mod.rs Registers and re-exports the new extensions_ext module/trait.
crates/http_extensions/src/extensions/extensions_ext.rs Adds ExtensionsExt implementation + tests for extracting UrlTemplateLabel from http::Extensions.
crates/http_extensions/README.md Updates the generated README to include ExtensionsExt and refresh link references.

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

Copilot AI review requested due to automatic review settings April 10, 2026 15:13
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 5 out of 5 changed files in this pull request and generated 1 comment.


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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 10, 2026 15:30
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 5 out of 5 changed files in this pull request and generated 1 comment.


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

Comment on lines +57 to +66
#[test]
fn returns_label_from_target_path_and_query() {
let mut extensions = Extensions::new();
extensions.insert(TargetPathAndQuery::from_path_and_query("/path".parse().unwrap()));

assert_eq!(
extensions.url_template_label().as_ref().map(UrlTemplateLabel::as_str),
Some("/path")
);
}
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The test name returns_label_from_target_path_and_query is misleading: TargetPathAndQuery::from_path_and_query(...) appears to produce a plain path where label() is typically None and the code falls back to template(). Consider renaming the test to reflect that it’s validating the template fallback, or construct a TargetPathAndQuery with an explicit label so the test actually exercises the label branch.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

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.

6 participants