fix: wrap DCM project name in IDENTIFIER() for list/drop deployments#2997
Draft
sfc-gh-olorek wants to merge 1 commit into
Draft
fix: wrap DCM project name in IDENTIFIER() for list/drop deployments#2997sfc-gh-olorek wants to merge 1 commit into
sfc-gh-olorek wants to merge 1 commit into
Conversation
`snow dcm list-deployments` and `snow dcm drop-deployment` emitted
`SHOW DEPLOYMENTS IN DCM PROJECT <name>` and
`ALTER DCM PROJECT <name> DROP DEPLOYMENT` using the raw
`FQN.identifier` property, while every other DCM subcommand in
`DCMProjectManager` already wraps the name with `FQN.sql_identifier`
(i.e. `IDENTIFIER('<name>')`).
This inconsistency caused fully-qualified or case-sensitive project
names to parse incorrectly for exactly these two subcommands. Using
the same `sql_identifier` wrapping everywhere in the manager brings
the two stragglers in line with the remaining 8 call sites and with
the established pattern used in the apps/workspace plugins.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-review checklist
Changes description
DCMProjectManageremits SQL for 10 DCM subcommands, but the project-name identifier was being injected two different ways:FQN.sql_identifier, which wraps the name inIDENTIFIER('<name>'). This is the conventional pattern across the CLI (seeapps/manager.py'sALTER WORKSPACE {workspace_fqn.sql_identifier}call sites) and is the form used everywhere else in the DCM plugin:EXECUTE DCM PROJECT IDENTIFIER('<name>') DEPLOY/ANALYZE/PLAN/PREVIEW/REFRESH/PURGE/TEST, andCREATE DCM PROJECT IDENTIFIER('<name>').list_deploymentsanddrop_deployment— were still using the rawFQN.identifierproperty, emittingSHOW DEPLOYMENTS IN DCM PROJECT <name>andALTER DCM PROJECT <name> DROP DEPLOYMENT.That inconsistency meant these two subcommands did not normalize fully-qualified / case-sensitive project names through the same
IDENTIFIER(...)path that the rest of the manager (and the account-level session) relies on, producing different behaviour for the same FQN depending on whichsnow dcmsubcommand the user ran.This PR makes both call sites use
project_identifier.sql_identifier, matching the other 8 sites and the parser-supported form (SHOW ... IN DCM PROJECT IDENTIFIER(:PROJ_NAME),ALTER DCM PROJECT <id> DROP DEPLOYMENT).Testing
tests/dcm/test_manager.pyto assert on the newIDENTIFIER('my_project')wrapping.tests/dcm/) passes locally — 295 tests, 46 snapshots.