SACGF / SACGF/variantgrid

Host our own copies of CDN files

Open
#1,741 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
30
Forks
3
Avg merge
9h 22m
Merged PRs (30d)
40

Description

base_external.html loads a deleted Rollbar static file - 500s pages extending it

🤖 Written by Claude

## Problem

`uicore/templates/uicore/page/base_external.html` loads Rollbar via:

```
{% static 'js/lib/rollbar/v2.21.1/rollbar.min.js' %}
```

That file no longer exists in source. `rollbar` is absent from `variantgrid/static_files/default_static/js/lib/` in both git and on disk — the only surviving copies are stale artifacts in the gitignored `sitestatic/` collectstatic output on machines that have not re-run collectstatic.

Because `STATICFILES_STORAGE` is `ManifestStaticFilesStorage` and `collectstatic` rewrites `staticfiles.json` from scratch on every run, once a deployment runs collectstatic the entry is gone and `{% static %}` raises `ValueError: Missing staticfiles manifest entry` at template render time. That is a 500 on the page, not merely a missing script tag.

Four templates extend `base_external.html`:

- `snpdb/templates/snpdb/uptime_check.html`
- `classification/templates/classification/evidence_keys.html`
- `mme/templates/mme/mme_metrics.html`
- `mme/templates/mme/mme_disclaimers.html`

`uptime_check` is the one to look at first.

## How it happened

Two commits:

- `68f219e6f` — *"#539 - locally host bootstrap and rollbar"* — moved both `base.html` and `base_external.html` off the CDN onto a vendored copy at `variantgrid/static_files/default_static/js/lib/rollbar/v2.21.1/rollbar.min.js`.
- `f42e1ccc3` — *"Update to Rollbar 3.1.0"* (2026-04-10) — pointed `base.html` back at the CDN at v3.1.0 and deleted the vendored file, while `base_external.html` kept referencing it:

```
uicore/templates/uicore/page/base.html | 2 +-
.../default_static/js/lib/rollbar/rollbar.min.js.map | 1 -
.../default_static/js/lib/rollbar/v2.21.1/rollbar.min.js | 1 -
```

Current state on master:

| template | loads Rollbar from |
|---|---|
| `uicore/page/base.html` | CDN v3.1.0 |
| `uicore/page/base_external.html` | `{% static %}` v2.21.1 (file deleted) |

For reference, the `vg3_sapath_prod` branch is unaffected — it predates both commits and loads CDN v2.21.1 uniformly across all of its config sites.

## Why the test suite does not catch it

`URLTestCase` overrides the storage back to plain `StaticFilesStorage` (`library/django_utils/unittest_utils.py:125`), with a docstring stating that this is precisely because `ManifestStaticFilesStorage` expects `staticfiles.json` to exist and contain the requested file. So URL tests over these pages pass regardless of whether the manifest entry exists.

## Fix

The direction is a decision, since #539 deliberately moved these to local hosting and `f42e1ccc3` moved `base.html` back to the CDN without that being the stated intent:

1. **Match `base.html`** — point `base_external.html` at CDN v3.1.0. One line, and both templates end up consistent.
2. **Restore local hosting** — re-add the vendored file and point both templates at `{% static %}`, which is what #539 was after. Keeps Rollbar working where outbound CDN access is restricted.

Whichever is chosen, both templates should agree.

## Verification

Confirm on a deployment that has run collectstatic since 2026-04-10 whether the four pages above currently return 500. That determines whether this is live breakage or still latent.

Related: #1740 (filtering browser-extension noise out of Rollbar) touches the same `_rollbarConfig` blocks.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with uicore/templates/uicore/page/base_external.html and compare its Rollbar reference with uicore/templates/uicore/page/base.html. Inspect the four extending templates, especially snpdb/templates/snpdb/uptime_check.html, and review the static storage behavior described in library/django_utils/unittest_utils.py. Done means both base templates use an available, consistent Rollbar source and the affected pages no longer fail after collectstatic.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
backend, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.