Skip to content

Conversation

@AdrienCappelaere
Copy link
Contributor

What does this PR do?

Implements automatic routing for the refresh:geo-brand-presence handler based on per-site Configuration enablement.

Changes

  • Adds Configuration check to detect if geo-brand-presence-daily is enabled for a site
  • Implements 4-level priority for cadence determination
  • Routes to refresh:geo-brand-presence-daily or refresh:geo-brand-presence accordingly
  • Maintains backward compatibility with existing site configs

How it works

The handler now checks (in order):

  1. Explicit context override (for wrappers/testing)
  2. Configuration.isHandlerEnabledForSite('geo-brand-presence-daily', site) ← NEW
  3. site.getConfig().getBrandPresenceCadence() (backward compatibility)
  4. Default to 'weekly'

Testing

  • Linting passed
  • Manual testing with daily-enabled site
  • Manual testing with weekly-only site
  • Log verification

Related

Follows pattern from llmo-customer-analysis (line 151) and cdn-analysis handlers.

- Add per-site Configuration check for geo-brand-presence-daily enablement
- Implement 4-level priority for cadence determination:
  1. Explicit context override (for testing/wrappers)
  2. Per-site Configuration check (NEW)
  3. Site-specific config (backward compatibility)
  4. Default to weekly
- Route to refresh:geo-brand-presence-daily or refresh:geo-brand-presence accordingly
- Enhance logging to show Configuration status and determined cadence
- Add comprehensive JSDoc documentation

This allows automatic routing based on which audit is enabled for the site,
matching patterns used in llmo-customer-analysis and cdn-analysis handlers.
Copy link
Member

@davidaurelio davidaurelio left a comment

Choose a reason for hiding this comment

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

lgtm

- Add automatic cadence detection based on entitlements and config
- Support both daily and weekly routing from single handler
- Update tests with proper Configuration and TierClient mocks
- Add cadence field to audit results for tracking

Priority for cadence determination:
1. Explicit context.brandPresenceCadence override
2. Per-site Configuration check (isAuditEnabledForSite)
3. Site config (getBrandPresenceCadence)
4. Default to weekly
@github-actions
Copy link

This PR will trigger a minor release when merged.

The 200-prompt hard limit was removed in main branch (commit 5ee15d7).
Updated tests to expect all prompts to be included without limit.

Changes:
- Update 'should prioritize customer prompts' test to expect 225 prompts (was 200)
- Update 'should use only customer prompts' test to expect 300 prompts (was 200)
- Remove 'EXCLUDE_FROM_HARD_LIMIT' test as that logic no longer exists
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