Repository navigation
perf: native cli - #10813
perf: native cli#10813zkochan wants to merge 1156 commits into
Conversation
…LI (#10814) ## Proposed Changes - **What changes:** a pull request that changes only the Rust CLI and docs no longer runs the e2e suites. The Rust CLI paths are `native/`, `scripts/rust/`, `.github/workflows/rust.yml` and `.github/workflows/rust-scope.yml`; see #10813. The Rust CLI has its own workflow (`.github/workflows/rust.yml`), and the e2e suites never run it, so for such a PR they only cost CI time. It extends the existing docs-only skip: - **GitHub Actions (`e2e-tests.yml`):** those paths are left out of the `pull_request` path filter, so the workflow doesn't start. - **CircleCI (`e2e_test`):** the `skip_when_doc_only` step treats those paths like doc files and halts the job, which counts as a success. - **What's unchanged:** - `setup_harmony`, `lint` and `generate_and_check_types` still run, and `bit_merge` still gates on the type check; - on master, or with a missing merge base or an unreadable diff, the full suite runs as before; - doc files under `e2e/` still count as test changes; - a PR that also touches any other file runs everything. - **Checks I ran:** - Both YAML files parse. - I ran the step's filter on #10813's 858 files: it halts. - A Rust + docs diff halts; adding one `scopes/` file, an `e2e/` doc or another workflow file runs the full suite. - Every file in #10813 is excluded by the new path patterns. - I couldn't run `circleci config validate` locally (no CLI installed); this PR's own CircleCI run validates the config. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The invalid branch-name guard test invoked the shared Git client's real status and remote queries before reaching the guard. On a slow checkout it exceeded Mocha's two-second timeout, failing the CI component's unit suite. Stub those two queries for this test and restore the shared client in `finally`. The guard assertion and timeout are unchanged. Validation: - All 405 CI component unit tests pass locally using Mocha and Babel with installed Bit dependencies. - With status delayed by 2.5 seconds, the original test reproduces the 2000 ms timeout; the fixed test passes (all seven tests in its file). - Prettier and `git diff --check` pass. - CircleCI PR build passes, including all 405 CI component tests (533 ms). CI lint and the full workspace type check pass; all four GitHub E2E shards pass. Fixes the CircleCI unit-test failure blocking #10813.
|
Default-environment formatting now owns component selection, source loading, dependency/history/documentation caches, reports and single-file writes in Rust. Prettier remains an external Node tool; the execution test rejects Bit runtime module loads. This does not claim a Rust implementation of Prettier or a runtime-independent distribution. Nine released-CLI comparisons cover JSON/text/CI checks, changed-only selection, new/tagged/exported identities, empty workspaces, configured names, nested source ordering, successful writes, repeated clean results and owned read-only-file errors. Full workspace/cache/remote state remains compared. Only duration and a qualified two-component cached completion-order permutation are normalized. Disabling native dispatch or documentation-cache publication makes the corresponding regression fail. Custom environments/providers, rich documentation cache misses, larger cached batches, concurrent source writes and unsupported tool inputs still decline before effects. Windows CI includes the formatter cases, and nested output paths use platform separators. The broader implementation work remains tracked in zkochan#395. Validation: all 1,811 workspace tests and all 1,715 active end-to-end cases pass (two existing skips), along with formatting, Clippy, Dylint, rustdoc, generated inventory/census/assets and scope checks. An earlier Bit Cloud setup failure passed unchanged before the final full run. Repository Node lint cannot start locally because |
|
Merged upstream master through The mixed-error unit regression fails when the old classification is restored. The real-workspace JSON/text regression explicitly asserts the older released CLI's duplicate row/section before applying the exact upstream delta; all other fields, messages, exit status and stderr stay compared. The released 2.2.162 artifact was unavailable during qualification, so this does not claim a newer released oracle was tested. Validation: formatting, Clippy, Dylint, rustdoc and all 1,812 workspace tests pass. Full E2E: 1,714 passed, one Bit Cloud request failed during released-CLI MDX environment setup, and two existing cases were skipped. The failed fixture passed unchanged on a serial rerun. Generated inventory/census/assets and scope checks pass. Local repository Node lint remains unavailable because |
|
Implemented in 9616d164a. Rust now owns the qualified default-environment lint flow: component selection/loading, dependency/history/documentation caches, generated TypeScript config, diagnostic totals, text/JSON/CI/color reports and single-file fixes. ESLint remains an external Node tool. The built-in configuration is embedded; execution tests reject Bit runtime and configuration-module imports. Installed tool/config metadata is still required, and this does not claim a runtime-independent distribution. Released-CLI comparisons retain raw ESLint diagnostics and full workspace/cache/remote state, including config filenames, bytes and permissions. They cover clean/cached runs, warnings, errors, autofixes, changed/new selection, empty/configured workspaces, nested sources, CI/colors, read-only source/config failures and pre-effect guards. Only validated duration fields are normalized. Disabling native dispatch fails the ownership assertion; changing the generated config filename fails the filesystem comparison. Comparison fixtures now restore directory permissions lost during copying. This also fixes Windows formatter CI: formatted files retain Prettier's LF bytes, and preload tests use quoted forward-slash paths so Node does not consume Windows backslashes. Formatting retains new components in changed-only selection and declines ignored file extensions before effects. Windows provisioning CI covers both services. Multiple components, concurrent fixes, custom environments/providers, rich documentation cache misses, noncanonical generated configs and unqualified built-in lint config versions remain explicit boundaries in issue zkochan#395. No broad completion claim is inferred from these cases. Validation: formatting, Clippy, Dylint, rustdoc, generated plan/census/asset and |
|
Implemented in 8528e011a. Built-in React formatting and linting now use Rust-owned environment facts and component loading. The scoped service mode supplies React policy, file patterns and compiler facts without starting the published Bit host; other operations retain their existing provider lifecycle. Service failures report the selected environment. Custom providers, mixed environment groups, unsupported dependency syntax and the existing documentation-cache boundaries still decline before effects. Eight new differential cases cover repeated caches, changed selection, dependency metadata, diagnostics, fixes, CI/colors and read-only writes. The no-Bit-module preload passes with React too. A tagged dependency-bearing regression proves the peer policy matters: changing React's range makes an unchanged component incorrectly appear in changed-only lint results, and the regression fails. ESLint and Prettier remain external Node tools and their installed package metadata is still needed. The broader runtime, compiler, build and service work in issue #395 remains open. Validation: all 1,814 workspace tests and formatting, Clippy, Dylint, rustdoc, |
|
Implemented in c21307b33. Capsule fixture network verificationThe remaining-core-environment capsule comparison now configures five built-in The versioned custom-aspect environment retains released assignment and metadata Validation: formatting, Clippy, Dylint, rustdoc, all 1,814 workspace tests and |
|
Implemented in 652441e39. Upstream history indexing syncMerged upstream through The upstream population change has one observable delta: full traversal of a Existing native export/history collection already uses indexed visited sets. Validation: all 1,816 workspace tests, formatting, Clippy, Dylint, rustdoc and |
|
Delivered in commit Replaced the qualified built-in compiler path's handwritten transpiler with Rust-owned selection, dependency/documentation cache publication, output planning, package linking and reporting around the external TypeScript tool. Fourteen differential cases compare emitted JavaScript/source-map bytes, diagnostics, repeated compilation, changed selection, copied files and line endings, injected/root packages, optional dependency metadata, CI/colors and partial writes. Cold documentation caches after dependency rewiring now have an AST proof for bounded data-only console logging; a negative control catches loss of native execution. Further negative controls catch missing loading output and corrupted source maps. Preload tests reject Bit runtime imports for valid compilation and syntax diagnostics. The external TypeScript/parser tools still resolve through installed distribution metadata. Custom environments/providers, type generation, rich documentation misses, colliding/binary outputs and unqualified concurrent report/failure ordering remain open. This is partial progress on zkochan/bit#395, not completion of the Rust port. Windows provisioning now includes the compiler suite. Validation: formatting, Clippy, Dylint, rustdoc, generated-file/asset/scope checks and all 1,814 workspace tests pass. All 17 focused cases pass. Final full E2E: 1,746 passed, two released-command Bit Cloud failures, two existing skips. Both failures passed unchanged on a serial rerun. Local Node lint still lacks tsc; platform CI is pending for this head. The preceding head's E2E shard 3 failed on a timed pnpm progress frame. Independent Node-only replay reproduces that variation; its narrowly bounded comparison fix follows separately. |
|
Delivered in commit The E2E shard 3 failure on the preceding head came from one timed pnpm progress frame: the native run printed “resolved 1” before the two-package store banner, while the Node control coalesced that first frame. Independent Node-only replays of the same restored fixture reproduce both outputs under different scheduling. Apart from elapsed times and that initial frame, the full outputs are identical. The comparison now recognizes this specific zero-added one-to-two resolution advance and the released padded/unpadded banner forms. It retains every later transition, final counter, error, report, provider assertion and filesystem comparison. Other advances, reverse counters, transfer/addition changes and malformed terminal controls remain exact. Negative controls using both the complete Node replays and the recorded CI failure fail with the old comparison and pass with the fix. No production command behavior, retries or timeouts were changed. Validation: formatting, Clippy, Dylint, rustdoc, generated-file/asset/scope checks and all 1,814 workspace tests pass. All 17 focused progress/provider cases pass. Full E2E: 1,749 passed, one Bit Cloud fixture-creation failure, two existing skips. The failed case passed unchanged on a serial rerun. Local Node lint still lacks tsc; new-head platform CI is pending. |
|
Commit: 887a5ce35. Rust now owns built-in Node/React single-component JSON test orchestration: selection, loader caches, test discovery, reports, coverage-report consumption and command history. Jest and Babel remain external tools with explicit JavaScript configuration adapters; the installed distribution still provides tool metadata. Twenty differential cases cover TypeScript/TSX, snapshots, exclusions, assertion failures, pending/todo tests, exit codes, direct process exit, process arguments, existing/test-created coverage and cleanup failures without replay. A separate fixture regression prevents read-only directories from retaining reference-run output. Independent Node replays qualify the two possible completion orders in the parallel-file fixture; other output and filesystem assertions remain exact apart from start/duration fields. The Windows compiler report now normalizes emitted-path separators, addressing the preceding head's provisioning failures. Windows provisioning also runs the tester comparisons. Validation: formatting, Clippy, Dylint, rustdoc and all 1,816 workspace tests pass. All 20 focused tester cases pass. Full E2E: 1,769 passed, two Bit Cloud failures in existing fixtures and two existing skips; both failed cases pass unchanged on serial rerun. Generated plan/census, asset, scope and public-data checks pass. Local Node lint lacks tsc. Platform CI for this batch is pending. Text reporting, multiple component/environment groups, explicit test files, coverage collection flags, JUnit, snapshot-update flags, custom providers and watch/debug modes remain open. This is a checkpoint toward issue 395, not completion of the remaining runtime milestones. Yarn remains excluded. |
d86c464 to
0babf88
Compare
…es, test, update, validate, version, version-history, watch, whoami, and workspace-command modules (slices 16362-16481)
…ient-transfer, bit-dependency-scanner, bit-ignore, and bit-install modules (slices 16482-16601)
…over key order and scope-rename history ids
…fix lane history phase type
…and show behavior
…evert and reset parity
…ner, config, export and resume-export
… hydrated component metadata
…st colors; handle component dependency policy in capsule create
PR Summary by QodoAdd a hybrid Rust Bit CLI with native workspace and scope operations
AI Description
Diagram
High-Level Assessment
Files changed (57)
|
Code Review by Qodo 1. A failed move leaves components misplaced
|
Code Review by Qodo 1. A package name can redirect installer writes
|
|
Code review by qodo was updated up to the latest commit da76287 |
|
Code review by qodo was updated up to the latest commit 538d1ed |
|
Code review by qodo was updated up to the latest commit bdb9daf |
|
Code review by qodo was updated up to the latest commit dfb67e5 |
|
Code review by qodo was updated up to the latest commit 45ee567 |
Adds a standalone Rust
bitCLI, with compatible Node CLI fallback for paths still being ported. Native command execution does not imply independence from Bit's JavaScript runtime: retained host calls and remaining fallbacks are documented and tracked in the completion plan. Yarn is excluded from that plan.native/, Rust documentation/tooling and the two Rust workflows. Upstream master is merged through3754c4f57(following Bit 2.2.160).Validation: formatting, Clippy, Dylint, rustdoc, generated porting/census/asset checks and all 1,809 workspace tests pass. Full E2E: 1,704 passed, two Bit Cloud setup failures and two existing skips. Both failed cases passed unchanged on a serial rerun. All 36 focused collection/recovery/installer cases pass.. The collection tests compare command bytes and complete filesystem effects, with negative controls for alias resolution and repeated lane counts. The main recovery regression proves the restored head and empty export staging. Repository Node lint cannot run locally because
tscis unavailable.Bit 2.2.160 is not yet downloadable. The new upstream recovery semantics therefore have explicit native regression assertions, while component serialization retains the existing released-qualified projection. Differential qualification against 2.2.160 remains pending that release's availability.
The released Bit reference still bundles pnpm 12.13, so the E2E harness resolves its installer dependency to the integrity-pinned, published
@pnpm/napi12.16 addon. It does not replace Bit implementation code or change its installed files. Comparisons retain the new validation metadata and normalize only qualified clock fields. CI installs this isolated reference on Linux and Windows.The Windows transfer fixture's setup snapshots use the released CLI explicitly; its native fetch, output and stored-object assertions remain required. The new onboarding cases also run in Windows provisioning CI. Windows provisioning exposed checkout line-ending and filesystem-error differences. The latest commit normalizes the bundled assets and Windows error paths/codes; all 12 onboarding cases also pass locally with CRLF assets. The final nested-workspace discrepancy came from Node preserving DOS short names while Rust expanded them. Path resolution now follows the released Node API, with a direct filesystem oracle and a negative control that fails under canonicalization. Windows provisioning now passes with the path fix. The Linux installer comparison also handles the observed redundant two-package startup redraw, only when the immediately following store banner repeats the same counters. Counter changes, other control sequences, intervening messages, later progress transitions and filesystem assertions remain checked. The recorded CI output fails the former comparison and passes the corrected one. The preceding Rust CI workflow is green on
726e5bc33, including Windows provisioning and all four Linux E2E shards. The collection/recovery commit673e41df7failed its generated-inventory check because GitHub merged it with newer upstream tests. This sync preserves that newer master and updates the inventory with both implemented assertions. All platform and E2E jobs on that prior head passed. CI for the new head is pending; Windows merge-history coverage now explicitly includes lane abort.Latest validation (d88b3f1): the upstream history-merge set optimization is already implemented natively; added 40,000-row ordering/override and empty-input regressions. Fixed the Linux host fixture ETXTBSY race by using a checked-in immutable executable. All 60 CLI unit-suite stress runs at 64 threads pass. Formatting, Clippy, Dylint, rustdoc, generated checks and all 1,811 workspace tests pass. Full E2E: 1,703 passed, three failed, two existing skips. Two failures were Cloud setup requests; one was a dependency-capture freshness failure during environment-policy tagging. All three pass unchanged serially; the intermittent freshness failure remains under investigation. Windows merge-history CI on the preceding head passed, including lane abort. CI for this head is pending.