You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "dubbo-go-bot (via GitHub)" <gi...@apache.org> on 2025/10/18 11:04:20 UTC
[PR] refactor: streamline sync-to-upstream workflow and improve comments [dubbo-go-pixiu]
dubbo-go-bot opened a new pull request, #781:
URL: https://github.com/apache/dubbo-go-pixiu/pull/781
## π Upstream Sync from Community Fork
This PR automatically syncs changes from the community fork to the upstream repository.
### Original Contribution
- **Author**: @Similarityoung
- **Original PR**: https://github.com/dubbo-go-pixiu/dubbo-go-pixiu/pull/11
- **Merged at**: 2025-10-18 11:04:16 UTC
### Original PR Description
---
This pull request streamlines and simplifies the workflow for syncing changes from the community fork to the upstream repository. It removes fork-specific configuration and files, clarifies documentation and messaging, and improves error handling for rebase conflicts. The changes mainly affect the `.github/workflows/sync-to-upstream.yml` workflow and remove `.github/pull.yml`.
## Summary by Sourcery
Refactor and simplify the GitHub Actions sync-to-upstream workflow by removing fork-specific configuration and files, tightening execution conditions, and improving inline documentation and error messages.
Enhancements:
- Improve PR body and comment templates for clarity and brevity
- Enhance rebase conflict handling with a concise code block showing manual resolution steps
CI:
- Rename and streamline the sync-to-upstream workflow to run only in fork repositories and on merged PRs to the configured base branch
- Remove the step that excluded and deleted fork-specific workflow files and delete the obsolete .github/pull.yml file
Documentation:
- Clarify and standardize inline comments and environment configuration instructions in the workflow
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **Chores**
* Removed an outdated upstream sync workflow.
* Reworked the upstream sync flow to operate only when run from forks and to validate the fork target before syncing.
* Expanded the sync cycle to create a dedicated sync branch, rebase from upstream, and open an upstream PR automatically.
* Simplified messaging and notifications with clearer success/skip signals.
* Streamlined error handling with concise rebase-conflict messaging and actionable manual-resolution steps.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---
All commits preserve original authorship.
**Note**: Auto-created when PR #11 was merged into `dubbo-go-pixiu/dubbo-go-pixiu:develop`.
cc @Similarityoung
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] refactor: streamline sync-to-upstream workflow and improve comments [dubbo-go-pixiu]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks merged PR #781:
URL: https://github.com/apache/dubbo-go-pixiu/pull/781
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] refactor: streamline sync-to-upstream workflow and improve comments [dubbo-go-pixiu]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #781:
URL: https://github.com/apache/dubbo-go-pixiu/pull/781#issuecomment-3418241527
## [Codecov](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/781?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 16.21%. Comparing base ([`26606a8`](https://app.codecov.io/gh/apache/dubbo-go-pixiu/commit/26606a8317ac79fb8ce826138a34908b62beae1c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`40e41e8`](https://app.codecov.io/gh/apache/dubbo-go-pixiu/commit/40e41e88b234545cee3dcf9a85fce9eb2471ff05?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 74 commits behind head on develop.
> :exclamation: There is a different number of reports uploaded between BASE (26606a8) and HEAD (40e41e8). Click for more details.
>
> <details><summary>HEAD has 1 upload less than BASE</summary>
>
>| Flag | BASE (26606a8) | HEAD (40e41e8) |
>|------|------|------|
>||1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## develop #781 +/- ##
============================================
- Coverage 54.67% 16.21% -38.46%
============================================
Files 671 224 -447
Lines 78658 16723 -61935
============================================
- Hits 43006 2712 -40294
+ Misses 31981 13750 -18231
+ Partials 3671 261 -3410
```
| [Flag](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/781/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Ξ | |
|---|---|---|
| [unittests](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/781/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `16.21% <ΓΈ> (?)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/dubbo-go-pixiu/pull/781?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] refactor: streamline sync-to-upstream workflow and improve comments [dubbo-go-pixiu]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #781:
URL: https://github.com/apache/dubbo-go-pixiu/pull/781#issuecomment-3418234660
## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=781) **Quality Gate failed**
Failed conditions
 [1 Security Hotspot](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go-pixiu&pullRequest=781&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go-pixiu&pullRequest=781)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] refactor: streamline sync-to-upstream workflow and improve comments [dubbo-go-pixiu]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #781:
