-
Notifications
You must be signed in to change notification settings - Fork 4
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
[SNOW-90] Introduce CI job to test schemachange
updates against a clone
#78
base: dev
Are you sure you want to change the base?
Conversation
Hey all, just keeping you in the loop with this Snowflake devops stuff: As I was working on testing an edge case for this PR, I realized there's an issue with using different roles for each step in the CI/CD pipeline. This is how it's working right now:
So while I'm in DATA_ENGINEER, I can see my cloned DB, but I cannot see my dummy table that I made to test out the R scripts because it was made with SYSADMIN. @thomasyu888, would it be possible for you to make a separate role for CI/CD work instead of the pipeline using DATA_ENGINEER and SYSADMIN for the two separate steps? This role would:
A related question: cc @philerooski |
Admittedly the roles and grants the database is a bit all over the place... I did manage to do a ROLE cleaning and moved everything so that SYSADMIN role is granted access to all the roles. BUT... one way to do this is to create that CICD role specifically and give it OWNERSHIP of all the tables, and have that role roll up into DATA_ENGINEER. The CI/CD role can then only be assumed by a service account. (That said, that may be splitting hairs because if the CI/CD role rolls up into DATA_ENGINEER, then DATA_ENGINEER will have all the permissions that that CI/CD role has) I'll let @philerooski ultimately decide, but if there's other snowflake work to be done, we can follow the process that exists now until we can thoughtfully implement this all the way. |
Snowflake has a suggested framework for organizing roles which we will adopt at some point in the near future. As far as Snowflake objects are concerned,
To the point -- whichever role we use for CI/CD, it ought to have privileges on every object in the dev Synapse data warehouse database. This might be |
@philerooski just a note here - I did that role refactor based off of your learnings a little bit ago - and it is a lot cleaner. Furthermore, the roles organization will be complicated by the jumpcloud integration, but that's out of scope for this PR. Some questions
I do like your idea of having a CLONED_DB_DATABASE_ROLE, but then that still doesn't resolve the fact that schemachange runs as SYSADMIN right now |
Yes, as a temporary solution, I can implement suggestions 3 and 2 so we can use |
Should the ticket be closed or modified, then?
What is it about dynamic tables specifically that requires this statement? Do we need FUTURE grants for other types of objects? My main concern with the proposed workaround is that |
I agree with this. I don't think we should permanently grant the engineer role SYSADMIN privileges. A heads up: I'm fiddling around with a temporary solution for this until the role re-org. My commits will show me granting privileges to DPE_ENGINEER, but I'm being mindful that these privileges will only exist within the scope of the cloned DB, and not within the actual dev and prod databases. |
Quality Gate passedIssues Measures |
@philerooski / @jaymedina , I think there should be another ticket to fully determine whether the DATA_ENGINEER role should just be the OWNER of Similarly, since the ^ That said, I'm not tied to that, and I'll let Phil decide when we get to that design ticket. |
problem
Rather than have it be a manual process, automating the testing of
schemachange
updates in our branch before merging it intodev
will speed up the development life cycle. A design document was made to tackle this problem and is available here.solution
test_with_clone
, to trigger the automated process of zero-copy cloningsynapse_data_warehouse_dev
and testing new/modified schemachange scripts against ittesting
create_clone_and_run_schemachange
triggers the CI job to rundev
db and not theprod
dbdrop_clone
to runcreate_clone_and_run_schemachange
to runcreate_clone_and_run_schemachange
does not trigger the CI job to run