• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ThePalaceProject / web-patron / 25445038757
88%

Build:
DEFAULT BRANCH: main
Ran 06 May 2026 03:34PM UTC
Jobs 1
Files 14
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 May 2026 03:32PM UTC coverage: 89.354% (+0.2%) from 89.184%
25445038757

push

github

web-flow
Move Bugsnag / GTM configuration to environment variables (PP-4266) (#132)

## Description

Moves `bugsnag_api_key` and `gtm_id` out of the YAML config file and
into environment variables (`BUGSNAG_API_KEY` and `GTM_ID`). The YAML
keys are still accepted but emit a deprecation warning and are ignored;
their values are never used.

As part of this change, Google Tag Manager (GTM) injection moves from
`_app.tsx` (where it previousely read `gtmId` from the app config object
passed via `pageProps`) to `_document.tsx` (where `process.env.GTM_ID`
is read directly, server-side). The new setup uses the correct
placements per GTM's own recommendations — the script tag belongs in
`<head>` and the `<noscript>` fallback belongs as the first element in
`<body>`.

Additional hardening:
- `GTMScript` and `GTMNoscript` now validate the GTM container ID format
(`GTM-[A-Z0-9]+`). A truthy but malformed value causes `GTMScript` to
log a `console.error` and render nothing, rather than silently injecting
a broken or potentially unsafe script.
- The Bugsnag deprecation warning includes a note when `BUGSNAG_API_KEY`
is also absent, so operators know Bugsnag will not be configured (not
just that the YAML value is ignored).
- The `GTMScript` component no longer wraps its output in `next/head`,
which is unsupported inside `_document.tsx`.

## Motivation and Context

- Keeping the Bugsnag API key and GTM ID in the YAML config file meant
they could not be delivered before the first request. For the Bugsnag
API key, this meant that reporting could not be available for functions
that occurred before the first request.
- For GTM config, delayed availability meant that we could not locate
the GTM-related elements in the recommended locations in the DOM.

[Jira PP-4266]

## How Has This Been Tested?

- Manual testing in my development environment.
- New and updated unit tests cover all changed behavior.
- All checks pass locally.
- CI checks pass.


## Checklist:

- [x] I have update... (continued)

200 of 224 branches covered (89.29%)

Branch coverage included in aggregate %.

5 of 5 new or added lines in 1 file covered. (100.0%)

312 of 349 relevant lines covered (89.4%)

31.79 hits per line

Jobs
ID Job ID Ran Files Coverage
1 25445038757.1 06 May 2026 03:34PM UTC 14
89.35
GitHub Action Run
Source Files on build 25445038757
  • Tree
  • List 14
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 4b3a5a6d on github
  • Prev Build on main (#25221023683)
  • Next Build on main (#25675471151)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc