diff --git a/.github/workflows/reverse-sync.yml b/.github/workflows/reverse-sync.yml deleted file mode 100644 index 6ec3bd2..0000000 --- a/.github/workflows/reverse-sync.yml +++ /dev/null @@ -1,270 +0,0 @@ -name: Reverse Sync - -env: - TARGET_REPO: alaudadevops/tektoncd-operator - # Ignoring the files or folders in this prefix (uses comma to split) - IGNORE_PATHS: .github/,README.md - # will check these files change to create a new patch - SYNCED_PATHS: "docs/ theme/ .yarn/ doom.config.yml yarn.lock tsconfig.json package.json sites.yaml" - -on: - pull_request: - types: [closed] - branches: - - main - - release-* - - -jobs: - reverse-sync: - if: github.event.pull_request.merged == true - runs-on: ubuntu-latest - - steps: - - name: Check if PR is from sync bot - id: check_sync_bot - run: | - pr_author="${{ github.event.pull_request.user.login }}" - pr_title='${{ github.event.pull_request.title }}' - pr_base_ref="${{ github.event.pull_request.base.ref }}" - pr_head_ref="${{ github.event.pull_request.head.ref }}" - - echo "=> PR Title: $pr_title" - echo "=> PR Author: $pr_author" - echo "=> PR Refs: $pr_base_ref --> $pr_head_ref" - # Skip if the PR is from our sync bot or has sync-related keywords - if [[ "$pr_author" == "github-actions[bot]" ]] || - [[ "$pr_title" == *"Sync documentation"* ]] || - [[ "$pr_title" == *"sync-docs"* ]]; then - echo "skip_sync=true" >> $GITHUB_OUTPUT - echo "🤖 PR is from sync bot - skipping reverse sync" - else - echo "skip_sync=false" >> $GITHUB_OUTPUT - echo "đŸ‘Ĩ PR is from external contributor - proceeding with reverse sync" - fi - - - name: Checkout devops-pipelines-docs repository - if: steps.check_sync_bot.outputs.skip_sync == 'false' - uses: actions/checkout@v4 - with: - token: ${{ secrets.SYNC_TOKEN }} - path: devops-pipelines-docs - fetch-depth: 0 - ref: ${{ github.event.pull_request.base.ref }} - - - name: Checkout target repository - if: steps.check_sync_bot.outputs.skip_sync == 'false' - uses: actions/checkout@v4 - with: - repository: ${{env.TARGET_REPO}} - token: ${{ secrets.SYNC_TOKEN }} - path: target-docs - fetch-depth: 0 - ref: ${{ github.event.pull_request.base.ref }} - - - name: Get PR changes - if: steps.check_sync_bot.outputs.skip_sync == 'false' - id: get_changes - run: | - cd devops-pipelines-docs - - # Get the merge commit - merge_commit="${{ github.event.pull_request.merge_commit_sha }}" - - # Get the base commit (before merge) - base_commit="${{ github.event.pull_request.base.sha }}" - - echo "merge_commit=$merge_commit" >> $GITHUB_OUTPUT - echo "base_commit=$base_commit" >> $GITHUB_OUTPUT - - # Get list of changed files in the PR - ignore_pattern=$(echo "$IGNORE_PATHS" | sed 's/,/|/g' | sed 's|/$||g') - echo "🙈 Ignored paths: $ignore_pattern" - - git diff --name-only $base_commit $merge_commit | grep -v -E "^($ignore_pattern)" > ../changed_files.txt - - echo "📋 Changed files in PR:" - cat ../changed_files.txt - - IFS=',' read -ra PATHS <<< "$SYNCED_PATHS" - # Check if any documentation files were changed - if [ -s ../changed_files.txt ]; then - echo "has_doc_changes=true" >> $GITHUB_OUTPUT - echo "✅ Documentation changes detected" - else - echo "has_doc_changes=false" >> $GITHUB_OUTPUT - echo "â„šī¸ No documentation changes detected" - fi - - - name: Create reverse sync branch - if: steps.check_sync_bot.outputs.skip_sync == 'false' && steps.get_changes.outputs.has_doc_changes == 'true' - id: create_branch - run: | - cd target-docs - - # Create a unique branch name - branch_name="reverse-sync/pr-${{ github.event.pull_request.number }}-$(date +%s)" - echo "branch_name=$branch_name" >> $GITHUB_OUTPUT - - git checkout -b "$branch_name" - - # Configure git - git config user.name "Documentation Sync Bot" - git config user.email "noreply@github.com" - - echo "📝 Created branch: $branch_name" - - - name: Apply changes from devops-pipelines-docs - if: steps.check_sync_bot.outputs.skip_sync == 'false' && steps.get_changes.outputs.has_doc_changes == 'true' - run: | - cd devops-pipelines-docs - merge_commit="${{ steps.get_changes.outputs.merge_commit }}" - base_commit="${{ steps.get_changes.outputs.base_commit }}" - - # Create a patch with only the documentation changes - ignore_pattern=$(echo "$IGNORE_PATHS" | sed 's/,/|/g' | sed 's|/$||g') - echo "📑 Will only sync these paths: $SYNCED_PATHS" - git format-patch $base_commit..$merge_commit --stdout -- $SYNCED_PATHS > ../changes.patch - - cd ../target-docs - - # Apply the patch - if [ -s ../changes.patch ]; then - echo "đŸ“Ļ Applying changes from devops-pipelines-docs..." - git apply ../changes.patch || { - echo "âš ī¸ Patch application failed, trying manual copy..." - - # Fallback: manual copy of changed files - while IFS= read -r file; do - if [ -f "../devops-pipelines-docs/$file" ]; then - mkdir -p "$(dirname "$file")" - cp "../devops-pipelines-docs/$file" "$file" - echo "✅ Copied: $file" - fi - done < ../changed_files.txt - } - else - echo "âš ī¸ No patch generated, using manual copy..." - - # Manual copy approach - while IFS= read -r file; do - if [ -f "../devops-pipelines-docs/$file" ]; then - mkdir -p "$(dirname "$file")" - cp "../devops-pipelines-docs/$file" "$file" - echo "✅ Copied: $file" - fi - done < ../changed_files.txt - fi - - - name: Commit changes - if: steps.check_sync_bot.outputs.skip_sync == 'false' && steps.get_changes.outputs.has_doc_changes == 'true' - id: commit_changes - run: | - cd target-docs - - git add . - - if git diff --staged --quiet; then - echo "has_changes=false" >> $GITHUB_OUTPUT - echo "â„šī¸ No changes to commit" - else - echo "has_changes=true" >> $GITHUB_OUTPUT - - # Create commit message with reverse sync marker - cat > commit_message.txt << EOF - [reverse-sync] Sync documentation changes from devops-pipelines-docs PR #${{ github.event.pull_request.number }} - - This commit incorporates changes from external contributors to the devops-pipelines-docs repository. - - 📋 Original PR Details: - - Title: ${{ github.event.pull_request.title }} - - Author: ${{ github.event.pull_request.user.login }} - - URL: ${{ github.event.pull_request.html_url }} - - Merge commit: ${{ steps.get_changes.outputs.merge_commit }} - - 🔄 This is a reverse sync commit - it should not trigger forward sync. - EOF - - git commit -F commit_message.txt - rm commit_message.txt - - echo "✅ Changes committed successfully" - fi - - - name: Push branch and create PR - if: steps.check_sync_bot.outputs.skip_sync == 'false' && steps.get_changes.outputs.has_doc_changes == 'true' && steps.commit_changes.outputs.has_changes == 'true' - run: | - cd target-docs - branch_name="${{ steps.create_branch.outputs.branch_name }}" - pr_base_ref="${{ github.event.pull_request.base.ref }}" - - # Push the branch - git push origin "$branch_name" - - # Create PR body with proper JSON escaping - pr_body=$(cat << 'EOF' - ### 🔄 Reverse Sync from devops-pipelines-docs - - This PR incorporates documentation changes from external contributors to the devops-pipelines-docs repository. - - #### Original PR Details - - **Repository**: alauda/devops-pipelines-docs - - **PR**: #${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }} - - **Author**: @${{ github.event.pull_request.user.login }} - - **URL**: ${{ github.event.pull_request.html_url }} - - #### Changes - This PR includes changes to documentation files that were contributed by external contributors to the public devops-pipelines-docs repository. - - #### Important Notes - - âš ī¸ This PR contains the `[reverse-sync]` marker to prevent infinite sync loops - - ✅ Once merged, this will NOT trigger a forward sync back to devops-pipelines-docs - - 🔍 Please review the changes to ensure they align with internal documentation standards - - --- - *This PR was automatically created by the reverse sync workflow.* - EOF) - - # Create JSON payload with proper escaping - json_payload=$(jq -n \ - --arg title "[reverse-sync] Documentation changes from devops-pipelines-docs PR #${{ github.event.pull_request.number }}" \ - --arg head "$branch_name" \ - --arg base "$pr_base_ref" \ - --arg body "$pr_body" \ - '{title: $title, head: $head, base: $base, body: $body}') - - # Create the PR using GitHub API - curl -X POST \ - -H "Authorization: token ${{ secrets.SYNC_TOKEN }}" \ - -H "Accept: application/vnd.github.v3+json" \ - -H "Content-Type: application/json" \ - https://api.github.com/repos/${{env.TARGET_REPO}}/pulls \ - -d "$json_payload" - - - - - name: Create workflow summary - run: | - if [ "${{ steps.check_sync_bot.outputs.skip_sync }}" == "true" ]; then - echo "## 🤖 Sync Bot PR - Reverse Sync Skipped" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "This PR was created by the sync bot, so reverse sync was skipped to prevent loops." >> $GITHUB_STEP_SUMMARY - elif [ "${{ steps.get_changes.outputs.has_doc_changes }}" == "false" ]; then - echo "## â„šī¸ No Documentation Changes" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "This PR didn't contain any documentation changes, so no reverse sync was needed." >> $GITHUB_STEP_SUMMARY - elif [ "${{ steps.commit_changes.outputs.has_changes }}" == "false" ]; then - echo "## â„šī¸ No Changes to Sync" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "The documentation changes were already present in target-docs." >> $GITHUB_STEP_SUMMARY - else - echo "## 🎉 Reverse Sync Completed" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "Successfully created a PR in target-docs with the documentation changes." >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "### Details:" >> $GITHUB_STEP_SUMMARY - echo "- **Source PR**: #${{ github.event.pull_request.number }} by @${{ github.event.pull_request.user.login }}" >> $GITHUB_STEP_SUMMARY - echo "- **Branch**: ${{ steps.create_branch.outputs.branch_name }}" >> $GITHUB_STEP_SUMMARY - echo "- **Base ref**: ${{ github.event.pull_request.base.ref }}" >> $GITHUB_STEP_SUMMARY - echo "- **Target repository**: ${{env.TARGET_REPO}}" >> $GITHUB_STEP_SUMMARY - fi diff --git a/docs/en/triggers/trouble_shooting/pipeline_not_triggered.mdx b/docs/en/triggers/trouble_shooting/pipeline_not_triggered.mdx index 4a18aaa..7e99d09 100644 --- a/docs/en/triggers/trouble_shooting/pipeline_not_triggered.mdx +++ b/docs/en/triggers/trouble_shooting/pipeline_not_triggered.mdx @@ -7,7 +7,7 @@ weight: 10 ## Problem Description -After creating the `Pipeline` and `Trigger` using `Pipelines` functionality through the UI console, the `Pipeline` is not automatically triggered event though the event is sent (i.e the code is pushed). +After creating the `Pipeline` and `Trigger` using `Pipelines` functionality through the UI console, the `Pipeline` is not automatically triggered even though the event is sent (i.e the code is pushed). ## Root Cause Analysis @@ -22,14 +22,14 @@ There are several possible causes for this issue: Given the possible issues mentioned above, follow the steps to find the root cause of the problem: -### Webhook configuration was not setup correctly +### Webhook configuration was not set up correctly 1. Access your repository/settings using an account with appropriate permissions. 2. Check all webhook settings and confirm with the platform administrator details regarding the target address of the webhook. - 3. Make sure the required events are enabled by the webhook. For Gitlab events please refer to [GitLab Event Triggers](../how_to/gitlab_events.mdx) + 3. Make sure the required events are enabled by the webhook. For Gitlab events, please refer to [GitLab Event Triggers](../how_to/gitlab_events.mdx) -### EventLister not deployed or setup incorrectly +### EventListener not deployed or set up incorrectly 1. Verify with the Platform Administrator that the `EventListener` was deployed and can be reached from the event source (i.e Gitlab instance). 2. Access the `EventListener` resource and check if it is listening `Triggers` in the target namespace checking the `EventListener` resource `spec`, it should have the `namespaceSelector` field set to `*` or listing the target namespace.