URL: https://github.com/apache/dubbo-go-pixiu/pull/781#discussion_r2443034388
##########
.github/workflows/sync-to-upstream.yml:
##########
@@ -0,0 +1,253 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: Sync to Upstream
+
+# Automatically creates a PR to upstream when a PR is merged to fork.
+# Only executes in fork repositories (checked by github.repository).
+#
+# Prerequisites:
+# - UPSTREAM_GITHUB_TOKEN secret with 'public_repo' permission
+# - Bot account with Write access to fork repository
+#
+# Configuration: Modify the env section below for your project
+
+# ============================================================================
+# Configuration
+# ============================================================================
+env:
+ # Upstream repository
+ UPSTREAM_ORG: apache
+ UPSTREAM_REPO: dubbo-go-pixiu
+
+ # Fork repository
+ FORK_ORG: dubbo-go-pixiu
+ FORK_REPO: dubbo-go-pixiu
+
+ # Branch name
+ BASE_BRANCH: develop
+
+ # Git bot info
+ BOT_NAME: "Pixiu Bot"
+ BOT_EMAIL: "bot@dubbo-go-pixiu.github.io"
+
+# ============================================================================
+
+on:
+ pull_request_target:
+ types: [closed]
+
+permissions:
+ contents: read
+ pull-requests: write
+ issues: write
+
+concurrency:
+ group: sync-to-upstream
+ cancel-in-progress: false
+
+jobs:
+ sync-to-upstream:
+ name: Sync to Upstream Repository
+ runs-on: ubuntu-latest
+
+ # Only run when PR is merged; repository check happens inside steps where env is available
+ if: github.event.pull_request.merged == true
+
+ steps:
+ - name: Check repository and target branch
+ id: check_branch
+ run: |
+ EXPECTED_REPO="${{ env.FORK_ORG }}/${{ env.FORK_REPO }}"
+ CURRENT_REPO="${GITHUB_REPOSITORY}"
+
+ if [ "${CURRENT_REPO}" != "${EXPECTED_REPO}" ]; then
+ echo "βΉοΈ Running in '${CURRENT_REPO}', expected '${EXPECTED_REPO}'. Skipping."
+ echo "skip=true" >> $GITHUB_OUTPUT
+ exit 0
+ fi
+
+ TARGET_BRANCH="${{ github.event.pull_request.base.ref }}"
+ if [ "${TARGET_BRANCH}" != "${{ env.BASE_BRANCH }}" ]; then
+ echo "β οΈ PR targets '${TARGET_BRANCH}', expected '${{ env.BASE_BRANCH }}'. Skipping."
+ echo "skip=true" >> $GITHUB_OUTPUT
+ exit 0
+ fi
+
+ echo "β
Repo and base branch verified: ${EXPECTED_REPO}@${{ env.BASE_BRANCH }}"
+ echo "skip=false" >> $GITHUB_OUTPUT
+
+ # Step 1: Checkout code with full history
+ - name: Checkout repository
+ if: steps.check_branch.outputs.skip != 'true'
+ uses: actions/checkout@v5
+ with:
+ fetch-depth: 0
+ ref: ${{ env.BASE_BRANCH }}
+ token: ${{ secrets.UPSTREAM_GITHUB_TOKEN }}
+
+ # Step 2: Configure Git user
+ - name: Configure Git user
+ if: steps.check_branch.outputs.skip != 'true'
+ run: |
+ git config user.name "${{ env.BOT_NAME }}"
+ git config user.email "${{ env.BOT_EMAIL }}"
+
+ # Step 3: Add upstream remote and fetch
+ - name: Add upstream remote
+ if: steps.check_branch.outputs.skip != 'true'
+ run: |
+ git remote add upstream https://github.com/${{ env.UPSTREAM_ORG }}/${{ env.UPSTREAM_REPO }}.git
+ git fetch upstream ${{ env.BASE_BRANCH }}
+
+ # Step 4: Create sync branch with timestamp
+ - name: Create sync branch
+ if: steps.check_branch.outputs.skip != 'true'
+ id: create_branch
+ run: |
+ SYNC_BRANCH="auto-sync-$(date +%Y%m%d-%H%M%S)"
+ echo "SYNC_BRANCH=${SYNC_BRANCH}" >> $GITHUB_ENV
+ git checkout -b ${SYNC_BRANCH}
+ echo "branch=${SYNC_BRANCH}" >> $GITHUB_OUTPUT
+
+ # Step 5: Rebase onto upstream base branch
+ - name: Rebase onto upstream
+ if: steps.check_branch.outputs.skip != 'true'
+ id: rebase
+ run: |
+ git rebase upstream/${{ env.BASE_BRANCH }}
+
+ # Step 6: Push sync branch to origin
+ - name: Push sync branch
+ if: steps.check_branch.outputs.skip != 'true'
+ run: |
+ git push origin ${SYNC_BRANCH} --force-with-lease
+
+ # Step 7: Generate PR body with attribution
+ - name: Generate PR description
+ if: steps.check_branch.outputs.skip != 'true'
+ id: pr_body
+ env:
+ ORIGINAL_BODY: ${{ github.event.pull_request.body }}
+ run: |
+ ORIGINAL_AUTHOR="${{ github.event.pull_request.user.login }}"
+ ORIGINAL_PR="${{ github.event.pull_request.number }}"
+ ORIGINAL_URL="${{ github.event.pull_request.html_url }}"
+ MERGED_AT="$(date -u +"%Y-%m-%d %H:%M:%S UTC")"
+
+ {
+ echo "## π Upstream Sync from Community Fork"
+ echo ""
+ echo "This PR automatically syncs changes from the community fork to the upstream repository."
+ echo ""
+ echo "### Original Contribution"
+ echo ""
+ echo "- **Author**: @${ORIGINAL_AUTHOR}"
+ echo "- **Original PR**: ${ORIGINAL_URL}"
+ echo "- **Merged at**: ${MERGED_AT}"
+ echo ""
+ echo "### Original PR Description"
+ echo ""
+ echo "---"
+ echo ""
+ echo "${ORIGINAL_BODY}"
+ echo ""
+ echo "---"
+ echo ""
+ echo "All commits preserve original authorship."
+ echo ""
+ echo "**Note**: Auto-created when PR #${ORIGINAL_PR} was merged into \`${{ env.FORK_ORG }}/${{ env.FORK_REPO }}:${{ env.BASE_BRANCH }}\`."
+ echo ""
+ echo "cc @${ORIGINAL_AUTHOR}"
+ } > pr_body.md
+
+ - name: Create PR to ${{ env.UPSTREAM_ORG }}/${{ env.UPSTREAM_REPO }}
+ if: steps.check_branch.outputs.skip != 'true'
+ id: create_pr
+ env:
+ GH_TOKEN: ${{ secrets.UPSTREAM_GITHUB_TOKEN }}
+ SYNC_PR_TITLE: ${{ github.event.pull_request.title }}
+ run: |
+ PR_URL=$(gh pr create \
+ --repo ${{ env.UPSTREAM_ORG }}/${{ env.UPSTREAM_REPO }} \
+ --base ${{ env.BASE_BRANCH }} \
+ --head ${{ env.FORK_ORG }}:${SYNC_BRANCH} \
+ --title "$SYNC_PR_TITLE" \
+ --body-file pr_body.md)
+
+ echo "pr_url=${PR_URL}" >> $GITHUB_OUTPUT
+ echo "β
Successfully created PR: ${PR_URL}"
+
+ - name: Notify original PR
+ if: success() && steps.check_branch.outputs.skip != 'true'
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ PR_NUMBER: ${{ github.event.pull_request.number }}
+ UPSTREAM_PR_URL: ${{ steps.create_pr.outputs.pr_url }}
+ run: |
+ {
+ echo "π€ **Automated Upstream Sync**"
+ echo ""
+ echo "Your PR has been synced to upstream:"
+ echo "$UPSTREAM_PR_URL"
+ echo ""
+ echo "Thank you for your contribution! π"
+ } > comment_body.md
+
+ gh pr comment "$PR_NUMBER" --repo ${{ env.FORK_ORG }}/${{ env.FORK_REPO }} --body-file comment_body.md || {
+ echo "β οΈ Comment failed but sync succeeded: $UPSTREAM_PR_URL"
+ exit 0
+ }
+
+ - name: Handle rebase failure
+ if: failure() && steps.rebase.outcome == 'failure'
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ PR_NUMBER: ${{ github.event.pull_request.number }}
+ PR_AUTHOR: ${{ github.event.pull_request.user.login }}
+ run: |
+ git rebase --abort || true
+
+ gh issue create \
+ --repo ${{ env.FORK_ORG }}/${{ env.FORK_REPO }} \
+ --title "β οΈ Failed to auto-sync PR #${PR_NUMBER} to upstream" \
+ --body "## Sync Failure Report
+
+ **Original PR**: #${PR_NUMBER}
+ **Author**: @${PR_AUTHOR}
+ **Error**: Rebase conflicts detected
+
+ ### Manual Resolution Required
+
+ \`\`\`bash
+ git checkout ${{ env.BASE_BRANCH }}
+ git checkout -b manual-sync-${PR_NUMBER}
+ git remote add upstream https://github.com/${{ env.UPSTREAM_ORG }}/${{ env.UPSTREAM_REPO }}.git
+ git fetch upstream ${{ env.BASE_BRANCH }}
+ git rebase upstream/${{ env.BASE_BRANCH }}
+ # Resolve conflicts
+ git push origin manual-sync-${PR_NUMBER}
+ # Create PR to ${{ env.UPSTREAM_ORG }}/${{ env.UPSTREAM_REPO }}
+ \`\`\`
+
+ cc @${PR_AUTHOR}" \
Review Comment:
The issue body content has inconsistent indentation which could affect markdown rendering. Remove the leading whitespace from lines 231-249 to ensure proper formatting when the issue is created.
```suggestion
**Original PR**: #${PR_NUMBER}
**Author**: @${PR_AUTHOR}
**Error**: Rebase conflicts detected
### Manual Resolution Required
\`\`\`bash
git checkout ${{ env.BASE_BRANCH }}
git checkout -b manual-sync-${PR_NUMBER}
git remote add upstream https://github.com/${{ env.UPSTREAM_ORG }}/${{ env.UPSTREAM_REPO }}.git
git fetch upstream ${{ env.BASE_BRANCH }}
git rebase upstream/${{ env.BASE_BRANCH }}
# Resolve conflicts
git push origin manual-sync-${PR_NUMBER}
# Create PR to ${{ env.UPSTREAM_ORG }}/${{ env.UPSTREAM_REPO }}
\`\`\`
cc @${PR_AUTHOR}" \
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org