Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add excluded_packages configuration to prevent specific nested packages from being injected #94

Merged
merged 4 commits into from
Nov 18, 2024

Conversation

nicholasyager
Copy link
Owner

Description and Motivation

In some circumstances, a user may want to prevent a package imported into an upstream project from being injected into a downstream project. One example of this is dbt_project_evaluator, which provides valuable test results about project health and architectural soundness. It's not uncommon for teams to import the dbt_project_evaluator package in all of their projects.

flowchart TB
    project_a --> project_b
    dbt_project_evaluator --> project_a
    dbt_project_evaluator --> project_b
Loading

Unfortunately, dbt-core's access control model is namespaced on project name and not lineage, so project_b will incidentally inject dbt_project_evaluator models from project_a despite the models being marked as protected.

To work around this issue, this PR adds an excluded_packages configuration in the ManifestReference to inform dbt-loom to exclude all resources from a specific upstream project that come from a given package.

For example, the follow configuration will exclude all dbt_project_evaluator resources from the revenue project, clearing the way for this downstream project's version of the package.

manifests:
  - name: revenue
    type: file
    config:
      path: ../revenue/target/manifest.json
    excluded_packages:
      - dbt_project_evaluator

Resolves: #93

@nicholasyager nicholasyager added the enhancement New feature or request label Nov 18, 2024
@nicholasyager nicholasyager self-assigned this Nov 18, 2024
@nicholasyager nicholasyager merged commit 2b420eb into main Nov 18, 2024
4 checks passed
@nicholasyager nicholasyager deleted the feature/handle_nested_packages branch November 18, 2024 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Omit models/configurations from upstream manifest
1 participant