Skip to content

ci(e2e): catch published exports.types→source regression in released bit#10474

Merged
davidfirst merged 5 commits into
masterfrom
ci-exports-regression-experiment
Jul 10, 2026
Merged

ci(e2e): catch published exports.types→source regression in released bit#10474
davidfirst merged 5 commits into
masterfrom
ci-exports-regression-experiment

Conversation

@davidfirst

@davidfirst davidfirst commented Jul 8, 2026

Copy link
Copy Markdown
Member

Adds two guards (in the nightly e2e_test_bbit job, against the bvm-released binary) that catch a released bit whose core @teambit/* packages point exports.types at source (./index.ts) instead of ./dist/index.d.ts — the regression that broke client builds in 2.0.10 (fixed in 2.0.11).

Guards

  • scripts/verify-released-exports.js — fails the job if any published @teambit package points exports.types at a .ts source. Deterministic; runs early in e2e_test_bbit.
  • e2e/harmony/released-bit-core-exports.e2e.ts — builds a component importing @teambit/application and asserts TypescriptCompile passes. Gated on E2E_RELEASED_BINARY (set only in e2e_test_bbit), because local dev links core packages to source and would always fail otherwise.

Both live in e2e_test_bbit, which is nightly-only — a bad release fails the nightly (before promoting to stable / before clients), without blocking every PR.

Also

  • Fix a transposed flag: --bin_bit--bit_bin. The helper reads npm_config_bit_bin, so e2e_test_bbit and e2e_test_bundle_simulation were silently running the local binary instead of the released/cleaned one.
  • Bump filesystem-read status file-count threshold 1500 → 1510.

Validated on CI

Temporarily pinning bbit to the broken 2.0.10 (reverted in the final commit): the scan failed with 183 packages point exports.types at SOURCE and the consume test failed on TypescriptCompile — while e2e_test (local dev) passed and the consume test correctly skipped there.

Temporary experiment to learn whether the existing e2e suite, run against the
released binary, catches the exports.types->source regression.

- Pin bbit to the known-broken 2.0.10 in bvm_upgrade (was 'bvm upgrade' -> latest).
- Run e2e_test_bbit on this PR branch (normally nightly-only).
- Fix the --bit_bin flag (was transposed as --bin_bit, so e2e_test_bbit and
  e2e_test_bundle_simulation silently fell back to the local binary instead of
  the released one). This part is a real fix and should stay.

The pin + workflow entry are temporary, to be reverted after the experiment.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

CI e2e: pin bbit 2.0.10 and run released-binary suite to probe exports regression

🐞 Bug fix ⚙️ Configuration changes 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Pin bbit to 2.0.10 in CI to reproduce the known exports regression.
• Run e2e_test_bbit on non-master branches to validate suite coverage against released binaries.
• Fix --bin_bit--bit_bin so e2e runs actually use the intended binary.
Diagram

graph TD
  W["CircleCI build_and_test workflow"] --> JB["Job: e2e_test_bbit"] --> BU["Command: bvm_upgrade (pin bbit 2.0.10)"] --> BB["Binary: bbit (released)"]
  JB --> EC["Command: e2e_test_cmd (mocha-circleci)"] --> BB
  W --> JBS["Job: e2e_test_bundle_simulation"] --> EC
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Add a dedicated “consume released aspects” TypeScript compile test
  • ➕ Directly exercises the failure mode (types/exports pointing at source) with minimal runtime cost
  • ➕ Can run quickly on every PR without pinning older binaries
  • ➖ Requires designing/maintaining a small downstream fixture project and TS config matrix
  • ➖ May not cover broader runtime regressions that full e2e catches
2. Run a version matrix (latest + pinned known-bad) behind an on-demand pipeline
  • ➕ Keeps main PR CI fast while still enabling regression probing when needed
  • ➕ Avoids permanently encoding a broken version into normal workflows
  • ➖ Less visible signal unless the on-demand workflow is consistently used
  • ➖ More CI plumbing/parameters to maintain
3. Publish a canary package validation step (prepublish gate)
  • ➕ Catches packaging/exports regressions closest to the publishing boundary
  • ➕ Prevents shipping broken metadata regardless of e2e coverage
  • ➖ Requires additional publish-time infrastructure and gating logic
  • ➖ Won’t validate broader e2e behavior across environments

Recommendation: For a temporary experiment, pinning bbit 2.0.10 and enabling e2e_test_bbit on non-master branches is a pragmatic way to measure current suite sensitivity—keep this until the signal is collected, then revert the pin/workflow entry as planned. The --bit_bin fix should remain permanently because it corrects which binary e2e actually executes. If the run stays green, prioritize adding a small downstream TS “consume released aspects” compile test to deterministically cover this regression class without relying on long-running full e2e.

Files changed (1) +18 / -4

Other (1) +18 / -4
config.ymlPin bbit 2.0.10, fix '--bit_bin', and enable 'e2e_test_bbit' on PR branches +18/-4

Pin bbit 2.0.10, fix '--bit_bin', and enable 'e2e_test_bbit' on PR branches

• Pins 'bbit' to 2.0.10 via 'bvm install/use' to reproduce the known exports regression during CI. Fixes a transposed CLI flag so e2e jobs correctly pass '--bit_bin' to 'mocha-circleci', ensuring they run against the intended released/cleaned binaries. Adds 'e2e_test_bbit' to the main workflow for non-master branches as a temporary experiment.

.circleci/config.yml

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jul 8, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (4) 📘 Rule violations (1) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Env gate mis-parses false 🐞 Bug ≡ Correctness
Description
released-bit-core-exports.e2e.ts enables the suite for any non-empty E2E_RELEASED_BINARY value
(e.g. "false"/"0"), which can unexpectedly run released-binary-only tests and cause false failures
outside the intended CI job.
Code

e2e/harmony/released-bit-core-exports.e2e.ts[R23-32]

+const runAgainstReleasedBinary = !!process.env.E2E_RELEASED_BINARY;
+
+// A bit-core aspect that carried the regression in 2.0.10; importing it forces its types to resolve.
+const CORE_ASPECT_PKG = '@teambit/application';
+// Any TS env that honors package `exports` reproduces it; react-env is the version verified against
+// bbit 2.0.10 (fails) and 2.0.11 (passes).
+const ENV = 'bitdev.react/react-env@6.0.20';
+
+(runAgainstReleasedBinary ? describe : describe.skip)(
+  'released binary: bit-core aspects type-check from dist, not source',
Evidence
The new test suite gate uses a double-bang truthiness check, which treats any non-empty string as
true; elsewhere in the repo, env-var gates compare explicitly against "true" to avoid enabling on
false-like strings.

e2e/harmony/released-bit-core-exports.e2e.ts[23-33]
components/legacy/e2e-helper/npm-ci-registry.ts[11-12]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The suite gate is computed via JS truthiness (`!!process.env.E2E_RELEASED_BINARY`), so values like `"false"` still enable the test.
### Issue Context
Other e2e gates in this repo use explicit string comparison for env vars to avoid this surprise.
### Fix Focus Areas
- e2e/harmony/released-bit-core-exports.e2e.ts[23-33]
### Suggested change
Replace the truthy check with an explicit allowlist, e.g.:
- `const runAgainstReleasedBinary = process.env.E2E_RELEASED_BINARY === 'true' || process.env.E2E_RELEASED_BINARY === '1';`
(or normalize case and accept `True` if desired).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Verifier skips JSON failures 🐞 Bug ☼ Reliability
Description
scripts/verify-released-exports.js silently ignores JSON parse/read failures for package.json and
continues, which can incorrectly report success even if a published @teambit package is
unreadable/corrupt. This weakens the new CI gate because it can miss precisely the kind of packaging
problem it’s meant to detect.
Code

scripts/verify-released-exports.js[R39-44]

+  let packageJson;
+  try {
+    packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
+  } catch {
+    continue;
+  }
Evidence
The verifier’s try/catch explicitly discards parse failures, meaning it can skip broken manifests
and still print the final success message/exit 0 if no other offenders were found.

scripts/verify-released-exports.js[35-52]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`scripts/verify-released-exports.js` currently swallows exceptions when parsing package.json files (and just `continue`s). This can yield a false-success verification run even when a package’s manifest is broken/unreadable.
### Issue Context
This script is used as a CI gate in `.circleci/config.yml` (the `e2e_test_bbit` job) to validate the released bundle’s `exports.types` entries.
### Fix Focus Areas
- scripts/verify-released-exports.js[36-52]
### Suggested fix
- When a package.json cannot be read/parsed, record it as an error (e.g., `offenders.push(...)` into a separate `manifestErrors` array).
- After scanning, if any manifest errors occurred, print them and `process.exit(1)` (or treat them as offenders), so the step fails loudly instead of silently passing.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Bundle simulation skips test 🐞 Bug ≡ Correctness
Description
The new released-bit-core-exports.e2e.ts suite runs only when E2E_RELEASED_BINARY is set, but
that env var is configured only for e2e_test_bbit and not for e2e_test_bundle_simulation (which
runs against bit-cleaned). This means the new regression test won’t run in bundle-simulation
pipelines.
Code

e2e/harmony/released-bit-core-exports.e2e.ts[R23-33]

+const runAgainstReleasedBinary = !!process.env.E2E_RELEASED_BINARY;
+
+// A bit-core aspect that carried the regression in 2.0.10; importing it forces its types to resolve.
+const CORE_ASPECT_PKG = '@teambit/application';
+// Any TS env that honors package `exports` reproduces it; react-env is the version verified against
+// bbit 2.0.10 (fails) and 2.0.11 (passes).
+const ENV = 'bitdev.react/react-env@6.0.20';
+
+(runAgainstReleasedBinary ? describe : describe.skip)(
+  'released binary: bit-core aspects type-check from dist, not source',
+  function () {
Evidence
The e2e test explicitly skips unless E2E_RELEASED_BINARY is present, while CircleCI only sets that
variable for e2e_test_bbit; the bundle-simulation job’s environment block lacks it.

e2e/harmony/released-bit-core-exports.e2e.ts[23-33]
.circleci/config.yml[833-910]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new released-binary-only e2e test is gated by `E2E_RELEASED_BINARY`, but the bundle-simulation job doesn’t set it, so the test is skipped there.
### Issue Context
- Test gating is implemented via `(runAgainstReleasedBinary ? describe : describe.skip)(...)`.
- `.circleci/config.yml` sets `E2E_RELEASED_BINARY` only in `e2e_test_bbit`.
- `e2e_test_bundle_simulation` runs e2e with `--bit_bin=bit-cleaned` but has no `E2E_RELEASED_BINARY` env.
### Fix Focus Areas
- .circleci/config.yml[883-910]
- e2e/harmony/released-bit-core-exports.e2e.ts[23-33]
### Suggested fix
Set `E2E_RELEASED_BINARY: "true"` in `e2e_test_bundle_simulation.environment` as well, or broaden the gating logic to also allow known "installed bundle" binaries (e.g., when `process.env.npm_config_bit_bin === 'bit-cleaned'`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (2)
4. Unicode symbols in verify-released-exports 📘 Rule violation ⚙ Maintainability
Description
The new script prints hardcoded Unicode symbols (, ) directly to stdout/stderr instead of
using the shared CLI output formatter, which can lead to inconsistent CLI output styling across the
repo.
Code

scripts/verify-released-exports.js[R54-67]

+if (offenders.length) {
+  console.error(
+    `✖ ${offenders.length} published @teambit package(s) point exports.types at SOURCE (.ts) instead of dist/*.d.ts:`
+  );
+  offenders.slice(0, 50).forEach((offender) => console.error(`  ${offender}`));
+  if (offenders.length > 50) console.error(`  ...and ${offenders.length - 50} more`);
+  console.error(
+    "\nConsumers whose envs type-check these packages will compile bit's source and fail to build.\n" +
+      'Republish the affected packages with dist-pointing exports.'
+  );
+  process.exit(1);
+}
+
+console.log(`✔ all @teambit packages under ${base} point exports.types at declarations (.d.ts).`);
Evidence
PR Compliance ID 1 forbids hardcoded Unicode symbols in CLI output. The added script emits  and
 directly in console.error/console.log, violating the rule.

CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols): CLAUDE.md: CLI Output Must Use Shared Output Formatter (No Hardcoded Chalk Styles or Unicode Symbols)
scripts/verify-released-exports.js[54-67]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`scripts/verify-released-exports.js` hardcodes Unicode status symbols (`✖`, `✔`) in its output. The compliance checklist requires using the shared CLI output formatter (and avoiding hardcoded symbols/styles) to keep output consistent.
## Issue Context
This script is executed in CI (`.circleci/config.yml`) and its output is user-facing in logs, so it should follow the repository’s shared formatting conventions.
## Fix Focus Areas
- scripts/verify-released-exports.js[54-67]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Overbroad e2e_test_bbit filter ✓ Resolved 🐞 Bug ➹ Performance
Description
build_and_test adds e2e_test_bbit with branches.ignore: master, which schedules the full e2e
suite on every non-master branch rather than only the experiment branch. This can unexpectedly slow
down and increase cost for all PR pipelines until the experiment is reverted.
Code

.circleci/config.yml[R1386-1391]

+      - e2e_test_bbit:
+          requires:
+            - setup_harmony
+          filters:
+            branches:
+              ignore: master
Evidence
The workflow configuration shows e2e_test_bbit added to build_and_test with a branch filter that
only excludes master, meaning it will run for every other branch build (i.e., typical PR
branches).

.circleci/config.yml[1345-1392]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The `e2e_test_bbit` workflow job is currently eligible on **all non-master branches** due to `branches.ignore: master`, which is broader than the intended “this PR branch only” experiment scope.
### Issue Context
This increases CI load and runtime for unrelated PRs while the experiment is present.
### Fix Focus Areas
- .circleci/config.yml[1383-1391]
### Suggested change
Update the job filter to run only on the experiment branch (or gate it behind a pipeline parameter), e.g.:

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

6. Verifier comment path mismatch 🐞 Bug ⚙ Maintainability
Description
verify-released-exports.js documents running node scripts/verify-released-exports.js ..., but
the CircleCI job runs it from the parent workspace as node bit/scripts/...; the comment can
mislead anyone trying to reproduce the CI step locally in the same directory layout.
Code

scripts/verify-released-exports.js[R7-10]

+ * Point it at a released bundle's @teambit dir, e.g. in the e2e_test_bbit CI job:
+ *   BV=$(bbit --version | tr -d '[:space:]')
+ *   node scripts/verify-released-exports.js "$HOME/.bvm/versions/$BV/bit-$BV/node_modules/@teambit"
+ *
Evidence
The script comment shows a repo-root invocation, while CircleCI runs it from the workspace root
where the repo lives under bit/ (persisted and then attached), so the correct path in CI is
bit/scripts/....

scripts/verify-released-exports.js[7-10]
.circleci/config.yml[514-525]
.circleci/config.yml[843-856]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The usage example in the script assumes the current working directory is the repo root, but in CircleCI the workspace root contains the repo under `bit/`, so the invoked path differs.
### Issue Context
In CircleCI, `checkout_code` persists a `bit` directory to the workspace, and `e2e_test_bbit` attaches it at `./`.
### Fix Focus Areas
- scripts/verify-released-exports.js[7-10]
### Suggested change
Update the comment to include both valid invocations, e.g.:
- From within the repo (`cd bit`): `node scripts/verify-released-exports.js ...`
- From the workspace root (as CI does): `node bit/scripts/verify-released-exports.js ...`

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. Verifier runs on every node ✓ Resolved 🐞 Bug ➹ Performance
Description
The "verify released bundle" step is inside e2e_test_bbit, which runs with parallelism: 32, so
each parallel container repeats the same filesystem scan. This adds unnecessary CI time/cost for a
check that only needs to run once per job.
Code

.circleci/config.yml[R841-843]

parallelism: 32
steps:
 - attach_workspace:
Evidence
The config shows parallelism: 32 for the job and places the verifier step in the job’s steps,
implying it runs once per parallel node.

.circleci/config.yml[834-858]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The released-exports verification step runs inside a highly-parallel job, so it executes redundantly in every parallel node.
### Issue Context
`e2e_test_bbit` declares `parallelism: 32` and includes the verifier step before tests.
### Fix Focus Areas
- .circleci/config.yml[841-856]
### Suggested fix
Choose one:
1) Gate the step to run only on node 0:

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread .circleci/config.yml Outdated
…bundle scan

- scripts/verify-released-exports.js: fails if any published @teambit package points
  exports.types at source (.ts) instead of dist/*.d.ts. Wired into e2e_test_bbit (fails fast).
  Locally: 183 offenders on broken 2.0.10, 0 on fixed 2.0.11.
- e2e/harmony/released-bit-core-exports.e2e.ts: builds a component importing @teambit/application
  and asserts TypescriptCompile succeeds. Gated to released binaries only (E2E_RELEASED_BINARY),
  since local dev links core packages to source. Verified: fails on 2.0.10, passes on 2.0.11.
- filesystem-read.e2e.ts: bump status file-count threshold 1500 -> 1510.
- remove flawed aspect-package-exports.e2e.ts (asserted on local pack output, which never reflects
  published exports).

Note: the 2.0.10 pin + per-PR e2e_test_bbit are still temporary (to validate the scan on CI).
Comment thread scripts/verify-released-exports.js Outdated
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 188e367

…tly-only

Reverts the temporary experiment scaffolding now that both guards are validated on CI
(scan + consume test both caught the pinned 2.0.10 regression; e2e_test/local passed):
- bvm_upgrade: restore 'bvm upgrade' (latest) instead of the 2.0.10 pin.
- remove e2e_test_bbit from the per-PR build_and_test workflow (it stays nightly-only),
  so a bad release fails the nightly rather than blocking every PR.

Kept (permanent): the --bit_bin flag fix, the E2E_RELEASED_BINARY gate, and the
verify-released-exports.js scan step in e2e_test_bbit.
@davidfirst davidfirst changed the title ci(e2e): probe exports regression against pinned bbit 2.0.10 [temp experiment] ci(e2e): catch published exports.types→source regression in released bit Jul 8, 2026
Comment thread scripts/verify-released-exports.js
Comment thread .circleci/config.yml
Comment thread e2e/harmony/released-bit-core-exports.e2e.ts
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit f36aaed

Comment on lines +23 to +32
const runAgainstReleasedBinary = !!process.env.E2E_RELEASED_BINARY;

// A bit-core aspect that carried the regression in 2.0.10; importing it forces its types to resolve.
const CORE_ASPECT_PKG = '@teambit/application';
// Any TS env that honors package `exports` reproduces it; react-env is the version verified against
// bbit 2.0.10 (fails) and 2.0.11 (passes).
const ENV = 'bitdev.react/react-env@6.0.20';

(runAgainstReleasedBinary ? describe : describe.skip)(
'released binary: bit-core aspects type-check from dist, not source',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

1. Env gate mis-parses false 🐞 Bug ≡ Correctness

released-bit-core-exports.e2e.ts enables the suite for any non-empty E2E_RELEASED_BINARY value
(e.g. "false"/"0"), which can unexpectedly run released-binary-only tests and cause false failures
outside the intended CI job.
Agent Prompt
### Issue description
The suite gate is computed via JS truthiness (`!!process.env.E2E_RELEASED_BINARY`), so values like `"false"` still enable the test.

### Issue Context
Other e2e gates in this repo use explicit string comparison for env vars to avoid this surprise.

### Fix Focus Areas
- e2e/harmony/released-bit-core-exports.e2e.ts[23-33]

### Suggested change
Replace the truthy check with an explicit allowlist, e.g.:
- `const runAgainstReleasedBinary = process.env.E2E_RELEASED_BINARY === 'true' || process.env.E2E_RELEASED_BINARY === '1';`
(or normalize case and accept `True` if desired).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +7 to +10
* Point it at a released bundle's @teambit dir, e.g. in the e2e_test_bbit CI job:
* BV=$(bbit --version | tr -d '[:space:]')
* node scripts/verify-released-exports.js "$HOME/.bvm/versions/$BV/bit-$BV/node_modules/@teambit"
*

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Informational

2. Verifier comment path mismatch 🐞 Bug ⚙ Maintainability

verify-released-exports.js documents running node scripts/verify-released-exports.js ..., but
the CircleCI job runs it from the parent workspace as node bit/scripts/...; the comment can
mislead anyone trying to reproduce the CI step locally in the same directory layout.
Agent Prompt
### Issue description
The usage example in the script assumes the current working directory is the repo root, but in CircleCI the workspace root contains the repo under `bit/`, so the invoked path differs.

### Issue Context
In CircleCI, `checkout_code` persists a `bit` directory to the workspace, and `e2e_test_bbit` attaches it at `./`.

### Fix Focus Areas
- scripts/verify-released-exports.js[7-10]

### Suggested change
Update the comment to include both valid invocations, e.g.:
- From within the repo (`cd bit`): `node scripts/verify-released-exports.js ...`
- From the workspace root (as CI does): `node bit/scripts/verify-released-exports.js ...`

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 69c2019

- verify-released-exports.js: fail (not silently skip) on unreadable/corrupt package.json;
  use plain ASCII markers instead of Unicode symbols.
- e2e_test_bbit: run the released-bundle scan once (node 0) instead of on all 32 parallel nodes.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit efe369a

@davidfirst davidfirst merged commit 2d07512 into master Jul 10, 2026
13 checks passed
@davidfirst davidfirst deleted the ci-exports-regression-experiment branch July 10, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants