Skip to content

test(docker): guard entrypoint build fingerprint against vite envPrefix drift - #213

Open
WAHIB-EL-KHADIRI wants to merge 1 commit into
every-app:mainfrom
WAHIB-EL-KHADIRI:test/docker-entrypoint-env-sync
Open

test(docker): guard entrypoint build fingerprint against vite envPrefix drift#213
WAHIB-EL-KHADIRI wants to merge 1 commit into
every-app:mainfrom
WAHIB-EL-KHADIRI:test/docker-entrypoint-env-sync

Conversation

@WAHIB-EL-KHADIRI

Copy link
Copy Markdown

What

Adds a fast unit test (src/shared/docker-entrypoint-env-sync.test.ts) asserting that the env allow-list used by docker-entrypoint.sh to fingerprint the client build stays in sync with vite.config.ts's envPrefix — plus the build-only extras (POSTHOG_SOURCEMAPS).

Why

docker-entrypoint.sh skips the client build when the build-relevant envs are unchanged:

FINGERPRINT="$(env | grep -E '^(VITE_|AUTH_MODE|BYPASS_EMAIL_VERIFICATION|POSTHOG_PUBLIC_KEY|POSTHOG_HOST|TURNSTILE_SITE_KEY|POSTHOG_SOURCEMAPS)' | sort | sha256sum ...)"

That list must mirror vite.config.ts envPrefix (the prefixes Vite inlines into the client bundle). Today the coupling is enforced only by a "keep in sync" comment. If a new envPrefix entry is added without updating the entrypoint, a self-host container could silently reuse a stale build after a build-relevant env changed. This test makes that drift a loud CI failure instead.

Notes

  • Pure config-integrity test: reads both files, compares the two sets. No runtime/build deps.
  • Verified locally: pnpm exec vitest run src/shared/docker-entrypoint-env-sync.test.ts → 1 passed.

🤖 Generated with Claude Code

docker-entrypoint.sh skips the client build when build-relevant envs are
unchanged, fingerprinting them via a grep allow-list that must stay in sync
with vite.config.ts's envPrefix (plus POSTHOG_SOURCEMAPS). The "keep in sync"
coupling was comment-only; this adds a fast unit test that fails loudly if the
two lists drift, preventing a silently stale build reuse after an env change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bensenescu

Copy link
Copy Markdown
Contributor

Hey,

Thanks for contributing!

For the next few months, I'm going to stop accepting external PRs.

Reviewing and testing them has been slowing down progress against our roadmap:
https://openseo.so/roadmap

Contributing through Issues
Right now, the best way to contribute is through creating quality "Issues" which are easier for me to review and prioritize right now.

Here is our updated contributing guide: https://github.com/every-app/open-seo/blob/main/docs/CONTRIBUTING.md

Converting, this PR to an issue would be the best way to get it prioritized.

You can use the the /simple-issue-description skill described in the guide to convert the PR to an issue.

oluwaseunmauwedo pushed a commit to oluwaseunmauwedo/open-seo that referenced this pull request Aug 25, 2026
ramonmnavarro-byte pushed a commit to ramonmnavarro-byte/open-seo that referenced this pull request Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants