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

What should happen when you add-contract to a private model? #85

Open
graciegoheen opened this issue Jun 27, 2023 · 3 comments
Open

What should happen when you add-contract to a private model? #85

graciegoheen opened this issue Jun 27, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@graciegoheen
Copy link
Collaborator

Describe the bug

Right now when I execute dbt-meshify operation add-contract -s 2__raw_vault (which included models that are previously marked as access:private), dbt-meshify does not update those models' access to public.

Should it?

Should there be a separate operation for updating access?

Thoughts?

@graciegoheen graciegoheen added bug Something isn't working triage Tis issue or pull request must be triaged by a project maintainer labels Jun 27, 2023
@dave-connors-3 dave-connors-3 added enhancement New feature or request and removed bug Something isn't working triage Tis issue or pull request must be triaged by a project maintainer labels Jun 27, 2023
@dave-connors-3
Copy link
Collaborator

it's a good question! i asked @jtcohen6 a similar one about the need to use model governance features in tandem:

image

since it's permissible in core to use each of these features separately from each other, I think I lean that the add-contract operation should do only that.

to your point, yes, it may make sense to have another command to explicitly set access levels! Access is currently the most "magical" feature of the package. I'm of the opinion that access makes the most sense in the context of group definitions or cross project refs, so i'm ok with the setup we have today where the graph dictates the access when declaring a group or splitting a project.

@graciegoheen
Copy link
Collaborator Author

I'm of the opinion that access makes the most sense in the context of group definitions or cross project refs, so i'm ok with the setup we have today where the graph dictates the access when declaring a group or splitting a project.

I disagree with you here!

I just did the following workflow:

  1. Ok, I know I want to create a new group for all of my models in my 1__stage, 2__raw_vault, and 3__business_vault folders. I execute: dbt-meshify group vault --owner-name "Trainer Logan" -s "1__stage 2__raw_vault 3__business_vault"
  2. Because I've only built out a few models that build on those "vault" models, some are marked as public and some are marked as private. But actually, I want all of my models in 2__raw_vault and 3__business_vault folders to be public so that anyone can access and use them. So I executed dbt-meshify operation add-contract -s "2__raw_vault 3__business_vault"
  3. But that just added contracts, it didn't update my access. So I had to go in and manually change the access config for all of the models in those folders.

I'm okay with not automatically updating access when you add a contract, but I do think we then need an operation to update access manually.

@nicholasyager
Copy link
Collaborator

I'm also of the opinion that access levels and contracted models are two orthogonal ideas. Access levels define the keys allowed to unlock a door, and the contract is the directory on the door promising what's inside. These two are useful together, but not a requirement whatsoever.

Having that been said, I'd agree 💯 that we should have a CLI operation for bespoke access level updates!

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

No branches or pull requests

3 participants