fix: add dag-folder input and fix root-folder path matching#143
Open
daneeesh wants to merge 4 commits intoastronomer:mainfrom
Open
fix: add dag-folder input and fix root-folder path matching#143daneeesh wants to merge 4 commits intoastronomer:mainfrom
daneeesh wants to merge 4 commits intoastronomer:mainfrom
Conversation
The deploy action's git diff change detection had two bugs: 1. root-folder values with "./" prefix (e.g., "./astro") never matched git diff paths because git omits the "./" prefix 2. Repos where DAGs live outside root-folder in version control (e.g., at "dags/" in the repo root, copied into root-folder at CI time) had their DAG changes silently ignored This adds a `dag-folder` input that specifies where DAGs live in the git repo for change detection purposes. Also normalizes root-folder by stripping "./" prefix and trailing "/" before matching, and switches from regex prefix matching to directory-exact matching to prevent false positives (e.g., "astro" no longer matches "astro-old/"). Fixes astronomer#103 Fixes astronomer#123 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Fixes two bugs in the git diff change detection logic that prevented users from upgrading past v0.4:
./prefix mismatch:root-folder: ./astronever matchedgit diffpaths because git omits the./prefix. Normalizesroot-folder(and the newdag-folder) by stripping./and trailing/before matching.root-folderin version control (e.g., atdags/in the repo root, copied intoroot-folderat CI time) had their DAG changes silently ignored. Adds a newdag-folderinput to specify where DAGs live in git for change detection.^"astro".*) to directory-exact matching ("$file" == "$ROOT_FOLDER"/*) soroot-folder: astrono longer falsely matchesastro-old/file.py. Applied consistently to root-folder, dag-folder, and DBT root-folder sections.Fixes #103
Fixes #123
Usage for non-standard repo structures
Test plan
dag-folder: dagscorrectly detectsdags/exampledag.pyas a DAG change and triggers DAG-only deploydag-folder: dagsdoes NOT matchdags-old/exampledag.py(negative test for prefix collision)dag-folderdefaults to empty)🤖 Generated with Claude Code