Skip to content

fix(config): don't strip workspace-member includes from deploy config - #34788

Merged
crowlKats merged 3 commits into
mainfrom
fix/deploy-config-root-include-member
Jun 25, 2026
Merged

crowlKats merged 3 commits into
mainfrom
fix/deploy-config-root-include-member

Conversation

@crowlbot

@crowlbot crowlbot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

When deno deploy is run from a Deno workspace root, a root-level deploy.include that points at a workspace member resolves to an empty include set, so the file collector uploads nothing.

Cause

WorkspaceDirectory::to_deploy_config ran exclude_includes_with_member_for_base_for_root — the member-include strip it shares with to_fmt_config / to_lint_config / to_test_config / to_bench_config / to_publish_config. That strip removes, from the root config, any include whose base path falls inside a workspace member, on the assumption that the member contributes its own files.

That assumption is correct for fmt/lint/test/bench/publish (which recurse into members and apply each member's own config), but wrong for deploy: deploy resolves a single application's file set from the workspace root and never recurses into per-member deploy configs. A root deploy.include such as ./packages/backend/** is an explicit instruction to ship those member files. Stripping it leaves deno deploy with nothing to upload.

Fix

Don't call the strip in to_deploy_config. This only affects the deploy-from-root-with-include case:

  • When discovering from a member directory, the strip already returns early (dir_url != root_dir), so removing it is a no-op there.
  • The existing deploy tests use no include, so the strip was already a no-op for them — they keep passing.

The function is still used by the other five config kinds, so there's no dead code.

Tests

Adds test_deploy_config_root_include_targeting_member_glob and test_deploy_config_root_include_targeting_member_file covering the previously-uncovered case (glob and explicit-file includes targeting a member).

Reported against the @deno/deploy CLI (denoland/deploy-cli#90), which depends on this crate to resolve deploy.include.

`to_deploy_config` ran `exclude_includes_with_member_for_base_for_root`, the
member-include strip shared with fmt/lint/test/bench/publish. For deploy that is
wrong: deploy resolves a single application's file set from the workspace root,
so a root `deploy.include` pointing at a workspace member (e.g.
`./packages/backend/**`) is an explicit instruction to ship those files. The
strip dropped them, leaving `deno deploy` from a workspace root with an empty
upload set. Remove the strip for deploy only and add regression tests.
@crowlKats
crowlKats merged commit 8025886 into main Jun 25, 2026
137 checks passed
@crowlKats
crowlKats deleted the fix/deploy-config-root-include-member branch June 25, 2026 21:57
piscisaureus added a commit to denoland/deploy-cli that referenced this pull request Jul 2, 2026
deno deploy from a workspace root whose deploy.include points at a
workspace member collected no member files (#90): deno_config < 0.102
stripped member-targeting includes from the deploy config in
to_deploy_config. Fixed upstream in denoland/deno#34788; bump
deno_config 0.97.0 -> 0.103.0 (no rs_lib API changes) and add
regression tests for glob and explicit-file member includes. The tests
fail on 0.97.0 and pass on 0.103.0; no workaround code needed.
piscisaureus pushed a commit to denoland/deploy-cli that referenced this pull request Jul 2, 2026
deno deploy from a workspace root whose deploy.include points at a
workspace member collected no member files (#90): deno_config < 0.102
stripped member-targeting includes from the deploy config. Fixed
upstream in denoland/deno#34788; bump deno_config 0.97.0 -> 0.103.0
(no rs_lib API changes) and add regression tests for glob and
explicit-file member includes. The tests fail on 0.97.0 and pass on
0.103.0; no workaround code needed.
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.

2 participants