chore(husky): faire du contrôle de compte une règle appliquée par la machine#267
Merged
Conversation
… one I remember The preflight script existed but nothing ran it. That is not a guardrail, it is an intention: it depended on someone remembering, and the whole point is that the failure it guards against is silent. pre-push runs the full check. `git push` authenticates through `gh auth git-credential`, so it pushes as the ACTIVE gh account — and both accounts sit in the keyring at once. Demonstrated rather than assumed: switching the account makes `git credential fill` return username=ovb-willemot. A push also triggers a deploy, which is why Supabase and Vercel are verified there too. pre-commit runs a new `--local` mode: same checks minus the single network call, so it costs nothing on every commit. It catches a git identity pointing at the professional project BEFORE mis-attributed commits exist — discovering that at push time means rewriting history. No offline false positive: `gh api user` and `git push` both need the network, so when one is unavailable the push was failing anyway. Git hooks cannot cover `supabase db push`, `vercel deploy`, or a writing `gh` command — those are not git operations. CLAUDE.md now carries them as an explicit manual step, so the gap is stated rather than assumed covered. Verified it blocks rather than merely warns: pointing the expected remote at the professional repo made the commit fail, and no commit object was created.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
🧙 Sourcery examine votre pull request ! Conseils et commandesInteragir avec Sourcery
Personnaliser votre expérienceAccédez à votre dashboard pour :
Obtenir de l’aide
Original review guide in English🧙 Sourcery is reviewing your pull request! Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Both branches added scripts/preflight-accounts.mjs, so git saw an add/add conflict. This branch's copy is the superset: it carries #266's fixes plus the --local mode the pre-commit hook depends on, so it is the one kept. Verified both entry points still work after the resolution: full run gives GO, and `--local` gives GO while skipping the single network call.
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.
PR dédiée, conformément à la doctrine :
.husky/est l'infrastructure de garde-fous, elle ne se modifie pas dans une PR feature.Le problème
Le script preflight existait (#266) mais rien ne le lançait. Ce n'est pas un garde-fou, c'est une intention : il reposait sur le fait que quelqu'un y pense — alors que la panne dont il protège est précisément silencieuse.
Ce que ça met en place
--local: mêmes contrôles sans réseauPourquoi séparer.
git pushs'authentifie viagh auth git-credential: il pousse sous le compteghactif, et les deux comptes cohabitent dans le keyring. Un push déclenche aussi un déploiement, d'où la vérification de Supabase et Vercel à ce moment-là.Le
pre-commitattrape une identité git pointant vers le projet pro avant que des commits mal attribués existent — s'en apercevoir au push obligerait à réécrire l'historique.Démontré, pas supposé
username=ovb-willemotàgit credential fill→ la panne est réelle et le hook est sur son cheminPas de faux positif hors ligne
gh api useretgit pushont tous les deux besoin du réseau. Sans réseau, le push échouait de toute façon.Le trou, énoncé plutôt que supposé couvert
Les hooks git ne peuvent pas couvrir
supabase db push,vercel deploy, ni une commandeghqui écrit — ce ne sont pas des opérations git.CLAUDE.mdles porte désormais comme étape manuelle explicite (npm run preflightavant).Échappatoire d'urgence :
git push --no-verify, documentée dans le hook.Summary by Sourcery
Automatisation des vérifications préliminaires de compte et d’environnement pour Ankora afin d’éviter l’utilisation de mauvais comptes GitHub, Supabase ou Vercel lors des opérations de développement et de type production.
Améliorations :
Build :
npm run preflight.Documentation :
CLAUDE.mdavec une phase de vérification des comptes (preflight) décrivant les hooks automatisés, les exigences de prévol manuelles avant les opérations Supabase/Vercel/gh, et le flux de récupération correct lorsque les vérifications échouent.Original summary in English
Summary by Sourcery
Automate account and environment preflight checks for Ankora to prevent using the wrong GitHub, Supabase, or Vercel accounts during development and production-like operations.
Enhancements:
Build:
Documentation:
Original summary in English
Summary by Sourcery
Automatisation des vérifications préliminaires de compte et d’environnement pour Ankora afin d’éviter l’utilisation de mauvais comptes GitHub, Supabase ou Vercel lors des opérations de développement et de type production.
Améliorations :
Build :
npm run preflight.Documentation :
CLAUDE.mdavec une phase de vérification des comptes (preflight) décrivant les hooks automatisés, les exigences de prévol manuelles avant les opérations Supabase/Vercel/gh, et le flux de récupération correct lorsque les vérifications échouent.Original summary in English
Summary by Sourcery
Automate account and environment preflight checks for Ankora to prevent using the wrong GitHub, Supabase, or Vercel accounts during development and production-like operations.
Enhancements:
Build:
Documentation:
Original summary in English
Summary by Sourcery
Automatisation des vérifications préliminaires de compte et d’environnement pour Ankora afin d’éviter l’utilisation de mauvais comptes GitHub, Supabase ou Vercel lors des opérations de développement et de type production.
Améliorations :
Build :
npm run preflight.Documentation :
CLAUDE.mdavec une phase de vérification des comptes (preflight) décrivant les hooks automatisés, les exigences de prévol manuelles avant les opérations Supabase/Vercel/gh, et le flux de récupération correct lorsque les vérifications échouent.Original summary in English
Summary by Sourcery
Automate account and environment preflight checks for Ankora to prevent using the wrong GitHub, Supabase, or Vercel accounts during development and production-like operations.
Enhancements:
Build:
Documentation:
Original summary in English
Summary by Sourcery
Automatisation des vérifications préliminaires de compte et d’environnement pour Ankora afin d’éviter l’utilisation de mauvais comptes GitHub, Supabase ou Vercel lors des opérations de développement et de type production.
Améliorations :
Build :
npm run preflight.Documentation :
CLAUDE.mdavec une phase de vérification des comptes (preflight) décrivant les hooks automatisés, les exigences de prévol manuelles avant les opérations Supabase/Vercel/gh, et le flux de récupération correct lorsque les vérifications échouent.Original summary in English
Summary by Sourcery
Automate account and environment preflight checks for Ankora to prevent using the wrong GitHub, Supabase, or Vercel accounts during development and production-like operations.
Enhancements:
Build:
Documentation: