Skip to content

Enhance content matching logic to support path-only patterns - #8

Merged
ranael-garem merged 2 commits into
mainfrom
fix-content-url
Apr 1, 2026
Merged

Enhance content matching logic to support path-only patterns #8
ranael-garem merged 2 commits into
mainfrom
fix-content-url

Conversation

@ranael-garem

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

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.

Pull request overview

This PR enhances the customer-side license.xml content block matching so that url_pattern values starting with / are treated as host-agnostic “path-only” patterns, and adds tests to validate the new matching behavior.

Changes:

  • Extend _find_best_matching_content to support path-only URL patterns (skip host matching, match by path scoring).
  • Add unit tests covering path-only matching, specificity ordering, and mixing full-URL with path-only patterns.

Reviewed changes

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

File Description
connect/customer/content_matcher.py Adds path-only pattern handling and uses path scoring for best-match selection.
tests/customer/test_content_matcher.py Adds tests to validate new path-only pattern matching behavior and precedence.

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

Comment thread connect/customer/content_matcher.py Outdated
Comment thread tests/customer/test_content_matcher.py

@nick434434 nick434434 left a comment

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.

👏 🚀

@ranael-garem
ranael-garem merged commit 22bcdca into main Apr 1, 2026
1 check passed
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.

3 participants