Skip to content

docs: align ALLURE_NO_ANALYTICS opt-out example with implementation#3333

Merged
baev merged 2 commits into
allure-framework:mainfrom
grootstebozewolf:fix/analytics-opt-out-env-var-semantics
May 11, 2026
Merged

docs: align ALLURE_NO_ANALYTICS opt-out example with implementation#3333
baev merged 2 commits into
allure-framework:mainfrom
grootstebozewolf:fix/analytics-opt-out-env-var-semantics

Conversation

@grootstebozewolf
Copy link
Copy Markdown
Contributor

@grootstebozewolf grootstebozewolf commented May 10, 2026

Context

Analytics.md documents the opt-out as:

export ALLURE_NO_ANALYTICS=1

The two halves of the analytics path use different semantics on this variable:

  • GaPlugin (server-side): any non-null value disables → =1 works.
  • ReportWebGenerator (HTML side): parses through Boolean.parseBoolean, which only treats "true" (case-insensitive) as a disable signal → =1 is ignored, and gtag.js still loads from googletagmanager.com in the rendered report.

So the documented opt-out only half-works. The implementation already honours =true end-to-end — covered by the existing ReportWebGeneratorTest#shouldDisableAnalytics, which was further tightened (and the template's stray inline gtag('config', …) block was moved inside the analyticsDisable guard) in #3332.

The cheapest fix is to update the documentation to recommend the value the implementation honours. Net diff: one line in Analytics.md.

Checklist

  • Sign Allure CLA
  • Provide unit tests (no new tests; existing shouldDisableAnalytics already exercises the =true path)

@baev
Copy link
Copy Markdown
Member

baev commented May 11, 2026

update Analytics.md instead

Both opt-out paths (GaPlugin server-side and the HTML template via
ReportWebGenerator) treat ALLURE_NO_ANALYTICS through
Boolean.parseBoolean / "any non-null value disables" semantics. In
practice the only value that reliably disables analytics on both sides
is "true".

The previously documented example "export ALLURE_NO_ANALYTICS=1" does
not disable HTML-side analytics, leaving gtag.js loading from
googletagmanager.com in the rendered report. Update Analytics.md to
recommend "true" so the documented opt-out actually works end-to-end.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@grootstebozewolf grootstebozewolf force-pushed the fix/analytics-opt-out-env-var-semantics branch from b2c07b8 to 2f36d89 Compare May 11, 2026 14:09
@grootstebozewolf grootstebozewolf changed the title Fix incomplete ALLURE_NO_ANALYTICS opt-out: HTML side ignores documented value docs: align ALLURE_NO_ANALYTICS opt-out example with implementation May 11, 2026
@baev baev added the type:documentation Improvements or additions to documentation label May 11, 2026
@baev baev merged commit 03b4ee9 into allure-framework:main May 11, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants