From e125bb0e4b9a500ba5825829fef5d79f487c62d8 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 01:28:39 +0000 Subject: [PATCH 01/16] feat: Add Autodoc workflow for community connector documentation updates - Triggers when PRs are merged to master - Checks for community connector metadata.yaml files - Uses Devin Action to automatically update documentation - Skips execution for non-community connectors or forks - Includes proper security measures with pinned action versions Co-Authored-By: ian.alton@airbyte.io --- .github/workflows/autodoc.yml | 82 +++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/autodoc.yml diff --git a/.github/workflows/autodoc.yml b/.github/workflows/autodoc.yml new file mode 100644 index 000000000000..166c3ea805ef --- /dev/null +++ b/.github/workflows/autodoc.yml @@ -0,0 +1,82 @@ +name: Autodoc + +on: + pull_request: + types: [closed] + branches: + - master + +jobs: + write-documentation: + runs-on: ubuntu-latest + if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.full_name == github.repository + steps: + # Checkout code + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + # Get the list of files changed in the PR + - name: Get files in this PR + id: pr-files + continue-on-error: false + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + FILES=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | \ + jq -r '[.[].filename] | @json') + if [ -z "$FILES" ]; then + echo "Error: Failed to fetch or parse PR files." + exit 1 + fi + echo "files=$FILES" >> $GITHUB_OUTPUT + + # Install yq for yaml file parsing + - name: Install yq + id: install-yq + run: sudo apt-get update && sudo apt-get install -y yq + + # Check if the PR contains a metadata.yaml file and if the connector is community supported + - name: Check for Community support level + id: check-support-level + continue-on-error: false + run: | + # Find metadata.yaml in any folder + METADATA_FILE=$(find . -path "*/airbyte-integrations/connectors/*/metadata.yaml" | head -n 1) + if [ -z "$METADATA_FILE" ]; then + echo "No metadata.yaml file found in the connector directories." + echo "metadata_file=false" >> $GITHUB_OUTPUT + exit 0 + fi + # Check the supportLevel in metadata.yaml + SUPPORT_LEVEL=$(yq '.data.supportLevel' "$METADATA_FILE") + if [ "$SUPPORT_LEVEL" != "community" ]; then + echo "This PR does not contain a Community/Marketplace connector." + echo "community_support=false" >> $GITHUB_OUTPUT + exit 0 + fi + echo "metadata_file=true" >> $GITHUB_OUTPUT + echo "community_support=true" >> $GITHUB_OUTPUT + echo "Metadata file found: $METADATA_FILE" + echo "Support level: $SUPPORT_LEVEL" + + # If this isn't a community connector, skip the doc update + - name: Skip doc update + id: skip-doc-update + if: steps.check-support-level.outputs.metadata_file == 'false' || steps.check-support-level.outputs.community_support == 'false' + run: echo "Skipping docs update because this connector is not community supported or is missing metadata file." + + # Use Devin Action to start documentation update session + - name: Start Devin documentation session + if: steps.check-support-level.outputs.metadata_file == 'true' && steps.check-support-level.outputs.community_support == 'true' + uses: aaronsteers/devin-action@v0.1.5 + with: + devin-token: ${{ secrets.DEVIN_AI_API_KEY }} + github-token: ${{ secrets.GITHUB_TOKEN }} + playbook-macro: "!connectordocs" + prompt-text: "The pull request you are working with is: ${{ github.event.pull_request.number }}" + tags: | + area/documentation + team/documentation From 5a6c2e97fe80b64286910ed325b1a9ff4fc7e462 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 01:30:37 +0000 Subject: [PATCH 02/16] security: Pin Devin Action to specific commit hash - Pin aaronsteers/devin-action to commit 0d74d6d9ff1b16ada5966dc31af53a9d155759f4 (v0.1.5) - Improves security by preventing potential supply chain attacks - Follows GitHub Actions security best practices for marketplace actions Co-Authored-By: ian.alton@airbyte.io --- .github/workflows/autodoc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autodoc.yml b/.github/workflows/autodoc.yml index 166c3ea805ef..a751f6583144 100644 --- a/.github/workflows/autodoc.yml +++ b/.github/workflows/autodoc.yml @@ -71,7 +71,7 @@ jobs: # Use Devin Action to start documentation update session - name: Start Devin documentation session if: steps.check-support-level.outputs.metadata_file == 'true' && steps.check-support-level.outputs.community_support == 'true' - uses: aaronsteers/devin-action@v0.1.5 + uses: aaronsteers/devin-action@0d74d6d9ff1b16ada5966dc31af53a9d155759f4 with: devin-token: ${{ secrets.DEVIN_AI_API_KEY }} github-token: ${{ secrets.GITHUB_TOKEN }} From 54649180511e534f895c65bc131b8026a1026403 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 01:36:52 +0000 Subject: [PATCH 03/16] feat: Filter out bot-authored PRs from autodoc workflow - Exclude PRs authored by airbyteio, octavia-bot, octavia-bot-hoard - Exclude github-actions[bot] and dependabot[bot] - Exclude any accounts ending with [bot] suffix - Ensures only human and Devin contributions trigger documentation updates - Prevents automated processes from generating unnecessary doc PRs Co-Authored-By: ian.alton@airbyte.io --- .github/workflows/autodoc.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/autodoc.yml b/.github/workflows/autodoc.yml index a751f6583144..868a05cd448e 100644 --- a/.github/workflows/autodoc.yml +++ b/.github/workflows/autodoc.yml @@ -9,7 +9,11 @@ on: jobs: write-documentation: runs-on: ubuntu-latest - if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.full_name == github.repository + if: | + github.event.pull_request.merged == true && + github.event.pull_request.head.repo.full_name == github.repository && + !contains(fromJSON('["airbyteio", "octavia-bot", "octavia-bot-hoard", "github-actions[bot]", "dependabot[bot]"]'), github.event.pull_request.user.login) && + !endsWith(github.event.pull_request.user.login, '[bot]') steps: # Checkout code - name: Checkout code From 688bfb35f92f8daf8ada3155d0c418a743c9d979 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 01:45:14 +0000 Subject: [PATCH 04/16] improve: Enhance Autodoc workflow readability and user experience - Add comprehensive workflow documentation header explaining purpose and triggers - Rename job from 'write-documentation' to 'update-connector-documentation' for clarity - Add descriptive step names with numbered sequence (Step 1-6) - Include informative echo statements with emojis for better debugging visibility - Add inline comments explaining each step's purpose and logic - Improve conditional step messaging to explain why actions are skipped - Maintain all existing functionality while significantly improving human readability Co-Authored-By: ian.alton@airbyte.io --- .github/workflows/autodoc.yml | 86 +++++++++++++++++++++++------------ 1 file changed, 57 insertions(+), 29 deletions(-) diff --git a/.github/workflows/autodoc.yml b/.github/workflows/autodoc.yml index 868a05cd448e..0c8c74cc6012 100644 --- a/.github/workflows/autodoc.yml +++ b/.github/workflows/autodoc.yml @@ -1,3 +1,14 @@ +# Autodoc Workflow +# +# This workflow automatically triggers documentation updates for community-supported connectors +# when pull requests are merged to master. It uses Devin AI to review connector changes and +# update the corresponding user documentation to ensure it stays current with code changes. +# +# Workflow triggers: +# - Only on merged PRs to master branch +# - Excludes bot-authored PRs to prevent automation loops +# - Only processes community-supported connectors + name: Autodoc on: @@ -7,79 +18,96 @@ on: - master jobs: - write-documentation: + update-connector-documentation: + name: Update connector documentation with AI runs-on: ubuntu-latest + # Only run for merged PRs from the same repo (not forks) and exclude bot authors if: | github.event.pull_request.merged == true && github.event.pull_request.head.repo.full_name == github.repository && !contains(fromJSON('["airbyteio", "octavia-bot", "octavia-bot-hoard", "github-actions[bot]", "dependabot[bot]"]'), github.event.pull_request.user.login) && !endsWith(github.event.pull_request.user.login, '[bot]') + steps: - # Checkout code - - name: Checkout code + # Step 1: Get the merged PR code + - name: Checkout merged PR code uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 0 # Full history needed for comprehensive analysis - # Get the list of files changed in the PR - - name: Get files in this PR + # Step 2: Analyze what files were changed in this PR + - name: Fetch list of changed files from PR id: pr-files - continue-on-error: false env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + echo "🔍 Fetching files changed in PR #${{ github.event.pull_request.number }}..." FILES=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | \ jq -r '[.[].filename] | @json') + if [ -z "$FILES" ]; then - echo "Error: Failed to fetch or parse PR files." + echo "❌ Error: Failed to fetch or parse PR files." exit 1 fi + + echo "✅ Successfully fetched changed files list" echo "files=$FILES" >> $GITHUB_OUTPUT - # Install yq for yaml file parsing - - name: Install yq - id: install-yq - run: sudo apt-get update && sudo apt-get install -y yq + # Step 3: Install YAML parsing tool + - name: Install YAML parser (yq) + run: | + echo "đŸ“Ļ Installing yq for metadata.yaml parsing..." + sudo apt-get update && sudo apt-get install -y yq + echo "✅ yq installed successfully" - # Check if the PR contains a metadata.yaml file and if the connector is community supported - - name: Check for Community support level + # Step 4: Determine if this PR affects a community-supported connector + - name: Determine if connector is community-supported id: check-support-level - continue-on-error: false run: | - # Find metadata.yaml in any folder + echo "🔍 Checking if PR contains community-supported connector changes..." + + # Look for connector metadata files in the standard location METADATA_FILE=$(find . -path "*/airbyte-integrations/connectors/*/metadata.yaml" | head -n 1) + if [ -z "$METADATA_FILE" ]; then - echo "No metadata.yaml file found in the connector directories." + echo "â„šī¸ No connector metadata.yaml file found - this PR doesn't affect connectors" echo "metadata_file=false" >> $GITHUB_OUTPUT exit 0 fi - # Check the supportLevel in metadata.yaml + + # Parse the support level from the metadata SUPPORT_LEVEL=$(yq '.data.supportLevel' "$METADATA_FILE") + echo "📋 Found metadata file: $METADATA_FILE" + echo "📋 Support level: $SUPPORT_LEVEL" + if [ "$SUPPORT_LEVEL" != "community" ]; then - echo "This PR does not contain a Community/Marketplace connector." + echo "â„šī¸ This connector is not community-supported (level: $SUPPORT_LEVEL)" echo "community_support=false" >> $GITHUB_OUTPUT exit 0 fi + + echo "✅ Community-supported connector detected - documentation update needed" echo "metadata_file=true" >> $GITHUB_OUTPUT echo "community_support=true" >> $GITHUB_OUTPUT - echo "Metadata file found: $METADATA_FILE" - echo "Support level: $SUPPORT_LEVEL" - # If this isn't a community connector, skip the doc update - - name: Skip doc update - id: skip-doc-update + # Step 5: Skip documentation update for non-community connectors + - name: Skip documentation update (not community connector) if: steps.check-support-level.outputs.metadata_file == 'false' || steps.check-support-level.outputs.community_support == 'false' - run: echo "Skipping docs update because this connector is not community supported or is missing metadata file." + run: | + echo "â­ī¸ Skipping documentation update:" + echo " - Metadata file found: ${{ steps.check-support-level.outputs.metadata_file }}" + echo " - Community support: ${{ steps.check-support-level.outputs.community_support }}" + echo " - Only community-supported connectors trigger automatic documentation updates" - # Use Devin Action to start documentation update session - - name: Start Devin documentation session + # Step 6: Trigger AI documentation update for community connectors + - name: Start AI documentation update session if: steps.check-support-level.outputs.metadata_file == 'true' && steps.check-support-level.outputs.community_support == 'true' - uses: aaronsteers/devin-action@0d74d6d9ff1b16ada5966dc31af53a9d155759f4 + uses: aaronsteers/devin-action@0d74d6d9ff1b16ada5966dc31af53a9d155759f4 # Pinned to specific commit for security with: devin-token: ${{ secrets.DEVIN_AI_API_KEY }} github-token: ${{ secrets.GITHUB_TOKEN }} - playbook-macro: "!connectordocs" + playbook-macro: "!connectordocs" # Use the connector documentation playbook prompt-text: "The pull request you are working with is: ${{ github.event.pull_request.number }}" tags: | area/documentation From b62421826da622c1ad3961294355d1c014087f42 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 01:49:50 +0000 Subject: [PATCH 05/16] fix: Apply prettier formatting to resolve Format Check CI failure - Remove trailing whitespace and fix comment spacing - Standardize inline comment formatting (single space before #) - Fix empty line formatting in shell script blocks - Preserve all human-friendly improvements while meeting format standards Co-Authored-By: ian.alton@airbyte.io --- .github/workflows/autodoc.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/autodoc.yml b/.github/workflows/autodoc.yml index 0c8c74cc6012..182af4d9216d 100644 --- a/.github/workflows/autodoc.yml +++ b/.github/workflows/autodoc.yml @@ -1,5 +1,5 @@ # Autodoc Workflow -# +# # This workflow automatically triggers documentation updates for community-supported connectors # when pull requests are merged to master. It uses Devin AI to review connector changes and # update the corresponding user documentation to ensure it stays current with code changes. @@ -27,13 +27,13 @@ jobs: github.event.pull_request.head.repo.full_name == github.repository && !contains(fromJSON('["airbyteio", "octavia-bot", "octavia-bot-hoard", "github-actions[bot]", "dependabot[bot]"]'), github.event.pull_request.user.login) && !endsWith(github.event.pull_request.user.login, '[bot]') - + steps: # Step 1: Get the merged PR code - name: Checkout merged PR code uses: actions/checkout@v4 with: - fetch-depth: 0 # Full history needed for comprehensive analysis + fetch-depth: 0 # Full history needed for comprehensive analysis # Step 2: Analyze what files were changed in this PR - name: Fetch list of changed files from PR @@ -45,12 +45,12 @@ jobs: FILES=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | \ jq -r '[.[].filename] | @json') - + if [ -z "$FILES" ]; then echo "❌ Error: Failed to fetch or parse PR files." exit 1 fi - + echo "✅ Successfully fetched changed files list" echo "files=$FILES" >> $GITHUB_OUTPUT @@ -66,27 +66,27 @@ jobs: id: check-support-level run: | echo "🔍 Checking if PR contains community-supported connector changes..." - + # Look for connector metadata files in the standard location METADATA_FILE=$(find . -path "*/airbyte-integrations/connectors/*/metadata.yaml" | head -n 1) - + if [ -z "$METADATA_FILE" ]; then echo "â„šī¸ No connector metadata.yaml file found - this PR doesn't affect connectors" echo "metadata_file=false" >> $GITHUB_OUTPUT exit 0 fi - + # Parse the support level from the metadata SUPPORT_LEVEL=$(yq '.data.supportLevel' "$METADATA_FILE") echo "📋 Found metadata file: $METADATA_FILE" echo "📋 Support level: $SUPPORT_LEVEL" - + if [ "$SUPPORT_LEVEL" != "community" ]; then echo "â„šī¸ This connector is not community-supported (level: $SUPPORT_LEVEL)" echo "community_support=false" >> $GITHUB_OUTPUT exit 0 fi - + echo "✅ Community-supported connector detected - documentation update needed" echo "metadata_file=true" >> $GITHUB_OUTPUT echo "community_support=true" >> $GITHUB_OUTPUT @@ -103,11 +103,11 @@ jobs: # Step 6: Trigger AI documentation update for community connectors - name: Start AI documentation update session if: steps.check-support-level.outputs.metadata_file == 'true' && steps.check-support-level.outputs.community_support == 'true' - uses: aaronsteers/devin-action@0d74d6d9ff1b16ada5966dc31af53a9d155759f4 # Pinned to specific commit for security + uses: aaronsteers/devin-action@0d74d6d9ff1b16ada5966dc31af53a9d155759f4 # Pinned to specific commit for security with: devin-token: ${{ secrets.DEVIN_AI_API_KEY }} github-token: ${{ secrets.GITHUB_TOKEN }} - playbook-macro: "!connectordocs" # Use the connector documentation playbook + playbook-macro: "!connectordocs" # Use the connector documentation playbook prompt-text: "The pull request you are working with is: ${{ github.event.pull_request.number }}" tags: | area/documentation From 01a621d628aa0134b1c160d23828ad394b96b72b Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 01:54:55 +0000 Subject: [PATCH 06/16] security: Pin actions/checkout to specific commit hash - Pin actions/checkout@v4 to commit 08eba0b27e820071cde6df949e0beb9ba4906955 - Addresses security feedback from ian-at-airbyte on PR #66556 - Ensures both Devin Action and checkout action use commit hashes for security Co-Authored-By: ian.alton@airbyte.io --- .github/workflows/autodoc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autodoc.yml b/.github/workflows/autodoc.yml index 182af4d9216d..c976b97559fb 100644 --- a/.github/workflows/autodoc.yml +++ b/.github/workflows/autodoc.yml @@ -31,7 +31,7 @@ jobs: steps: # Step 1: Get the merged PR code - name: Checkout merged PR code - uses: actions/checkout@v4 + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 with: fetch-depth: 0 # Full history needed for comprehensive analysis From 6b435eb167c8a00f0a823f60f55b2a17b0c2f8f5 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 02:00:57 +0000 Subject: [PATCH 07/16] fix: Use compound variable for prompt-text in Devin Action - Create PROMPT_TEXT environment variable combining text and PR number - Use env.PROMPT_TEXT instead of direct string interpolation - Addresses GitHub comment from ian-at-airbyte about proper variable evaluation - Ensures GitHub expression is evaluated correctly rather than passed as literal string Co-Authored-By: ian.alton@airbyte.io --- .github/workflows/autodoc.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/autodoc.yml b/.github/workflows/autodoc.yml index c976b97559fb..a76cb35b49fb 100644 --- a/.github/workflows/autodoc.yml +++ b/.github/workflows/autodoc.yml @@ -103,12 +103,14 @@ jobs: # Step 6: Trigger AI documentation update for community connectors - name: Start AI documentation update session if: steps.check-support-level.outputs.metadata_file == 'true' && steps.check-support-level.outputs.community_support == 'true' + env: + PROMPT_TEXT: "The pull request to review is ${{ github.event.pull_request.number }}" uses: aaronsteers/devin-action@0d74d6d9ff1b16ada5966dc31af53a9d155759f4 # Pinned to specific commit for security with: devin-token: ${{ secrets.DEVIN_AI_API_KEY }} github-token: ${{ secrets.GITHUB_TOKEN }} playbook-macro: "!connectordocs" # Use the connector documentation playbook - prompt-text: "The pull request you are working with is: ${{ github.event.pull_request.number }}" + prompt-text: ${{ env.PROMPT_TEXT }} tags: | area/documentation team/documentation From 639ac1c1e1065cbce8b94fac4ff9a01cef0b3665 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 17:10:21 +0000 Subject: [PATCH 08/16] fix: Use official yq installation method via wget - Replace failing apt-get installation with wget from GitHub releases - Pin yq to v4.47.2 for security and reproducibility - Addresses GitHub comment from ian-at-airbyte about Ubuntu compatibility - Verified syntax compatibility with metadata.yaml parsing Co-Authored-By: ian.alton@airbyte.io --- .github/workflows/autodoc.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/autodoc.yml b/.github/workflows/autodoc.yml index a76cb35b49fb..93555e17d02f 100644 --- a/.github/workflows/autodoc.yml +++ b/.github/workflows/autodoc.yml @@ -58,8 +58,9 @@ jobs: - name: Install YAML parser (yq) run: | echo "đŸ“Ļ Installing yq for metadata.yaml parsing..." - sudo apt-get update && sudo apt-get install -y yq - echo "✅ yq installed successfully" + sudo wget https://github.com/mikefarah/yq/releases/download/v4.47.2/yq_linux_amd64 -O /usr/local/bin/yq + sudo chmod +x /usr/local/bin/yq + echo "✅ yq v4.47.2 installed successfully" # Step 4: Determine if this PR affects a community-supported connector - name: Determine if connector is community-supported From 0c2d81e1a18fa58415712656f341cbe66cfea7b5 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 17:27:50 +0000 Subject: [PATCH 09/16] fix: Add defensive programming improvements to workflow logic - Add community_support=false output when no metadata file found - Add exit 0 to skip step to prevent proceeding to Devin Action - Addresses GitHub feedback from ian-at-airbyte for better workflow robustness Co-Authored-By: ian.alton@airbyte.io --- .github/workflows/autodoc.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/autodoc.yml b/.github/workflows/autodoc.yml index 93555e17d02f..9d8a06645a76 100644 --- a/.github/workflows/autodoc.yml +++ b/.github/workflows/autodoc.yml @@ -74,6 +74,7 @@ jobs: if [ -z "$METADATA_FILE" ]; then echo "â„šī¸ No connector metadata.yaml file found - this PR doesn't affect connectors" echo "metadata_file=false" >> $GITHUB_OUTPUT + echo "community_support=false" >> $GITHUB_OUTPUT exit 0 fi @@ -100,6 +101,7 @@ jobs: echo " - Metadata file found: ${{ steps.check-support-level.outputs.metadata_file }}" echo " - Community support: ${{ steps.check-support-level.outputs.community_support }}" echo " - Only community-supported connectors trigger automatic documentation updates" + exit 0 # Step 6: Trigger AI documentation update for community connectors - name: Start AI documentation update session From b1037a51db34fc938f263ca930adf5471b7d23d7 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 17:39:47 +0000 Subject: [PATCH 10/16] fix: Set metadata_file=true when metadata exists but isn't community - Add metadata_file=true output when metadata file found but support level != community - Ensures consistent variable state for downstream workflow logic evaluation - Addresses final GitHub feedback from ian-at-airbyte for complete defensive programming Co-Authored-By: ian.alton@airbyte.io --- .github/workflows/autodoc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/autodoc.yml b/.github/workflows/autodoc.yml index 9d8a06645a76..0b2450fc00b6 100644 --- a/.github/workflows/autodoc.yml +++ b/.github/workflows/autodoc.yml @@ -85,6 +85,7 @@ jobs: if [ "$SUPPORT_LEVEL" != "community" ]; then echo "â„šī¸ This connector is not community-supported (level: $SUPPORT_LEVEL)" + echo "metadata_file=true" >> $GITHUB_OUTPUT echo "community_support=false" >> $GITHUB_OUTPUT exit 0 fi From 4329e2f87daf5d6871a7eb178eef18e2a43c2db0 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 17:43:09 +0000 Subject: [PATCH 11/16] cleanup: Remove redundant exit 0 from skip step - GitHub Actions steps exit with 0 by default - Addresses GitHub feedback from ian-at-airbyte for cleaner workflow code - No functional change, just removes unnecessary explicit exit Co-Authored-By: ian.alton@airbyte.io --- .github/workflows/autodoc.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/autodoc.yml b/.github/workflows/autodoc.yml index 0b2450fc00b6..a109238e0ad5 100644 --- a/.github/workflows/autodoc.yml +++ b/.github/workflows/autodoc.yml @@ -102,7 +102,6 @@ jobs: echo " - Metadata file found: ${{ steps.check-support-level.outputs.metadata_file }}" echo " - Community support: ${{ steps.check-support-level.outputs.community_support }}" echo " - Only community-supported connectors trigger automatic documentation updates" - exit 0 # Step 6: Trigger AI documentation update for community connectors - name: Start AI documentation update session From 0bcd823ddd7ed45bc425cd77b01633ba32f1f81a Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 25 Sep 2025 21:13:46 +0000 Subject: [PATCH 12/16] fix: Allow workflow to run for merged PRs from forks - Remove fork restriction condition from workflow trigger - Now runs for any successfully merged PR to master, regardless of origin - Addresses GitHub feedback from ian-at-airbyte about fork compatibility - Maintains bot filtering and other security measures Co-Authored-By: ian.alton@airbyte.io --- .github/workflows/autodoc.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/autodoc.yml b/.github/workflows/autodoc.yml index a109238e0ad5..be680083850f 100644 --- a/.github/workflows/autodoc.yml +++ b/.github/workflows/autodoc.yml @@ -21,10 +21,9 @@ jobs: update-connector-documentation: name: Update connector documentation with AI runs-on: ubuntu-latest - # Only run for merged PRs from the same repo (not forks) and exclude bot authors + # Only run for merged PRs and exclude bot authors if: | github.event.pull_request.merged == true && - github.event.pull_request.head.repo.full_name == github.repository && !contains(fromJSON('["airbyteio", "octavia-bot", "octavia-bot-hoard", "github-actions[bot]", "dependabot[bot]"]'), github.event.pull_request.user.login) && !endsWith(github.event.pull_request.user.login, '[bot]') From 80717f8ad850da8e0e11a33f5692f56e67eceeb0 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 26 Sep 2025 23:45:00 +0000 Subject: [PATCH 13/16] feat: Switch Autodoc workflow trigger from pull_request to push - Change trigger from pull_request: [closed] to push: branches: [master] - Update bot filtering from github.event.pull_request.user.login to github.actor - Replace GitHub API file change detection with git diff HEAD~1 HEAD --name-only - Update Devin context from PR number to commit SHA - Update comments and step names to reflect push-based approach Addresses feedback from @aaronsteers and @ian-at-airbyte to simplify workflow logic and remove dependency on pull request context while maintaining core functionality. Co-Authored-By: ian.alton@airbyte.io --- .github/workflows/autodoc.yml | 50 +++++++++++++++-------------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/.github/workflows/autodoc.yml b/.github/workflows/autodoc.yml index be680083850f..6148ca4a5272 100644 --- a/.github/workflows/autodoc.yml +++ b/.github/workflows/autodoc.yml @@ -1,19 +1,18 @@ # Autodoc Workflow # # This workflow automatically triggers documentation updates for community-supported connectors -# when pull requests are merged to master. It uses Devin AI to review connector changes and +# when changes are pushed to master. It uses Devin AI to review connector changes and # update the corresponding user documentation to ensure it stays current with code changes. # # Workflow triggers: -# - Only on merged PRs to master branch -# - Excludes bot-authored PRs to prevent automation loops +# - Only on pushes to master branch +# - Excludes bot-authored pushes to prevent automation loops # - Only processes community-supported connectors name: Autodoc on: - pull_request: - types: [closed] + push: branches: - master @@ -21,35 +20,30 @@ jobs: update-connector-documentation: name: Update connector documentation with AI runs-on: ubuntu-latest - # Only run for merged PRs and exclude bot authors + # Only run for human authors, exclude bot accounts if: | - github.event.pull_request.merged == true && - !contains(fromJSON('["airbyteio", "octavia-bot", "octavia-bot-hoard", "github-actions[bot]", "dependabot[bot]"]'), github.event.pull_request.user.login) && - !endsWith(github.event.pull_request.user.login, '[bot]') + !contains(fromJSON('["airbyteio", "octavia-bot", "octavia-bot-hoard", "github-actions[bot]", "dependabot[bot]"]'), github.actor) && + !endsWith(github.actor, '[bot]') steps: - # Step 1: Get the merged PR code - - name: Checkout merged PR code + # Step 1: Get the pushed code + - name: Checkout pushed code uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 with: fetch-depth: 0 # Full history needed for comprehensive analysis - # Step 2: Analyze what files were changed in this PR - - name: Fetch list of changed files from PR - id: pr-files - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Step 2: Analyze what files were changed in this push + - name: Get files changed in this push + id: push-files run: | - echo "🔍 Fetching files changed in PR #${{ github.event.pull_request.number }}..." - FILES=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | \ - jq -r '[.[].filename] | @json') - - if [ -z "$FILES" ]; then - echo "❌ Error: Failed to fetch or parse PR files." + echo "🔍 Fetching files changed in commit ${{ github.sha }}..." + FILES=$(git diff HEAD~1 HEAD --name-only | jq -R -s -c 'split("\n")[:-1]') + + if [ -z "$FILES" ] || [ "$FILES" = "[]" ]; then + echo "❌ Error: No files changed in this push." exit 1 fi - + echo "✅ Successfully fetched changed files list" echo "files=$FILES" >> $GITHUB_OUTPUT @@ -61,17 +55,17 @@ jobs: sudo chmod +x /usr/local/bin/yq echo "✅ yq v4.47.2 installed successfully" - # Step 4: Determine if this PR affects a community-supported connector + # Step 4: Determine if this push affects a community-supported connector - name: Determine if connector is community-supported id: check-support-level run: | - echo "🔍 Checking if PR contains community-supported connector changes..." + echo "🔍 Checking if push contains community-supported connector changes..." # Look for connector metadata files in the standard location METADATA_FILE=$(find . -path "*/airbyte-integrations/connectors/*/metadata.yaml" | head -n 1) if [ -z "$METADATA_FILE" ]; then - echo "â„šī¸ No connector metadata.yaml file found - this PR doesn't affect connectors" + echo "â„šī¸ No connector metadata.yaml file found - this push doesn't affect connectors" echo "metadata_file=false" >> $GITHUB_OUTPUT echo "community_support=false" >> $GITHUB_OUTPUT exit 0 @@ -106,7 +100,7 @@ jobs: - name: Start AI documentation update session if: steps.check-support-level.outputs.metadata_file == 'true' && steps.check-support-level.outputs.community_support == 'true' env: - PROMPT_TEXT: "The pull request to review is ${{ github.event.pull_request.number }}" + PROMPT_TEXT: "The commit to review is ${{ github.sha }}. This commit was pushed to master and may contain connector changes that need documentation updates." uses: aaronsteers/devin-action@0d74d6d9ff1b16ada5966dc31af53a9d155759f4 # Pinned to specific commit for security with: devin-token: ${{ secrets.DEVIN_AI_API_KEY }} From 37944e72328dbf7341bc245447a4e6e7eda92659 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 26 Sep 2025 23:49:50 +0000 Subject: [PATCH 14/16] fix: Remove trailing whitespace to resolve Format Check CI failure - Fix prettier formatting issues on lines 41 and 46 - Verified locally with pre-commit run prettier - Addresses Format Check CI failure (job_id: 51375126425) Co-Authored-By: ian.alton@airbyte.io --- .github/workflows/autodoc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/autodoc.yml b/.github/workflows/autodoc.yml index 6148ca4a5272..d0ff8103cb65 100644 --- a/.github/workflows/autodoc.yml +++ b/.github/workflows/autodoc.yml @@ -38,12 +38,12 @@ jobs: run: | echo "🔍 Fetching files changed in commit ${{ github.sha }}..." FILES=$(git diff HEAD~1 HEAD --name-only | jq -R -s -c 'split("\n")[:-1]') - + if [ -z "$FILES" ] || [ "$FILES" = "[]" ]; then echo "❌ Error: No files changed in this push." exit 1 fi - + echo "✅ Successfully fetched changed files list" echo "files=$FILES" >> $GITHUB_OUTPUT From 017dcfae0c8413afc9eb9d93c9d37f2db882d316 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 27 Sep 2025 00:03:35 +0000 Subject: [PATCH 15/16] fix: Change exit 1 to exit 0 when no files changed in push - Address ian-at-airbyte's GitHub comment feedback - No files changed isn't a failure condition with git diff - Update message to be informational rather than error - Resolves: https://github.com/airbytehq/airbyte/pull/66556#issuecomment-3340824578 Co-Authored-By: ian.alton@airbyte.io --- .github/workflows/autodoc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/autodoc.yml b/.github/workflows/autodoc.yml index d0ff8103cb65..6d34367f731e 100644 --- a/.github/workflows/autodoc.yml +++ b/.github/workflows/autodoc.yml @@ -40,8 +40,8 @@ jobs: FILES=$(git diff HEAD~1 HEAD --name-only | jq -R -s -c 'split("\n")[:-1]') if [ -z "$FILES" ] || [ "$FILES" = "[]" ]; then - echo "❌ Error: No files changed in this push." - exit 1 + echo "â„šī¸ No files changed in this push - skipping documentation update." + exit 0 fi echo "✅ Successfully fetched changed files list" From e19d6f319e46083d25a062b37d727c1e8c8d2d6e Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 27 Sep 2025 00:15:55 +0000 Subject: [PATCH 16/16] feat: Use github.event.before for more robust file change detection - Replace git diff HEAD~1 HEAD with github.event.before to github.sha - More robust for multi-commit pushes, rebases, and merge commits - Addresses ian-at-airbyte's GitHub comment feedback - Resolves: https://github.com/airbytehq/airbyte/pull/66556#issuecomment-3340824578 Co-Authored-By: ian.alton@airbyte.io --- .github/workflows/autodoc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/autodoc.yml b/.github/workflows/autodoc.yml index 6d34367f731e..0bd7eb2b9d38 100644 --- a/.github/workflows/autodoc.yml +++ b/.github/workflows/autodoc.yml @@ -36,8 +36,8 @@ jobs: - name: Get files changed in this push id: push-files run: | - echo "🔍 Fetching files changed in commit ${{ github.sha }}..." - FILES=$(git diff HEAD~1 HEAD --name-only | jq -R -s -c 'split("\n")[:-1]') + echo "🔍 Fetching files changed in push from ${{ github.event.before }} to ${{ github.sha }}..." + FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | jq -R -s -c 'split("\n")[:-1]') if [ -z "$FILES" ] || [ "$FILES" = "[]" ]; then echo "â„šī¸ No files changed in this push - skipping documentation update."