Skip to content

exclusions support for header, banner, epic and gutter components#1627

Merged
AnastasiiaBalenko merged 10 commits intomainfrom
ab/exclusions-filter-epic-banner-header-gutterask
Apr 14, 2026
Merged

exclusions support for header, banner, epic and gutter components#1627
AnastasiiaBalenko merged 10 commits intomainfrom
ab/exclusions-filter-epic-banner-header-gutterask

Conversation

@AnastasiiaBalenko
Copy link
Copy Markdown
Contributor

@AnastasiiaBalenko AnastasiiaBalenko commented Apr 9, 2026

Ticket link

What does this change?

This PR replaces hardcoded banner section/date suppression with a shared, config-driven exclusions system, and applies the same exclusions behaviour across Banner, Epic, Header, and Gutter Ask.
Main changes:

  • Added a new exclusions config loader from S3 with typed rule support:
    • sectionIds
    • tagIds
    • dateRange
    • contentTypes (Fronts or Articles)
  • Added a shared matcher that evaluates exclusions consistently across channels.
  • Updated routers so all channels check exclusions before selecting tests/rendering:
  • Wired exclusions reloader into server startup and passed it into all relevant routers.
  • Removed hardcoded banner-only section suppression logic and tests.
  • Added missing sectionId and tagIds fields on Header targeting to align with matcher capabilities.

Behaviour notes
If no exclusions exist for a channel, behavior is unchanged.
Matching is case-insensitive for section and tag IDs.
Empty contentTypes and contentTypes containing both Fronts and Articles matches either type.

How has this change been tested?

  • Added focused unit tests for the matcher covering: no rules, section matching, tag matching, date range matching, content type matching with isFront flag
  • deployed to CODE env and checked that epic, banner, header, gutter ask are shown up as expected.

How can we measure success?

Have we considered potential risks?

Images

Accessibility

@AnastasiiaBalenko AnastasiiaBalenko added the feature Departmental tracking: work on a new feature label Apr 9, 2026
@AnastasiiaBalenko AnastasiiaBalenko marked this pull request as ready for review April 9, 2026 14:00
@AnastasiiaBalenko AnastasiiaBalenko requested a review from a team as a code owner April 9, 2026 14:00
};

export const inExclusions = <T extends ExclusionChannel>(
targeting: TargetingByChannel[T],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm wondering if this file would be simpler (in particular the types) if we defined the targeting type here as e.g.

interface Targeting {
    tagIds?: string[];
    sectionId?: string;
    contentType?: string;
}

I think only epicRouter.ts would need to change how it calls inExclusions.
What do you think?

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.

Yes, thanks, it really makes the function simpler! Updated

@AnastasiiaBalenko AnastasiiaBalenko merged commit 901a55f into main Apr 14, 2026
6 checks passed
@AnastasiiaBalenko AnastasiiaBalenko deleted the ab/exclusions-filter-epic-banner-header-gutterask branch April 14, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants