Skip to content

fix(add): accept linkWorkspacePackages deep#799

Merged
jdx merged 1 commit into
mainfrom
codex/link-workspace-packages-deep
May 27, 2026
Merged

fix(add): accept linkWorkspacePackages deep#799
jdx merged 1 commit into
mainfrom
codex/link-workspace-packages-deep

Conversation

@jdx

@jdx jdx commented May 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • accept linkWorkspacePackages: deep alongside boolean values
  • normalize the setting through a generated enum and treat deep as workspace-link enabled for aube add
  • add Rust and Bats regression coverage, plus regenerated settings docs

Tests

  • cargo test -p aube-settings link_workspace_packages -- --nocapture
  • cargo test -p aube-manifest link_workspace_packages_deep -- --nocapture
  • mise run test:bats test/pnpm_monorepo_index.bats --filter 'linkWorkspacePackages=deep'\n\nThis PR was generated by Codex.

Note

Low Risk
Config parsing and aube add manifest behavior only; no auth or install-graph changes beyond aligning with pnpm’s tri-state setting.

Overview
linkWorkspacePackages now accepts pnpm-style true, false, and "deep" (not just booleans). Workspace YAML deserializes the key as a raw yaml_serde::Value, settings.toml / generated docs declare the union type, and resolution maps values to LinkWorkspacePackages (False / True / Deep).

aube add enables workspace-sibling lookup whenever the resolved setting is anything other than False, so deep behaves like true for manifest writes (e.g. workspace:^). Docs no longer claim deep is unsupported; they describe it as an alias for add-time linking given install-time workspace preference.

Regression coverage: manifest YAML parse, settings resolution from workspace yaml and .npmrc, and a Bats monorepo case with linkWorkspacePackages: deep.

Reviewed by Cursor Bugbot for commit abff7c0. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit abff7c0. Configure here.

type = "bool"
default = "false"
type = '"false" | "true" | "deep"'
default = "\"false\""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Numeric boolean values silently ignored after type change

Medium Severity

Changing linkWorkspacePackages from type = "bool" to an enum-style string union causes a silent regression for .npmrc and environment variable values of "1" or "0". Previously, the bool path used parse_bool which accepted "1" as true. Now the generated from_str_normalized only matches the literal strings "false", "true", and "deep" — so link-workspace-packages=1 in .npmrc or npm_config_link_workspace_packages=1 in the environment is unrecognized, silently falling back to the default False and disabling workspace linking.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit abff7c0. Configure here.

@greptile-apps

greptile-apps Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR teaches aube to accept linkWorkspacePackages: deep alongside the existing true/false booleans, aligning with pnpm's documented surface. The setting is migrated from a raw bool type to a generated three-variant enum (False | True | Deep), with deep treated as an alias for the add-time manifest behavior.

  • settings.toml changes the type from \"bool\" to '\"false\" | \"true\" | \"deep\"', causing build.rs to generate a typed LinkWorkspacePackages enum; manifest.rs is updated to match any non-False variant.
  • WorkspaceConfig.link_workspace_packages is widened from Option<bool> to Option<yaml_serde::Value> so the YAML parser can accept both the native boolean and the string \"deep\".
  • Three new unit tests in values.rs and one in workspace.rs cover the new resolution paths; an end-to-end bats test verifies the full aube add flow with deep.

Confidence Score: 4/5

Safe to merge with the caveat that users who previously set link-workspace-packages=1 (or =0) via env var or .npmrc will now have the setting silently ignored.

The type migration from bool to a string-enum drops support for "1"/"0" boolean shorthands in .npmrc and env vars — anyone using that style loses workspace linking silently, with no warning or migration note. All other paths (YAML booleans, "true"/"false" strings, "deep") are correctly wired and tested. The rest of the change — codegen, manifest condition, bats test — is straightforward.

crates/aube-settings/settings.toml and the surrounding env-var / .npmrc resolution path, specifically whether the "1"/"0" shorthand regression needs a changelog note.

Important Files Changed

Filename Overview
crates/aube-settings/settings.toml Changes linkWorkspacePackages from bool to a three-variant enum; subtle regression for =1/=0 shorthands via env var or npmrc.
crates/aube/src/commands/add/manifest.rs Updates the aube add conditional to treat any non-False variant as workspace-link enabled.
crates/aube-manifest/src/workspace/config.rs Widens field from Option<bool> to Option<yaml_serde::Value> to accept both booleans and "deep" strings.
crates/aube-settings/src/values.rs Adds three new unit tests covering the new resolution paths.
test/pnpm_monorepo_index.bats Adds end-to-end bats test for linkWorkspacePackages: deep producing a workspace:^ specifier.

Comments Outside Diff (1)

  1. crates/aube-settings/settings.toml, line 2276-2302 (link)

    P2 Silent regression for "1" / "0" style env-var and .npmrc values

    The old type = "bool" routing went through bool_from_env / bool_from_npmrc, which call parse_bool and accept "1" and "0" alongside "true" / "false". The new '"false" | "true" | "deep"' type routes through string_from_env / string_from_npmrcfrom_str_normalized, which only matches the three declared variants. So AUBE_LINK_WORKSPACE_PACKAGES=1 or link-workspace-packages=1 in .npmrc now silently falls through to the default (false) and disables workspace linking, whereas before it enabled it. This is a quiet opt-out for anyone using the numeric-boolean style. If that regression is acceptable (pnpm's canonical values are true/false/deep), a short migration note in the docs or a changelog entry would surface it before users hit it.

    Fix in Claude Code

Fix All in Claude Code

Reviews (1): Last reviewed commit: "fix(add): accept linkWorkspacePackages d..." | Re-trigger Greptile

@jdx jdx merged commit 48fa715 into main May 27, 2026
18 checks passed
@jdx jdx deleted the codex/link-workspace-packages-deep branch May 27, 2026 19:49
@greptile-apps greptile-apps Bot mentioned this pull request May 27, 2026
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.

1 participant