fix(build): add the missing env generation script - #104
Merged
Conversation
Netlify's build command, set in the UI, is `node scripts/generate-env.cjs`, but that file was never committed: 90fe322 moved the Supabase credentials out of the repo into an untracked 2026/js/env.js without adding the script that generates it. Every deploy has failed with MODULE_NOT_FOUND since, so production is frozen at the #98 merge and still serves the outdated code of conduct with the wrong reporting address. The script writes 2026/js/env.js from PYCON_SUPABASE_URL and SUPABASE_PUBLISHABLE_KEY, the variables Netlify already exposes. Missing credentials warn loudly but exit 0: the registration forms break, while the rest of the site — including the code of conduct and its reporting channel — still gets published. The command also moves into netlify.toml, which takes precedence over the UI setting, so it stays versioned next to the script it invokes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
✅ Deploy Preview for pycon ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
El problema
El build command de Netlify —configurado en la UI del proyecto, no en el repo— es
node scripts/generate-env.cjs, y ese archivo nunca se commiteó.90fe322sacó las credenciales de Supabase hacia un2026/js/env.jsignorado por git, pero no añadió el script que lo genera.Resultado: todos los deploys fallan desde entonces, en 7 segundos.
Producción quedó congelada en el merge de #98. Comprobado contra el sitio en vivo:
mainagenda.htmlc800b60)index.htmlfaq.htmlLo grave es la consecuencia:
pycon.pa/2026/codigo_conducta.htmlsigue publicandopyconpanama@gmail.comcomo canal de reporte de incidentes, aunquemaintiene la dirección correcta desde el mergee743599. Ese es el riesgo R9 del registro interno, materializado y en vivo. Un reporte enviado hoy a esa dirección no llega a nadie.El cambio
scripts/generate-env.cjs(nuevo) — genera2026/js/env.jsa partir dePYCON_SUPABASE_URLySUPABASE_PUBLISHABLE_KEY, las variables que Netlify ya tiene configuradas. Acepta alias (SUPABASE_URL,SUPABASE_ANON_KEY) para no romper otros entornos.netlify.toml— el comando pasa al archivo, que tiene precedencia sobre la UI. Así queda versionado junto al script que invoca, y no vuelve a existir un comando invisible apuntando a un archivo inexistente.Decisión que conviene revisar: si faltan las credenciales, el script avisa fuerte en el log pero sale con
0. Los formularios de registro quedarían rotos, pero el resto del sitio —incluido el Código de Conducta y su canal de reporte— se publica igual. El criterio es que una credencial ausente no vuelva a tumbar la publicación entera. Si se prefiere que falle duro, es una línea.Verificación
Probado en local por los dos caminos (con y sin variables de entorno). El mismo commit, aplicado en #103, produjo un deploy preview correcto:
env.jsgenerado con la URL real de Supabase y todos los checks de Netlify en verde.Por qué va aparte
Sale de #103, que trae el texto completo del Código de Conducta. Ese PR necesita revisión de contenido con calma; este arregla algo que está roto ahora y desbloquea el despliegue de la corrección del correo. Una vez que este entre, #103 se queda solo con el contenido.
🤖 Generated with Claude Code