Skip to content

perf: native cli - #10813

Draft
zkochan wants to merge 644 commits into
teambit:masterfrom
zkochan:rust-workspace-materialization
Draft

zkochan wants to merge 644 commits into
teambit:masterfrom
zkochan:rust-workspace-materialization

Conversation

@zkochan

@zkochan zkochan commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Adds a standalone Rust bit CLI, 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.

  • Implements native workspace and scope inspection, tracking, dependency installation, snapshots, checkout, merge, lane/import/export and recovery paths. The command coverage table records supported modes and remaining boundaries.
  • Keeps the diff within native/, Rust documentation/tooling and the two Rust workflows. Upstream master is merged through 3754c4f57 (following Bit 2.2.160).
  • Matches upstream's pnpm 12.16 engine, including stale-symlink retry protection and symlinked-lockfile refusal. All engine Git dependencies advance together; native API adapters and lockfiles are updated.
  • Handles active-lane object refreshes and cross-scope hidden updates without promoting hidden entries. Workspace merges fetch hidden components' main history and retain histories already received in the same operation. Scope-side fixture production still uses the released CLI.
  • Scaffolds CI onboarding in Rust: repository-root workflows, comment-preserving configuration and backups, agent instructions, and GitHub/Enterprise setup guidance. Existing files and hand edits are preserved. Configured startup callbacks, active lanes, bitmap auto-sync and unsupported CI configuration still decline before effects.
  • Restores pre-merge main component models when aborting a lane merge, including retained-import proofs so later publication cannot replay the merged heads. The two new upstream assertions run natively; disabling the snapshot makes the regression fail. History traversal now uses indexed lookup while preserving insertion and traversal order.
  • Collects bare-scope garbage in Rust, retaining local ancestry, live/trashed lane roots and requested dependency versions. Unix backup/recovery preserves symlinks, overwrite rules, copy ordering and recoverable partial failures. Workspace collection plans before mutation and owns errors afterward. Bare verbose reports, workspace verbose text/JSON output and workspace legacy aliases are also native on the documented inputs. Windows nonempty collection/recovery, workspace verbose text with multiple deletions, complex bare verbose ordering, mixed-type workspace reports, larger batches and unqualified early-failure layouts still delegate before effects.
  • Owns configured HTTP export recovery and file pending-directory deletion in Rust. Generic actions, file persistence, runtime/provider replacement, full build/CI orchestration and long-running services remain tracked work.

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 tsc is 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/napi 12.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 commit 673e41df7 failed 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.

zkochan added a commit that referenced this pull request Oct 15, 2026
…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>
* feat(rust): remove current-lane components natively

* feat(rust): remove linear lane snap chains
* feat(rust): complete status and diff operation paths

* fix(ci): initialize the Windows BVM directory within a step

* perf(ci): reuse Windows workspace artifacts for oracle tests
* feat(rust): complete native snapshot and tag lifecycle

* test(rust): qualify portable metadata publication

* fix(rust): make native callbacks portable on Windows

* test(rust): preserve registry failures across Windows disconnects

* test(rust): make workspace oracle fixtures deterministic
* feat(rust): complete repository and checkout lifecycle

* docs(rust): keep checkout qualification in the PR

* test(rust): verify safe Windows configuration commits

* fix(rust): match Windows checkout and adapter behavior
* feat(rust): unify native merge history and recovery lifecycles

* fix(rust): qualify merge publication and recovery on Windows

* test(rust): align recovery copy platform qualification
* feat(rust): complete client fetch and push orchestration

* test(rust): use macOS-compliant mutual TLS certificates

* test(rust): recognize reset sockets after fetch cancellation

* fix(rust): match Windows transfer acknowledgement and lane behavior

* fix(rust): preserve import serialization and repeated fork exports
Merge upstream master so the integration branch and upstream PR merge result share the same e2e sources. Inventory the six new upstream cases while preserving existing port annotations.
…gnostics (#271)

* feat(rust): consolidate workspace provisioning configuration and diagnostics

* fix(rust): normalize remote doctor queries on Windows

* test(rust): deliver the offline doctor catalog atomically
)

* feat(rust): own stash publication and restoration

* fix(rust): preserve Windows stash cleanup and lane import stack budgets
* feat(rust): own workspace add tracking and publication

* fix(rust): match Windows tracking and stabilize doctor catalog fixture

* fix(rust): preserve platform paths in outside-workspace errors

* fix(rust): resolve existing main files using filesystem case semantics

* test(rust): isolate add failure oracles from loader ordering
* feat(rust): own component move rename and deprecation lifecycles

* fix(rust): preserve identity write and reload lifecycles

* perf(rust): qualify identity lifecycle performance

* test(rust): preserve new components in Windows export fixtures
* feat(rust): complete workspace mutation batches and scope renaming

* fix(rust): retain canonical scope refactor loader order

* perf(rust): resolve documentation cache hits and empty modules natively

* perf(rust): hydrate added scope components before tooling

* perf(rust): share workspace inventory and parallelize batch preflight

* test(rust): qualify workspace mutation performance and Windows fixtures

* test(rust): use a real HTTPS tunnel for offline doctor catalog

* fix(rust): preserve published numeric checkout targets

* perf(rust): reuse ordered batch package matchers

* test(rust): qualify complete workspace mutation performance
* feat(rust): complete native component and scope fork workflows

* perf(rust): reuse rename planning matchers and fuse on-add requests

* test(rust): qualify complete native fork workflows and regressions

* fix(rust): preserve Windows fork installation paths and history fixtures

* test(rust): retain offline doctor child and tunnel diagnostics

* test(rust): validate redundant installation clock redraw

This branch has not been deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants