From 753299bb11ebeaf321cab5750834f130f0dc8a3d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Jun 2025 21:00:16 +0000 Subject: [PATCH 1/4] Initial plan for issue From 5f9ab5c7f901da18b474d90f6cb155050a536c79 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Jun 2025 21:04:21 +0000 Subject: [PATCH 2/4] Restore .NET SDK version temporarily for development Co-authored-by: joshfree <1302850+joshfree@users.noreply.github.com> --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 0656e7072..4076b15b0 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { // Keep this version in sync with the .NET SDK version used in the Dockerfile - "version": "9.0.300", + "version": "8.0.116", "rollForward": "feature" } } \ No newline at end of file From 538d15f85bcce73aabfea8e4cb1722ec4256be09 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Jun 2025 21:11:07 +0000 Subject: [PATCH 3/4] Add auto-contributor recognition workflow for releases Co-authored-by: joshfree <1302850+joshfree@users.noreply.github.com> --- .github/workflows/auto-add-contributors.yml | 148 ++++++++++++++++++++ CONTRIBUTING.md | 10 ++ global.json | 2 +- 3 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/auto-add-contributors.yml diff --git a/.github/workflows/auto-add-contributors.yml b/.github/workflows/auto-add-contributors.yml new file mode 100644 index 000000000..7e07a7cbe --- /dev/null +++ b/.github/workflows/auto-add-contributors.yml @@ -0,0 +1,148 @@ +name: Auto-Add Contributors + +on: + release: + types: [published] + +permissions: + contents: write + pull-requests: write + +jobs: + add-contributors: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get release information + id: release_info + run: | + echo "tag_name=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT + echo "release_name=${{ github.event.release.name }}" >> $GITHUB_OUTPUT + + - name: Get contributors for this release + id: contributors + run: | + CURRENT_TAG="${{ steps.release_info.outputs.tag_name }}" + PREVIOUS_TAG=$(git tag --sort=-version:refname | grep -A1 "^${CURRENT_TAG}$" | tail -n1) + + if [ -z "$PREVIOUS_TAG" ] || [ "$PREVIOUS_TAG" = "$CURRENT_TAG" ]; then + ALL_TAGS=$(git tag --sort=-version:refname) + PREVIOUS_TAG=$(echo "$ALL_TAGS" | grep -A1 "^${CURRENT_TAG}$" | tail -n1) + + if [ -z "$PREVIOUS_TAG" ] || [ "$PREVIOUS_TAG" = "$CURRENT_TAG" ]; then + PREVIOUS_TAG=$(git log --since="30 days ago" --format="%H" | tail -n1) + if [ -z "$PREVIOUS_TAG" ]; then + PREVIOUS_TAG=$(git rev-list --max-parents=0 HEAD) + fi + fi + fi + + echo "Current tag: $CURRENT_TAG" + echo "Previous tag: $PREVIOUS_TAG" + + CONTRIBUTORS=$(git log --format='%an <%ae>' ${PREVIOUS_TAG}..${CURRENT_TAG} | sort -u | while IFS= read -r line; do + if [ -n "$line" ]; then + EMAIL=$(echo "$line" | sed 's/.*<\(.*\)>.*/\1/') + if [[ ! "$EMAIL" =~ ^[0-9]+\+.*@users\.noreply\.github\.com$ ]] && \ + [[ ! "$EMAIL" =~ [Bb]ot.*@.* ]] && \ + [[ ! "$EMAIL" =~ .*[Bb]ot@.* ]] && \ + [[ ! "$EMAIL" =~ no-reply@github\.com ]] && \ + [[ ! "$EMAIL" =~ noreply@github\.com ]]; then + echo "$line" + fi + fi + done) + + CONTRIBUTORS=$(echo "$CONTRIBUTORS" | grep -v '^$' | sort -u) + + if [ -n "$CONTRIBUTORS" ]; then + echo "### Contributors" > contributors.txt + echo "" >> contributors.txt + echo "Thank you to the following contributors for their work on this release:" >> contributors.txt + echo "" >> contributors.txt + while IFS= read -r contributor; do + if [ -n "$contributor" ]; then + NAME=$(echo "$contributor" | sed 's/ <.*//') + echo "- $NAME" >> contributors.txt + fi + done <<< "$CONTRIBUTORS" + echo "has_contributors=true" >> $GITHUB_OUTPUT + else + echo "has_contributors=false" >> $GITHUB_OUTPUT + fi + + - name: Update CHANGELOG with contributors + if: steps.contributors.outputs.has_contributors == 'true' + run: | + CONTRIBUTOR_TEXT=$(cat contributors.txt) + VERSION="${{ steps.release_info.outputs.tag_name }}" + VERSION=${VERSION#v} + + cp CHANGELOG.md CHANGELOG.md.bak + + awk -v version="$VERSION" ' + BEGIN { + in_version_section = 0 + added_contributors = 0 + } + + /^## / { + if ($0 ~ version && added_contributors == 0) { + print $0 + in_version_section = 1 + next + } else { + if (in_version_section && added_contributors == 0) { + print "" + while ((getline line < "contributors.txt") > 0) { + print line + } + close("contributors.txt") + added_contributors = 1 + } + in_version_section = 0 + print $0 + next + } + } + + { + print $0 + } + + END { + if (in_version_section && added_contributors == 0) { + print "" + while ((getline line < "contributors.txt") > 0) { + print line + } + close("contributors.txt") + } + } + ' CHANGELOG.md > CHANGELOG.md.new + + mv CHANGELOG.md.new CHANGELOG.md + + - name: Create pull request with contributor updates + if: steps.contributors.outputs.has_contributors == 'true' + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "Add contributors to CHANGELOG for release ${{ steps.release_info.outputs.tag_name }}" + title: "Add contributors to CHANGELOG for release ${{ steps.release_info.outputs.tag_name }}" + body: | + This PR automatically adds contributor acknowledgments to the CHANGELOG for release ${{ steps.release_info.outputs.tag_name }}. + + The contributors section has been added to recognize community members who contributed to this release. + branch: auto-contributors-${{ steps.release_info.outputs.tag_name }} + delete-branch: true + + - name: Clean up temporary files + if: always() + run: | + rm -f contributors.txt + rm -f CHANGELOG.md.bak \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9c4511fcb..465a54117 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -281,6 +281,16 @@ Packages published to the dev feed will use: - `@dev` for the latest CI build of main - `@pre` for any arbitrary pipeline run or feature branch build +### Contributor Recognition + +When a GitHub release is published, an automated workflow will: +1. Identify all contributors who made commits since the previous release +2. Filter out automated bot accounts and system emails +3. Add a "Contributors" section to the CHANGELOG.md for that release +4. Create a pull request with the contributor acknowledgments + +This ensures community contributors are properly recognized for their contributions to each release. + ### PR Validation To run live tests for a PR, inspect the PR code for any suspicious changes, then add the comment `/azp run azure - mcp` to the pull request. This will queue a PR triggered run which will build, run unit tests, deploy test resources and run live tests. diff --git a/global.json b/global.json index 4076b15b0..0656e7072 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { // Keep this version in sync with the .NET SDK version used in the Dockerfile - "version": "8.0.116", + "version": "9.0.300", "rollForward": "feature" } } \ No newline at end of file From 7f7ef5d66a6c3a1291b7909fb67be06279216283 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Jun 2025 21:47:18 +0000 Subject: [PATCH 4/4] Update contributor format to use avatars and GitHub usernames Co-authored-by: joshfree <1302850+joshfree@users.noreply.github.com> --- .github/workflows/auto-add-contributors.yml | 77 +++++++++++++++++++-- CONTRIBUTING.md | 4 +- 2 files changed, 73 insertions(+), 8 deletions(-) diff --git a/.github/workflows/auto-add-contributors.yml b/.github/workflows/auto-add-contributors.yml index 7e07a7cbe..105146d44 100644 --- a/.github/workflows/auto-add-contributors.yml +++ b/.github/workflows/auto-add-contributors.yml @@ -44,6 +44,7 @@ jobs: echo "Current tag: $CURRENT_TAG" echo "Previous tag: $PREVIOUS_TAG" + # Extract contributors with their emails CONTRIBUTORS=$(git log --format='%an <%ae>' ${PREVIOUS_TAG}..${CURRENT_TAG} | sort -u | while IFS= read -r line; do if [ -n "$line" ]; then EMAIL=$(echo "$line" | sed 's/.*<\(.*\)>.*/\1/') @@ -60,17 +61,79 @@ jobs: CONTRIBUTORS=$(echo "$CONTRIBUTORS" | grep -v '^$' | sort -u) if [ -n "$CONTRIBUTORS" ]; then - echo "### Contributors" > contributors.txt - echo "" >> contributors.txt - echo "Thank you to the following contributors for their work on this release:" >> contributors.txt - echo "" >> contributors.txt + # Extract GitHub usernames from emails and git log + USERNAMES="" + AVATAR_HTML="" + while IFS= read -r contributor; do if [ -n "$contributor" ]; then - NAME=$(echo "$contributor" | sed 's/ <.*//') - echo "- $NAME" >> contributors.txt + EMAIL=$(echo "$contributor" | sed 's/.*<\(.*\)>.*/\1/') + USERNAME="" + + # Try to extract username from GitHub noreply emails + if [[ "$EMAIL" =~ ^[0-9]+\+(.+)@users\.noreply\.github\.com$ ]]; then + USERNAME="${BASH_REMATCH[1]}" + elif [[ "$EMAIL" =~ ^(.+)@users\.noreply\.github\.com$ ]]; then + USERNAME="${BASH_REMATCH[1]}" + else + # Try to get username from git config or commit author + COMMIT_HASH=$(git log --format='%H' --author="$EMAIL" ${PREVIOUS_TAG}..${CURRENT_TAG} | head -n1) + if [ -n "$COMMIT_HASH" ]; then + # Try to extract from commit message or other git metadata + USERNAME=$(git show --format='%an' --no-patch $COMMIT_HASH | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9-]//g') + fi + fi + + # If we still don't have a username, try using the name part before @ in email + if [ -z "$USERNAME" ]; then + USERNAME=$(echo "$EMAIL" | cut -d'@' -f1 | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9-]//g') + fi + + # Only add if username looks valid (not empty and reasonable length) + if [ -n "$USERNAME" ] && [ ${#USERNAME} -gt 1 ] && [ ${#USERNAME} -lt 40 ]; then + if [ -z "$USERNAMES" ]; then + USERNAMES="$USERNAME" + else + USERNAMES="$USERNAMES,$USERNAME" + fi + + # Add avatar HTML + AVATAR_HTML="$AVATAR_HTML\"$USERNAME\"" + fi fi done <<< "$CONTRIBUTORS" - echo "has_contributors=true" >> $GITHUB_OUTPUT + + # Remove duplicates from usernames + USERNAMES=$(echo "$USERNAMES" | tr ',' '\n' | sort -u | tr '\n' ',' | sed 's/,$//') + + if [ -n "$USERNAMES" ]; then + # Count contributors + CONTRIBUTOR_COUNT=$(echo "$USERNAMES" | tr ',' '\n' | wc -l) + + # Format the contributor text + echo "### Contributors" > contributors.txt + echo "" >> contributors.txt + echo "$AVATAR_HTML" >> contributors.txt + echo "" >> contributors.txt + + # Format usernames list + if [ "$CONTRIBUTOR_COUNT" -eq 1 ]; then + echo "$USERNAMES" >> contributors.txt + elif [ "$CONTRIBUTOR_COUNT" -eq 2 ]; then + FIRST=$(echo "$USERNAMES" | cut -d',' -f1) + SECOND=$(echo "$USERNAMES" | cut -d',' -f2) + echo "$FIRST and $SECOND" >> contributors.txt + else + FIRST=$(echo "$USERNAMES" | cut -d',' -f1) + SECOND=$(echo "$USERNAMES" | cut -d',' -f2) + REST=$((CONTRIBUTOR_COUNT - 2)) + echo "$FIRST, $SECOND, and $REST other contributors" >> contributors.txt + fi + + echo "has_contributors=true" >> $GITHUB_OUTPUT + else + echo "has_contributors=false" >> $GITHUB_OUTPUT + fi else echo "has_contributors=false" >> $GITHUB_OUTPUT fi diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 465a54117..65637c6e7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -286,7 +286,9 @@ Packages published to the dev feed will use: When a GitHub release is published, an automated workflow will: 1. Identify all contributors who made commits since the previous release 2. Filter out automated bot accounts and system emails -3. Add a "Contributors" section to the CHANGELOG.md for that release +3. Add a "Contributors" section to the CHANGELOG.md for that release with: + - A row of contributor avatar images + - GitHub usernames listed below the avatars 4. Create a pull request with the contributor acknowledgments This ensures community contributors are properly recognized for their contributions to each release.