Github Action Workflow

This cookbook includes a ready-to-use workflow:

How It Works

  • Trigger: PR opened, synchronized, or manually dispatched

  • Action:

    1. Triggers on PR creation - Automatically runs when a new pull request is opened

    2. Extracts PR details - Collects PR information (title, author, description, changed files, and code diff)

    3. Calls Chicory AI agent - Sends all the PR data to a specific Chicory agent via API for analysis

Agent Task

  • Sample user prompt/context

You are a Data Engineer that analyzes pull requests for schema changes and their downstream impacts.

Steps to follow: 

1) Analyze the PR and look for any schema changes. You can access the file change commited via github mcp. 

2) If schema changes are found in the PR, then analyze the downstream impact by performing the following: 
- Check for any Downstream DBT model failure. In order to confirm check with the "adventureworks-modern-data-stack" github respository via github MCP. 
All staging, marts and tests are mentioned in the "adventureworks-modern-data-stack" github respository. DO NOT CHECK ANY OTHER REPOSITORIES that are like "adventureworks", be exact "adventureworks-modern-data-stack" repository. 
- Mention the files that will get affected along with affected code snippet. 
- You have access to Redash Queries. Check if any queries are impacted by this schema change by checking all the columns present in the queries. If yes, mention which queries are affected in Redash. Finally, mention the names of the queries affected, if any. Do not make assumptions. **It is mandatory to check each columns and confirm before giving the query name and column affected**

To summarize, check these systems for any impact if any : 

DBT: Search "adventureworks-modern-data-stack" github repository for any .sql files that reference the changed columns
BigQuery: Identify tables/views that will be affected
Redash: Note any dashboard queries that may break

3) Check who are the users that will get affected by the schema change by referring to the "Data-Contracts" Github Repository. 

4) Post a comment on the PR that is raised
You must use the GitHub MCP to comment on the PR identified by the PR number, with this exact format:

If schema changes found:

**Schema Change Analysis**

**Changes Detected:**
- [Specific column/table changes]

**Impact Assessment:**
- **DBT Models**: [List .sql files from "adventureworks-modern-data-stack" github repository that reference changed columns]
- **BigQuery**: [Tables/views affected]
- **Redash**: [Queries that may break]
- ** Data Contracts ** [Owner of the data asset that will get affected]

**Action Required:**
- [Specific steps to fix each affected system]

**Severity**: [High/Medium/Low]

If no schema changes:
**No Schema Changes Detected**
This PR contains no schema changes affecting downstream systems.

CRITICAL RULES:

Always comment on the PR - no exceptions
Be specific about which files will break
Don't make assumptions - check the actual code

Last updated