Skip to content

Feature: Prevent transitive injection via an include_packages config property - #176

Merged
adrienneyager merged 8 commits into
mainfrom
feat/include_packages_property
May 14, 2026
Merged

adrienneyager merged 8 commits into
mainfrom
feat/include_packages_property

Conversation

@adrienneyager

@adrienneyager adrienneyager commented May 11, 2026 •

Copy link
Copy Markdown
Owner

Description and Motivations

Add an included_packages config property as an allowlist alternative to the existing excluded_packages denylist for filtering which packages nodes get injected from a referenced manifest.

In non-hierarchical dbt mesh configurations with bi-directional references, maintaining excluded_packages lists grows exponentially as projects are added. With 5+ projects referencing each other, every project must exclude all other packages that transitively appear through referenced manifests, leading to configuration that is error-prone and difficult to maintain.

included_packages flips the approach: instead of listing every package to block, you simply declare which package owns each manifest.

For example:

manifests:
  - name: project_b
    type: file
    config:
      path: ../project_b/target/manifest.json
    included_packages:
      - project_b  # Only import nodes owned by this project

Note that included_packages and excluded_packages are mutually exclusive. Specifying both raises a ValueError.

Changes

  • dbt_loom/config.py: Added included_packages field to ManifestReference with a model_validator enforcing mutual exclusivity with excluded_packages
  • dbt_loom/__init__.py: Extracted package filtering logic into a filter_models static method that handles both allowlist and denylist paths; updated node injection to use it
  • tests/test_manifest_references.py: New test file with 4 unit tests covering included_packages and excluded_packages filtering
  • docs/advanced-configuration.md: Documented the new included_packages property with usage example
  • README.md: Added "Include only specific packages" section mirroring the advanced config docs

Resolves: #172

MysticLavender added 8 commits May 10, 2026 22:06
Issue #172 requests an included_packages property to make it easier
to have an allowlist for which packages to enable any injected nodes
from. This commit adds the initial configuration value to our manifest
configuration, and creates the basic filtering method we will be using
as a starting point. Next steps are to add proper validation to the
ManifestReference model, unit tests, and documentation.
This makes sure that we don't have entries in both lists.
It wouldn't make sense for there to be values in both.
I was looking at <0 , which is never possible for the
lenth of a list.
Note that some are failing!
It's great that I actually wrote tests for this. lol.
@adrienneyager adrienneyager self-assigned this May 11, 2026
@adrienneyager adrienneyager added documentation Improvements or additions to documentation enhancement New feature or request labels May 11, 2026
@adrienneyager adrienneyager changed the title Featture: Prevent transitive injection via an include_packages config property Feature: Prevent transitive injection via an include_packages config property May 11, 2026
@adrienneyager
adrienneyager marked this pull request as ready for review May 11, 2026 13:39
@adrienneyager
adrienneyager merged commit bb64d67 into main May 14, 2026
3 checks passed
@adrienneyager
adrienneyager deleted the feat/include_packages_property branch May 14, 2026 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support included_packages config, as an alternative to excluded_packages

1 participant