fix(rs_lib): restore stripped deploy.include for workspace-member paths#99
Open
crowlbot wants to merge 1 commit into
Open
fix(rs_lib): restore stripped deploy.include for workspace-member paths#99crowlbot wants to merge 1 commit into
crowlbot 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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