Skip to content

DCM Part 4: DCM Projects for Tasks companion#24

Merged
sfc-gh-yostrinsky merged 6 commits intomainfrom
dcm-projects-for-tasks
May 5, 2026
Merged

DCM Part 4: DCM Projects for Tasks companion#24
sfc-gh-yostrinsky merged 6 commits intomainfrom
dcm-projects-for-tasks

Conversation

@sfc-gh-yostrinsky
Copy link
Copy Markdown
Contributor

Companion repo for Part 4 (DCM Projects for Tasks).

Changes

  • Full DCM_Projects_Tasks DCM project (tasks, procedures, tables, expectations, infrastructure, functions)
  • DEFINE ALERT with STARTED target-state for failed-task monitoring (new file: sources/definitions/alerts.sql)
  • Post-deploy script with stream setup and demo execution
  • Pre-deploy and cleanup scripts

Note: `DEFINE ALERT ... STARTED` requires target-state support for alerts (landing post-10.15). All other definitions are ready to deploy today.

Guide: Snowflake-Labs/sfquickstarts#3210

.... Generated with Cortex Code

sfc-gh-yostrinsky and others added 4 commits April 22, 2026 10:50
DCM project with 15+ task graph (dependencies, return values, conditional
execution, retry, streams, finalizer email), quality-gate branch with
DMF expectations, procedures, and serverless alert scripts.

.... Generated with [Cortex Code](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code)

Co-Authored-By: Cortex Code <noreply@snowflake.com>
…and USING CONFIG

- Remove Python UDF, custom UDMF; use 3 system DMFs only
- Simplify finalizer to TEXT_PLAIN (no HTML dependency)
- TASK_9 now demos retries/failure behavior (calls PROCEDURE_2 only)
- Add OVERLAP_POLICY = NO_OVERLAP on root task
- Fully qualify INFORMATION_SCHEMA references with database name
- Add .gitignore for DCM plan output artifacts
- Remove unused alert_schedule template variable
- Scrub personal data from manifest and post_deploy script

.... Generated with [Cortex Code](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code)

Co-Authored-By: Cortex Code <noreply@snowflake.com>
- 01_pre_deploy: add GRANT EXECUTE MANAGED ALERT (required for serverless alerts)
- 02_post_deploy: add EXECUTE ALERT step, Replace comment on email placeholder

.... Generated with [Cortex Code](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code)

Co-Authored-By: Cortex Code <noreply@snowflake.com>
- Move failed-task alert into DCM as DEFINE ALERT with STARTED target-state
  (replaces post-deploy CREATE OR REPLACE ALERT + ALTER ALERT RESUME)
- Remove alert block from 02_post_deploy.sql; renumber remaining steps
- Replace manual DROP cleanup with EXECUTE DCM PROJECT PURGE
- Remove unused dcm_wh warehouse reference

Note: DEFINE ALERT ... STARTED requires target-state support for alerts, which
is landing post-10.15. The rest of the file is backward-compatible.

.... Generated with [Cortex Code](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code)

Co-Authored-By: Cortex Code <noreply@snowflake.com>
@sfc-gh-yostrinsky sfc-gh-yostrinsky changed the title Add Part 4: DCM Projects for Tasks companion DCM Part 4: DCM Projects for Tasks companion May 1, 2026
@sfc-gh-yostrinsky sfc-gh-yostrinsky marked this pull request as draft May 1, 2026 11:50
@@ -0,0 +1,33 @@
-- Serverless alert that monitors the task graph and emails on failures.
--
-- Defined as a DCM-managed alert with STARTED target-state, so it deploys
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not yet released

Copy link
Copy Markdown
Collaborator

@sfc-gh-jsommerfeld sfc-gh-jsommerfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will set up and run this later this week. but overall the structure looks good. I know this DAG has worked before - so I would not expect to fail now


DEFINE ALERT DCM_DEMO_4{{env_suffix}}.PIPELINE.FAILED_TASK_ALERT
SCHEDULE = '60 MINUTE'
STARTED
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. please remove for now and resume in post-script

)) AS t1,
LATERAL FLATTEN(input => PARSE_JSON(t1.REF_ARGUMENTS)) AS REF
WHERE SCHEDULE_STATUS = 'STARTED'
$$;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not run all of those yet. assuming they work - then good stuff :)

----------------------------------------------------------------------
-- 4. Create a Warehouse (optional — skip if you already have one)
----------------------------------------------------------------------
CREATE WAREHOUSE IF NOT EXISTS dcm_wh
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then we don't need this one either, right?

sfc-gh-yostrinsky and others added 2 commits May 5, 2026 14:47
Target-state for alerts is not yet supported. The alert is still fully
DCM-managed via DEFINE ALERT, but deploys suspended. scripts/02_post_deploy.sql
now runs ALTER ALERT ... RESUME once after deploy.

.... Generated with [Cortex Code](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code)

Co-Authored-By: Cortex Code <noreply@snowflake.com>
…_project_dev

.... Generated with [Cortex Code](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code)

Co-Authored-By: Cortex Code <noreply@snowflake.com>
@sfc-gh-yostrinsky sfc-gh-yostrinsky marked this pull request as ready for review May 5, 2026 20:27
@sfc-gh-yostrinsky sfc-gh-yostrinsky merged commit 5b6a4fe into main May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants