Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

check:affected: a changed test file must run the test-file size ratchet

Fermée
#3,787 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@thymikee y travaille déjà.

Depuis le 18/10/2026.

  • #3804 par @thymikee — ouverte

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
72/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
typescript
Domaine
testing, tooling

Piste de recherche

Read the selection rules in scripts/check-affected/model.ts and the existing ratchet test, scripts/tests/test-file-size-ratchet.test.ts. Find where the measured file patterns and roots are defined, then check how other text-read gates declare selection reasons. Add a model.test.ts case and run it: a changed measured test file should select the ratchet with its path in the reason, while a non-test change should not.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

bug in-progress ready-for-agent

Purpose

pnpm check:affected --run passed on #3732 at 63c6a66, but CI Coverage failed scripts/__tests__/test-file-size-ratchet.test.ts: packages/platform-apple/src/lifecycle.test.ts grew from 970 to 1,006 lines, past the 1,000-line tripwire. The local gate selects tests through Vitest's module graph (vitest related). The ratchet doesn't import the files it measures; it walks the tree and reads line counts. So no change to a test file ever selects it, and the failure reaches CI one review round late.

Required behavior

  • When a change adds or modifies a file the ratchet measures (*.test.ts, *.test.tsx or *.test.mjs under src/, packages/, test/ or scripts/, excluding node_modules, dist, dist-types and .tmp), the affected plan selects the ratchet test, with a reason that names the triggering file.
  • Express it as a selection rule in scripts/check-affected/model.ts, the same way other text-read gates are declared there. Don't special-case it in run.ts.
  • Keep a single definition of which files the ratchet measures. The selection rule and the ratchet test must read the same pattern and roots, so they can't drift. Put the shared definition where both can import it.
  • A change that touches no test file doesn't select the ratchet.

Completion

  • A model.test.ts case: a changed test file selects the ratchet check and gives the triggering reason, and a non-test change doesn't. It fails before the change and passes after.
  • Planting a 1,001-line new test file in a scratch checkout makes pnpm check:affected --run fail locally on the ratchet.
  • pnpm check:affected --run --head <sha> passes on the final commit.
Langage dominant
TypeScript
Étoiles
5k
Forks
334
Merge moyen
12 h 13 min
PR mergées (30 j)
723

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de callstack/agent-device

Toutes les issues de callstack/agent-device

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.