From 075c1014418c38e627de785272b966972730790a Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Fri, 28 Apr 2023 16:13:10 -0400 Subject: [PATCH 1/5] Copy/paste sync-labels workflow from sentry --- .github/workflows/sync-labels.yml | 72 +++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/sync-labels.yml diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml new file mode 100644 index 0000000000000..e5ebeaf506fd7 --- /dev/null +++ b/.github/workflows/sync-labels.yml @@ -0,0 +1,72 @@ +name: meta(labels) +on: + pull_request: + paths: + - .github/labels.yml + push: + branches: + - master + paths: + - .github/labels.yml + +# hack for https://github.com/actions/cache/issues/810#issuecomment-1222550359 +env: + SEGMENT_DOWNLOAD_TIMEOUT_MINS: 3 + +jobs: + sync: + name: syncs repository labels + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 + - uses: getsentry/action-setup-volta@54775a59c41065f54ecc76d1dd5f2cdc7a1550cb # v1.1.0 + + - name: Install github-label-sync + run: yarn global add github-label-sync@2.2.0 + + - name: Run github-label-sync + run: | + github-label-sync \ + --access-token ${{ secrets.GITHUB_TOKEN }} \ + --labels .github/labels.yml \ + ${{ github.event_name == 'pull_request' && '--dry-run' || '' }} \ + ${{ github.repository }} \ + 2>&1 | tee sync-report.txt + + - name: Read sync output into variable + uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0 # v6.3.3 + if: github.event_name == 'pull_request' + id: github-label-sync + with: + script: | + const fs = require('fs'); + return fs.readFileSync('sync-report.txt','utf8').toString(); + result-encoding: string + + - name: Find previous dry-run comment + uses: peter-evans/find-comment@1769778a0c5bd330272d749d12c036d65e70d39d + if: github.event_name == 'pull_request' + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: '' + + - name: Add or update dry-run comment + uses: peter-evans/create-or-update-comment@b95e16d2859ad843a14218d1028da5b2c4cbc4b4 + if: github.event_name == 'pull_request' + with: + issue-number: ${{ github.event.pull_request.number }} + comment-id: ${{ steps.fc.outputs.comment-id }} + edit-mode: replace + body: > + + + 🏷 The following changes will be made to the repository labels + + ``` + ${{ steps.github-label-sync.outputs.result }} + ``` From e92a4ce340d4f7a618260a76fd12d7e2f6f959fa Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Fri, 28 Apr 2023 16:20:43 -0400 Subject: [PATCH 2/5] Bring in initial labels from GitHub --- .github/labels.yml | 129 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 .github/labels.yml diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 0000000000000..443940c160dfd --- /dev/null +++ b/.github/labels.yml @@ -0,0 +1,129 @@ +# This file is used to declaratively define the sentry repository labels. +# +# XXX: A note on renaming labels +# +# You MUST use a `alias: [ ... ]` list for the label to specify the old name of +# the label, so that it can correctly rename the label. +# +# Read more here: https://github.com/Financial-Times/github-label-sync#label-config-file + +- name: API Docs + aliases: [] + color: 649B42 + description: '' +- name: bug + aliases: [] + color: F6F6F8 + description: '' +- name: Common content + aliases: [] + color: B0E299 + description: '' +- name: CSS + aliases: [] + color: 1279F1 + description: '' +- name: dependencies + aliases: [] + color: F6F6F8 + description: Pull requests that update a dependency file +- name: duplicate + aliases: [] + color: F6F6F8 + description: '' +- name: 'Effort: Large' + aliases: [] + color: FBCA04 + description: '' +- name: 'Effort: Medium' + aliases: [] + color: FBCA04 + description: '' +- name: 'Effort: Small' + aliases: [] + color: FBCA04 + description: '' +- name: enhancement + aliases: [] + color: F6F6F8 + description: '' +- name: filler + aliases: [] + color: 57D105 + description: Requires little effort to resolve. Ready to be picked up anytime. +- name: filtering and sampling + aliases: [] + color: '584774' + description: '' +- name: gatsby-bug + aliases: [] + color: e99695 + description: '' +- name: "Hacktoberfest \U0001F383" + aliases: [] + color: ffa500 + description: '' +- name: Hacktoberfest-accepted + aliases: [] + color: e99695 + description: Accept for Hacktoberfest - will merge later +- name: help wanted + aliases: [] + color: F6F6F8 + description: '' +- name: 'Impact: Large' + aliases: [] + color: C83852 + description: '' +- name: 'Impact: Medium' + aliases: [] + color: FFB287 + description: '' +- name: 'Impact: Small' + aliases: [] + color: '452650' + description: '' +- name: Issues + aliases: [] + color: D6F6D3 + description: '' +- name: javascript + aliases: [] + color: F6F6F8 + description: Pull requests that update Javascript code +- name: Mobile + aliases: [] + color: '584774' + description: '' +- name: performance + aliases: [] + color: '584774' + description: '' +- name: 'Platform: .NET' + aliases: [] + color: '584774' + description: '' +- name: 'Platform: Android' + aliases: [] + color: '584774' + description: '' +- name: 'Platform: Capacitor' + aliases: [] + color: '584774' + description: '' +- name: 'Platform: Cocoa' + aliases: [] + color: '584774' + description: '' +- name: 'Platform: Cordova' + aliases: [] + color: '584774' + description: '' +- name: 'Platform: Dart' + aliases: [] + color: '584774' + description: '' +- name: 'Platform: Elixir' + aliases: [] + color: 3268A0 + description: '' From 8f577fb2a5a8ea07eb3b85d4d8b0a54dea94b7e1 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Fri, 28 Apr 2023 16:24:46 -0400 Subject: [PATCH 3/5] Add remaining labels --- .github/labels.yml | 200 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) diff --git a/.github/labels.yml b/.github/labels.yml index 443940c160dfd..8e41e65543219 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -127,3 +127,203 @@ aliases: [] color: 3268A0 description: '' +- name: 'Platform: Go' + aliases: [] + color: 2A5DD0 + description: '' +- name: 'Platform: Java' + aliases: [] + color: '584774' + description: '' +- name: 'Platform: JavaScript' + aliases: [] + color: '584774' + description: '' +- name: 'Platform: PHP' + aliases: [] + color: '584774' + description: '' +- name: 'Platform: Python' + aliases: [] + color: '584774' + description: '' +- name: 'Platform: React-Native' + aliases: [] + color: '584774' + description: '' +- name: 'Platform: Ruby' + aliases: [] + color: '584774' + description: Pull requests that update Ruby code +- name: 'Platform: Rust' + aliases: [] + color: '584774' + description: '' +- name: 'Platform: Symfony' + aliases: [] + color: '584774' + description: '' +- name: 'Platform: Unity' + aliases: [] + color: '584774' + description: '' +- name: 'Platform: Unreal' + aliases: [] + color: '584774' + description: '' +- name: 'Platform: Xamarin' + aliases: [] + color: '584774' + description: '' +- name: Product Docs + aliases: [] + color: F31984 + description: '' +- name: projects + aliases: [] + color: F6F6F8 + description: '' +- name: question + aliases: [] + color: F6F6F8 + description: '' +- name: release health + aliases: [] + color: F6F6F8 + description: '' +- name: 'Status: As Designed' + aliases: [] + color: 8D5494 + description: '' +- name: 'Status: Backlog' + aliases: [] + color: 8D5494 + description: stalebot will ignore +- name: 'Status: Done' + aliases: [] + color: 8D5494 + description: '' +- name: 'Status: In Progress' + aliases: [] + color: 8D5494 + description: stalebot will ignore +- name: 'Status: Invalid' + aliases: [] + color: 8D5494 + description: '' +- name: 'Status: Needs More Information' + aliases: [] + color: 8D5494 + description: stalebot will close after four weeks of inactivity +- name: 'Status: Stale' + aliases: [] + color: 8D5494 + description: stalebot will close after another week of inactivity +- name: 'Status: Unrouted' + aliases: [] + color: 8D5494 + description: stalebot will close after four weeks of inactivity +- name: 'Status: Untriaged' + aliases: [] + color: 8D5494 + description: stalebot will close after four weeks of inactivity +- name: 'Status: Won''t Fix' + aliases: [] + color: 8D5494 + description: '' +- name: 'Sync: Jira' + aliases: [] + color: A0CABD + description: apply to auto-create a Jira shadow ticket +- name: 'Team: Crons' + aliases: [] + color: 8D5494 + description: '' +- name: 'Team: Docs' + aliases: [] + color: 8D5494 + description: '' +- name: 'Team: Ecosystem' + aliases: [] + color: 8D5494 + description: '' +- name: 'Team: Emerging Technology' + aliases: [] + color: 8D5494 + description: emerging-technology +- name: 'Team: Enterprise' + aliases: [] + color: 8D5494 + description: '' +- name: 'Team: Front End' + aliases: [] + color: 8D5494 + description: app-frontend +- name: 'Team: Infrastructure' + aliases: [] + color: 8D5494 + description: '' +- name: 'Team: Ingest' + aliases: [] + color: 8D5494 + description: owners-ingest +- name: 'Team: Mobile Platform' + aliases: [] + color: 8D5494 + description: team-mobile +- name: 'Team: Native Platform' + aliases: [] + color: 8D5494 + description: owners-native +- name: 'Team: Open Source' + aliases: [] + color: 8D5494 + description: '' +- name: 'Team: Ops' + aliases: [] + color: 8D5494 + description: '' +- name: 'Team: Replay' + aliases: [] + color: 8D5494 + description: team-replay +- name: 'Team: Revenue' + aliases: [] + color: 8D5494 + description: '' +- name: 'Team: Search & Storage' + aliases: [] + color: 8D5494 + description: sns +- name: 'Team: Telemetry Experience' + aliases: [] + color: 8D5494 + description: telemetry experience team +- name: 'Team: Visibility' + aliases: [] + color: 8D5494 + description: '' +- name: 'Team: Web Frontend' + aliases: [] + color: 8D5494 + description: team-web-sdk-frontend +- name: 'Team: Web SDK Backend' + aliases: [] + color: 8D5494 + description: team-web-sdk-backend +- name: 'Team: Workflow' + aliases: [] + color: 8D5494 + description: '' +- name: up-for-grabs + aliases: [] + color: F6F6F8 + description: '' +- name: wip + aliases: [] + color: F6F6F8 + description: '' +- name: wontfix + aliases: [] + color: F6F6F8 + description: '' From 6db7cf4fd3923b0f1000d3fb580dd409ebfe6450 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Fri, 28 Apr 2023 16:30:00 -0400 Subject: [PATCH 4/5] Relax for first PR --- .github/workflows/sync-labels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index e5ebeaf506fd7..78c749b8f6e8b 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -32,6 +32,7 @@ jobs: github-label-sync \ --access-token ${{ secrets.GITHUB_TOKEN }} \ --labels .github/labels.yml \ + --allow-added-labels \ ${{ github.event_name == 'pull_request' && '--dry-run' || '' }} \ ${{ github.repository }} \ 2>&1 | tee sync-report.txt From 8637f5c6cde35189e64aed44ca6cd4af3a16be2a Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Fri, 28 Apr 2023 16:31:45 -0400 Subject: [PATCH 5/5] Hrm ... unrelax? --- .github/workflows/sync-labels.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 78c749b8f6e8b..e5ebeaf506fd7 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -32,7 +32,6 @@ jobs: github-label-sync \ --access-token ${{ secrets.GITHUB_TOKEN }} \ --labels .github/labels.yml \ - --allow-added-labels \ ${{ github.event_name == 'pull_request' && '--dry-run' || '' }} \ ${{ github.repository }} \ 2>&1 | tee sync-report.txt