1
0
mirror of synced 2025-12-19 10:00:34 -05:00

chore: add poe get-modified-connectors task (#59130)

This commit is contained in:
Aaron ("AJ") Steers
2025-04-29 18:11:25 -07:00
committed by GitHub
parent 17f2d5a09a
commit 422a73ad7d
3 changed files with 51 additions and 0 deletions

5
poe-tasks/README.md Normal file
View File

@@ -0,0 +1,5 @@
# Poe Tasks Directory
This directory stores scripts and task definitions that are intended to be executed from the PoeThePoet task manager.
You may be able to run them directly, although it is probably easier to run via `poe`.

View File

@@ -0,0 +1,41 @@
#!/usr/bin/env bash
# This script is used to find all modified connector directories in the Airbyte repository.
# It compares the current branch with the default branch and filters out files that match certain ignore patterns.
DEFAULT_BRANCH="master"
# 1) update remote default branch quietly
git fetch --quiet origin $DEFAULT_BRANCH
# 2) set up ignore patterns
ignore_patterns=(
'README.md'
'.coveragerc'
)
# join with | into a grouped regex
ignore_globs="($(IFS='|'; echo "${ignore_patterns[*]}"))$"
# 3) collect all file changes
committed=$(git diff --name-only origin/$DEFAULT_BRANCH...HEAD)
staged=$(git diff --cached --name-only)
unstaged=$(git diff --name-only)
untracked=$(git ls-files --others --exclude-standard)
# 4) merge into one list
all_changes=$(printf '%s\n%s\n%s\n%s' "$committed" "$staged" "$unstaged" "$untracked")
# 5) drop ignored files
filtered=$(printf '%s\n' "$all_changes" | grep -v -E "/${ignore_globs}")
# 6) keep only connector paths
connectors=$(printf '%s\n' "$filtered" | grep -E '^airbyte-integrations/connectors/[^/]+' )
# 7) extract just the connector directory name
dirs=$(printf '%s\n' "$connectors" \
| sed -E 's|airbyte-integrations/connectors/([^/]+).*|\1|'
)
# 8) output sorted, unique list
if [ "$dirs" ]; then
printf '%s\n' "$dirs" | sort -u
fi

View File

@@ -22,6 +22,11 @@ pnpm install
pnpm build
'''
[tasks.get-modified-connectors]
help = """List Airbyte connectors modified. This considers all committed, staged, unstaged, and untracked files.
"""
shell = "./poe-tasks/get-modified-connectors.sh"
[tasks.connector]
help = "Run a poe task in a connector's directory. Usage: poe connector <connector-name> <task> [args...]"