Skip to content

finding(test-infra): check-side-effects-array.test.ts reds on any tree where packages/layout/dist/index.umd.cjs exists — a third instance of objectui#6893's class #9124

Description

@os-tesla

Found while working objectui#7479 (PR objectui#9122). Filed unassigned and NOT fixed there — that card is scoped to the i18n locale catalogues, and this gate test is neither in its diff nor in its blast radius (proof below). Generated by an agent seat; this paragraph is the attribution, deliberately written as prose rather than as a footer block.

What

One case in scripts/__tests__/check-side-effects-array.test.ts changes verdict with the tree's BUILD STATE:

describe('the real workspace — the population this widening was measured against')
  it('finds a stylesheet subpath and a second build format, and no second entry POINT')

It asserts

expect(results.flatMap((r) => r.entryForms.flatMap((e) => e.alternateFormats)).length)
  .toBeGreaterThan(0);

alternateFormats is the set of published forms classifyEntryForms could classify as neither a module nor an asset — and the branch that decides that calls existsInPackage(form), i.e. fs.existsSync against the package directory. Two packages declare a sideEffects ARRAY and are therefore the whole population: @object-ui/app-shell and @object-ui/layout. The only "second build format" among them is @object-ui/layout's "require": "./dist/index.umd.cjs".

⇒ on an UNBUILT tree that file is absent, classifies as unmapped, and alternateFormats is 1. On a BUILT tree it exists, classifies as an asset, and alternateFormats is 0 — the assertion reds.

Reproduction, measured both ways on one tree

Container tree at objectui#9122's head, after pnpm turbo run build --filter='./packages/*':

pnpm exec vitest run scripts/__tests__/check-side-effects-array.test.ts
  Tests  1 failed | 43 passed (44)
  AssertionError: expected 0 to be greater than 0   (line 720)

Then, with the single gitignored artifact moved aside and nothing else changed:

mv packages/layout/dist/index.umd.cjs /tmp/  &&  pnpm exec vitest run scripts/__tests__/check-side-effects-array.test.ts
  Tests  44 passed (44)

git check-ignore -v packages/layout/dist/index.umd.cjs answers .gitignore:6:dist, so the input this assertion turns on is not in the tree at all. One file, both directions, exit codes captured before any pipe.

Why it is filed rather than fixed in objectui#9122

That PR touches packages/i18n, packages/app-shell sources, apps/console, and four scripts/ files. It touches no package manifest that declares a sideEffects array, and it touches packages/layout not at all — so it cannot move alternateFormats. Lit control for that claim: the same command on the same tree passes with the one artifact absent, which it could not do if the diff were the cause.

Why it is worth a card

This is the third measured instance of the class objectui#6893 named (check-sdui-registration-pins.test.ts fails wherever packages/app-shell/dist EXISTS) and objectui#7460 named from the other side (check-readme-exports.test.ts reds on a HALF-built tree). objectui#7671 filed the conjunction of those two and is closed; this one is a different file and is not covered by any of the three.

The harm is the one objectui#7671 stated: a contributor who builds the workspace and then runs scripts/__tests__/ gets a red that their own diff cannot clear, the assertion message (expected 0 to be greater than 0) names nothing searchable, and a red that cannot be cleared is a red that gets ignored. CI does not see it, because the job that runs this gate installs without building the packages — which is also why the assertion was written this way and stayed true for as long as it has.

Not proposed here

Whether the fix is to make the case branch on build state the way check-readme-exports.test.ts tries to, to assert against a fixture rather than the live workspace, or to have classifyEntryForms read the manifest rather than the filesystem for this one question — that is a design call for whoever owns the gate, and each has a different failure mode. What this card carries is the measurement.

Refs: objectui#6893 · objectui#7460 · objectui#7671 · objectui#7479 / PR objectui#9122 (where it was hit).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:devxobjectui devx stream: fix lands on .github/, scripts/ or release pipeline — devx lane cross-repopriority:p2tooling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions