fix(rs_lib): restore stripped deploy.include for workspace-member paths#99
fix(rs_lib): restore stripped deploy.include for workspace-member paths#99crowlbot wants to merge 1 commit into
Conversation
Fixes #90. When `deno deploy` is run from a Deno workspace root with a root-level `deploy.include` entry that points at a workspace member, the upstream `deno_config::WorkspaceDirectory::to_deploy_config` calls `exclude_includes_with_member_for_base_for_root`, which strips any include whose base path falls inside a workspace member directory. That strip is correct when the member has its own competing `deploy` block, but it's over-eager for the common case where the member has no deploy block — the user explicitly asked for those files, and the strip leaves us with an empty include set and zero uploaded files. Patch in rs_lib: after calling `workspace_dir.to_deploy_config(pattern)`, re-read the raw `deploy.include` from whichever deno.json owns the `deploy` block (member preferred, root fallback) and re-append any entries that the upstream strip removed. Patterns are compared by their resolved `base_path()`, so we don't duplicate entries that genuinely survived the strip. Adds two regression tests in `rs_lib/src/lib.rs`: - Workspace-root deploy with `include: ["./packages/backend/**"]` — the glob case from the bug report. - Workspace-root deploy with `include: ["./packages/backend/main.ts"]` — the explicit-file case, which also verifies that adjacent files in the member directory are *not* picked up when not listed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Superseding the rs_lib workaround with an upstream fix. The root cause is in I've opened the proper fix upstream: denoland/deno#34788 — it stops Plan for this PR: once #34788 lands and a new |
Fixes #90.
Root cause
`deno_config` 0.97's `WorkspaceDirectory::to_deploy_config` calls `exclude_includes_with_member_for_base_for_root`, which strips any user-supplied `deploy.include` entry whose base path falls inside a workspace member directory. That strip is correct when the member has its own competing `deploy` block, but it's over-eager for the common case where the member has no deploy block: the user explicitly listed those paths, and the strip leaves the file collector with an empty include set and zero uploaded files. From the bug report, with this config:
```jsonc
{
"workspace": ["./packages/backend"],
"deploy": {
"org": "myorg",
"app": "myapp",
"include": ["./packages/backend/**"]
}
}
```
the resolver logs:
```
[rs_lib] deploy config: include=Some(PathOrPatternSet([])), exclude=PathOrPatternSet([])
[rs_lib] collect_files(...) -> 0 file(s): []
```
Fix
After calling `workspace_dir.to_deploy_config(pattern)`, re-read the raw `deploy.include` from whichever deno.json owns the `deploy` block (member preferred, root fallback) and re-append any entries that the upstream strip removed. Patterns are compared by their resolved `base_path()` so we don't duplicate entries that genuinely survived the strip.
If/when `deno_config` upstream learns to only strip when the member has its own deploy block, this patch can be dropped.
Test plan
Repro confirmation
The new tests fail before the patch (`expected .../main.ts in deploy files; got []`) and pass after.
🤖 Generated with Claude Code