Skip to content

Add Gandalf sign-in gate rules and Auxia bypass - #1832

Merged
juabara merged 7 commits into
mainfrom
nz-non-auxia-sign-in-gate
Sep 17, 2026
Merged

juabara merged 7 commits into
mainfrom
nz-non-auxia-sign-in-gate

Conversation

@juabara

@juabara juabara commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Adds the Gandalf sign-in gate journey: a Guardian-managed, 100% rules-based sign-in gate for configured countries (gandalfSignInGateCountries channel switch, initially NZ), with no Auxia involvement.

  • New GandalfFreeView / GandalfMandatoryPopup gate types: 3 free pageviews, then a non-dismissible popup
  • Responses carry gandalfSignInGate marker + optional gandalfPageViewCount; excluded pages/sections/URLs return no marker
  • Auxia is not called for Gandalf traffic (treatments, banner suppression, interaction logging)
  • Non-Gandalf countries keep existing behaviour unchanged
  • Verified: 580 tests, tsc, lint, prettier; local E2E (PV1–PV5, exclusions, GB regression).

Gandalf (the marketing name for the Guardian-managed sign-in gate
journey) is a 100% rollout run entirely by Guardian rules with no Auxia
involvement, active for any country listed in the new
gandalfSignInGateCountries channel switch (currently New Zealand;
adding a country is a configuration change with no deploy). Readers in
listed countries get three free eligible pageviews - tracked by a
per-country client-side counter, since campaigns differ by country
group - then a hardcoded non-dismissible popup treatment. Neither
consent state triggers an Auxia GetTreatments or
LogTreatmentInteraction call, and the RRCP banner suppression checker
short-circuits for listed countries so no banner traffic reaches Auxia
either. An absent or empty country list preserves current behaviour,
which is the rollback path. Eligible surfaces are the Guardian metadata
values Network Front, Section, Tag, Audio, Crossword, Gallery,
Interactive, LiveBlog, ImageContent and Video, minus the unified
legal/customer-service/Filter exclusions.
@juabara
juabara requested a review from a team as a code owner September 9, 2026 11:57
@juabara juabara added the feature Departmental tracking: work on a new feature label Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Comment thread src/server/signin-gate/libPure.ts Outdated
Comment thread src/server/lib/auxia.ts Outdated
Juarez Mota added 4 commits September 15, 2026 12:05
Remove the Gandalf country-based bypass logic that prevented Auxia consultation for readers in gandalfSignInGateCountries. The getBannerSuppressedChecker method no longer accepts countryCode parameter or checks the gandalfSignInGateCountries channel switch. Update gandalfMandatoryPopupUserTreatment to use Gandalf-specific treatment IDs ('gandalf-mandatory-popup') instead of 'default-treatment-id' to distinguish Gandalf popup events in Ophan analysis
gandalfPageViewCount duplicated dailyArticleCount, which the client
already sends on every request. The free-allowance rule now reads the
existing 1-based field: pageviews 1-3 are free, the fourth and later
return the mandatory popup.
The Gandalf sign-in gate now triggers on the third pageview instead of the fourth. Update documentation, tests, and constant to reflect the new free allowance of two pageviews per day. Add Article to the list of eligible content types for Gandalf gate display.
…boolean switch

The Gandalf sign-in gate configuration now uses a single boolean switch (`enableGandalfSignInGate`) instead of a country list (`gandalfSignInGateCountries`). When enabled, the journey applies only to New Zealand readers. Update documentation, tests, and implementation to reflect the simplified on/off toggle. Remove case-insensitive country matching logic and multi-country support.
Comment thread src/server/signin-gate/libPure.ts Outdated
// Union of the global sign-in gate exclusions, The Filter US, and the
// legal/customer-service sections excluded across the reader revenue
// channels.
const invalidSections = [

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.

this can be consolidated with isValidSection

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.

done, thanks

Comment thread src/server/signin-gate/libPure.ts Outdated
};

export const gandalfIsValidTagIds = (tagIds: string[]): boolean => {
const invalidTagIds = ['info/newsletter-sign-up'];

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.

same as existing isValidTagIds

Comment thread src/server/signin-gate/libPure.ts Outdated
export const gandalfArticleIdentifierIsAllowed = (articleIdentifier: string): boolean => {
// Union of the global URL denials and the legal/customer-service page
// exclusions used by the wider reader revenue channels.
const denyPrefixes = [

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.

let's update articleIdentifierIsAllowed to have the same list and reuse that instead

Juarez Mota and others added 2 commits September 17, 2026 11:02
Remove duplicate Gandalf-specific exclusion helpers (gandalfIsValidSection, gandalfIsValidTagIds, gandalfArticleIdentifierIsAllowed) and use the shared isValidSection, isValidTagIds, and articleIdentifierIsAllowed functions instead. Add thefilter-us, privacy, complaints-and-corrections, and the-whole-picture to the global exclusion lists. Update documentation to reflect that Gandalf uses generic display exclusions rather than separate rules.
@juabara
juabara merged commit ab929e4 into main Sep 17, 2026
6 checks passed
@juabara
juabara deleted the nz-non-auxia-sign-in-gate branch September 17, 2026 12:04
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