Skip to content

feat(suggestions): filter suggestions by excludedPathPrefixes handler config (LLMO-6132)#2828

Open
dhavkuma wants to merge 1 commit into
mainfrom
feat/LLMO-6132-exclude-subpath-suggestions-from-api
Open

feat(suggestions): filter suggestions by excludedPathPrefixes handler config (LLMO-6132)#2828
dhavkuma wants to merge 1 commit into
mainfrom
feat/LLMO-6132-exclude-subpath-suggestions-from-api

Conversation

@dhavkuma

Copy link
Copy Markdown
Contributor

Summary

  • Adds filterByExcludedPaths(suggestions, opportunity, siteConfig) helper in src/controllers/suggestions.js
  • Applied after filterByGrantStatus in all 4 suggestion read variants: getAllForOpportunity, getAllForOpportunityPaged, getByStatus, getByStatusPaged
  • Uses existing getSuggestionUrl helper to extract URL across all opportunity types
  • Reads excludedPathPrefixes from siteConfig.getHandlerConfig(opportunity.getType())

Hides suggestions for subpath-sibling URLs (e.g. /jp/ja/... for PwC Japan) from API responses — including suggestions already stored in the DB before the audit-worker fix ships.

Depends on: adobe/spacecat-shared#1817
Jira: LLMO-6132

Test plan

  • 14727 unit tests pass (7 pre-existing failures unrelated to this change)
  • Filter removes suggestions matching excluded path prefixes in all 4 variants
  • Suggestions with no URL / invalid URL → kept
  • Null siteConfig / empty prefixes → passthrough

🤖 Generated with Claude Code

… config

Hide suggestions whose URL matches excluded path prefixes defined in
the site handler config. Applied after grant-status filter in all 4
suggestion read variants. Fixes subpath-sibling URL leak (LLMO-6132).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

This PR will trigger a minor release when merged.

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.

1 participant