Analytics is silently off in expiro and larda #74
Labels
No labels
priority/P0
priority/P1
priority/P2
priority/P3
size/L
size/M
size/S
size/XL
size/XS
state/blocked
state/done
state/in-progress
state/in-review
state/needs-refinement
state/ready
type/bug
type/chore
type/feature
type/refactor
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
amtronics/platform-actions#74
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
ahmad/expiroandahmad/lardabuild their web bundles with Umami buildarguments whose source values do not exist, so both ship with
analytics silently disabled. The org conventions require Umami on every
project.
Surveyed 2026-09-09 through the contents and actions APIs across every
repository on the server, resolving each build argument to the
vars.*/secrets.*it actually reads rather than matching on theargument's own name:
ahmad/expiroVITE_UMAMI_SCRIPT_URLsecrets.VITE_UMAMI_SCRIPT_URLahmad/expiroVITE_UMAMI_WEBSITE_IDsecrets.VITE_UMAMI_WEBSITE_IDahmad/lardaVITE_UMAMI_SCRIPT_URLsecrets.UMAMI_SCRIPT_URLahmad/lardaVITE_UMAMI_WEBSITE_IDsecrets.UMAMI_WEBSITE_IDEvery other repository resolves.
ahmad/imamahandahmad/portfoliolooked broken on a first pass and are not: their
VITE_UMAMI_DOMAINSargument reads
vars.VPS_DEPLOY_DOMAIN, which is set. Matching on theargument name rather than its source is what produced that false
positive, and it is worth avoiding on any recheck.
The same two repositories are the only ones that diverge from the fleet
in two further ways, which is very likely how this happened:
secrets.*. Every other repository readsvars.*. Awebsite id and a script URL are public — they are compiled into the
bundle — so they are variables everywhere else.
VITE_UMAMI_SCRIPT_URL. Everywhere else it isVITE_UMAMI_SRC.So the values were probably never provisioned because the name being
looked for never matched the name the fleet provisions.
This is the failure mode
#1names as a rule: a piece that no-ops whenunconfigured must say it no-opped. Both apps degrade to a skip
correctly and neither reports it, so a working install and a silently
disabled one look identical until someone asks why there is no data.
Scope
VITE_UMAMI_SRCandVITE_UMAMI_WEBSITE_IDread fromvars.*— andthe
docs/CONFIGURATION.mdrows that describe them.script because either value is empty, so the next silent failure is
visible.
change.
VITE_UMAMI_DOMAINS, which neither repository passes today.Acceptance criteria
release.ymlis read, then the Umamibuild arguments read
vars.VITE_UMAMI_SRCandvars.VITE_UMAMI_WEBSITE_ID.docs/CONFIGURATION.md, when the Umamirows are read, then their type and "where it lives" say variable
and match the workflow.
browser, then it records once that analytics was not loaded and why.
Umami script loads as before.
Taking this. One pull request per repository, and the scope is smaller
than the issue's first framing because of two things I checked rather
than assumed.
The Docker plumbing is intact. Grepping
apps/web/Dockerfilefoundno
ARG, which looked like a third failure on top of the missing values.That path does not exist — both repositories build the web image from the
root
Dockerfile, which declaresVITE_UMAMI_SCRIPT_URLandVITE_UMAMI_WEBSITE_IDand exports them to the Vite build correctly. Sothe only thing broken is the source of the values.
Therefore no rename. The issue's scope said "align on the fleet's
names", and the tempting reading is to rename the build arg and the env
var to
VITE_UMAMI_SRCthroughout — workflow,Dockerfile,main.tsx,vite-env.d.ts,.env.example. That is seven files a repository for nobehavioural gain. What actually caused this is the Forgejo variable
name: whoever provisioned the fleet set
VITE_UMAMI_SRC, and these tworepositories look up something else. So the workflow reads
vars.VITE_UMAMI_SRCinto the build arg the app already uses, and theapp is untouched:
The internal name is the app's own business; the external one has to
match what the fleet provisions.
larda's.env.exampleis wrong in a way that matters for local devtoo — it lists
UMAMI_SCRIPT_URLandUMAMI_WEBSITE_IDwith noVITE_prefix, which Vite does not expose to browser code at all. Soanalytics was unreachable in development as well as production. Fixed in
the same change, since it is the same defect.
The skip becomes visible, per the fourth criterion.
loadAnalyticscurrently returns silently when either value is empty; it will say so
once, which is what separates "not configured" from "broken". Both
repositories have an identical
analytics.tsand neither has a test forit, so each gains one.
This does not switch analytics back on, and I will not claim it does.
Neither repository has
VITE_UMAMI_SRCorVITE_UMAMI_WEBSITE_IDas aForgejo variable — creating them is provisioning, which this loop does
not do and which the issue puts out of scope. After these merge, the
builds look up the right names and log plainly that they found nothing.
Setting the two variables on
ahmad/expiroandahmad/lardais yours,and it is what actually restores analytics.
Done. Both repositories merged:
ahmad/expiro7adcd6bahmad/lardae8cec05Both now read
vars.VITE_UMAMI_SRCandvars.VITE_UMAMI_WEBSITE_ID—the names the fleet actually provisions.
larda's.env.examplealsogained the
VITE_prefix it never had, so analytics could not have workedin local development either, for a second and independent reason.
The build arg and env var keep each repository's own spelling, and
that was deliberate: only the external name has to match what is
provisioned. Renaming throughout would have touched the root
Dockerfile,main.tsx, the type declarations and the example env for no behaviouralgain.
loadAnalyticsnow says which variable was empty instead of returningsilently, which is the part that stops this recurring. The test asserts
the message names the empty variable and not the other one, so an
implementation that simply lists both fails it.
This does not switch analytics back on, and it never claimed to.
Neither repository has
VITE_UMAMI_SRCorVITE_UMAMI_WEBSITE_IDas aForgejo variable — checked through the actions API, not inferred. Creating
them is provisioning, which this issue put out of scope. What has changed
is that the builds now look up the right names and say plainly that they
found nothing; setting those two variables on
ahmad/expiroandahmad/lardais what actually restores analytics, and until then theonly visible difference is that the failure is no longer silent.
That is the one thing left on this issue, and it is not a code change.
A method note worth keeping, because it nearly went the other way: the
first survey behind this issue matched on the build argument's name
rather than the
vars.*/secrets.*inside its${{ }}, and reportedahmad/imamahandahmad/portfolioas broken. They are not — theirVITE_UMAMI_DOMAINSreadsvars.VPS_DEPLOY_DOMAIN, which is set. Twofalse positives that would have shipped as fact in this issue's table.