From c23bfe9b2bfc7397150a9caa4a0b84cc36637d2c Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Tue, 2 May 2023 14:58:12 -0700 Subject: [PATCH 01/21] Move triage-needed flow to repository --- .github/workflows/triage-info-needed.yml | 100 ++++++----------------- 1 file changed, 25 insertions(+), 75 deletions(-) diff --git a/.github/workflows/triage-info-needed.yml b/.github/workflows/triage-info-needed.yml index 51c5b610f03f..d31fef2911ff 100644 --- a/.github/workflows/triage-info-needed.yml +++ b/.github/workflows/triage-info-needed.yml @@ -11,86 +11,36 @@ jobs: add_label: runs-on: ubuntu-latest if: contains(github.event.issue.labels.*.name, 'triage-needed') && !contains(github.event.issue.labels.*.name, 'info-needed') - env: - KEYWORDS: '["\\?", "please", "kindly", "let me know", "try", "can you", "could you", "would you", "may I", "provide", "let us know", "tell me", "give me", "send me", "what", "when", "where", "why", "how"]' steps: - - name: Check for author - uses: actions/github-script@v6 + - name: Checkout Actions + uses: actions/checkout@v3 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const issue = await github.rest.issues.get({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number - }); - const commentAuthor = context.payload.comment.user.login; - const commentBody = context.payload.comment.body; - const isTeamMember = ${{ env.TRIAGERS }}.includes(commentAuthor); - - const keywords = ${{ env.KEYWORDS }}; - const isRequestForInfo = new RegExp(keywords.join('|'), 'i').test(commentBody); - - const shouldAddLabel = isTeamMember && commentAuthor !== issue.data.user.login && isRequestForInfo; - - if (shouldAddLabel) { - await github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - labels: ['info-needed'] - }); - } + repository: 'microsoft/vscode-github-triage-actions' + path: ./actions + ref: stable + - name: Install Actions + run: npm install --production --prefix ./actions + - name: Add "info-needed" label + uses: ./actions/triage-info-needed + with: + triagers: ${{ env.TRIAGERS }} + action: 'add' + token: ${{secrets.GITHUB_TOKEN}} remove_label: if: contains(github.event.issue.labels.*.name, 'info-needed') && contains(github.event.issue.labels.*.name, 'triage-needed') runs-on: ubuntu-latest steps: - - name: Check for author - uses: actions/github-script@v6 + - name: Checkout Actions + uses: actions/checkout@v3 + with: + repository: 'microsoft/vscode-github-triage-actions' + path: ./actions + ref: stable + - name: Install Actions + run: npm install --production --prefix ./actions + - name: Remove "info-needed" label + uses: ./actions/triage-info-needed with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const issue = await github.rest.issues.get({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number - }); - const commentAuthor = context.payload.comment.user.login; - const issueAuthor = issue.data.user.login; - if (commentAuthor === issueAuthor) { - await github.rest.issues.removeLabel({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - name: 'info-needed' - }); - return; - } - if (${{ env.TRIAGERS }}.includes(commentAuthor)) { - // If one of triagers made a comment, ignore it - return; - } - // Loop through all the comments on the issue in reverse order and find the last username that a TRIAGER mentioned - // If the comment author is the last mentioned username, remove the "info-needed" label - const comments = await github.rest.issues.listComments({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number - }); - for (const comment of comments.data.slice().reverse()) { - if (!${{ env.TRIAGERS }}.includes(comment.user.login)) { - continue; - } - const matches = comment.body.match(/@\w+/g) || []; - const mentionedUsernames = matches.map(match => match.replace('@', '')); - if (mentionedUsernames.includes(commentAuthor)) { - await github.rest.issues.removeLabel({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - name: 'info-needed' - }); - break; - } - } + triagers: ${{ env.TRIAGERS }} + action: 'remove' From ffd9527649b47b5ee796d663b00f2c9ecd799e30 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Tue, 2 May 2023 15:07:04 -0700 Subject: [PATCH 02/21] Use my repo --- .github/workflows/triage-info-needed.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/triage-info-needed.yml b/.github/workflows/triage-info-needed.yml index d31fef2911ff..f20afabbe45c 100644 --- a/.github/workflows/triage-info-needed.yml +++ b/.github/workflows/triage-info-needed.yml @@ -15,7 +15,7 @@ jobs: - name: Checkout Actions uses: actions/checkout@v3 with: - repository: 'microsoft/vscode-github-triage-actions' + repository: 'karrtikr/vscode-python-github-actions' path: ./actions ref: stable - name: Install Actions @@ -34,7 +34,7 @@ jobs: - name: Checkout Actions uses: actions/checkout@v3 with: - repository: 'microsoft/vscode-github-triage-actions' + repository: 'karrtikr/vscode-python-github-actions' path: ./actions ref: stable - name: Install Actions From 7374ad82a4cb39b37b016895421a514e65382b35 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Tue, 2 May 2023 15:14:31 -0700 Subject: [PATCH 03/21] Remove ref --- .github/workflows/triage-info-needed.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/triage-info-needed.yml b/.github/workflows/triage-info-needed.yml index f20afabbe45c..c3b883ddee99 100644 --- a/.github/workflows/triage-info-needed.yml +++ b/.github/workflows/triage-info-needed.yml @@ -17,7 +17,6 @@ jobs: with: repository: 'karrtikr/vscode-python-github-actions' path: ./actions - ref: stable - name: Install Actions run: npm install --production --prefix ./actions - name: Add "info-needed" label @@ -36,7 +35,6 @@ jobs: with: repository: 'karrtikr/vscode-python-github-actions' path: ./actions - ref: stable - name: Install Actions run: npm install --production --prefix ./actions - name: Remove "info-needed" label From 59913759d6ed2f055c81907d8822b81aa58720b8 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Tue, 2 May 2023 16:14:11 -0700 Subject: [PATCH 04/21] Add commuity feedback comment --- .../community-feedback-auto-comment.yml | 36 +++++++------------ .github/workflows/triage-info-needed.yml | 1 + 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/.github/workflows/community-feedback-auto-comment.yml b/.github/workflows/community-feedback-auto-comment.yml index cbba6db30b50..965e50eb7ffb 100644 --- a/.github/workflows/community-feedback-auto-comment.yml +++ b/.github/workflows/community-feedback-auto-comment.yml @@ -1,30 +1,18 @@ -name: Community Feedback Auto Comment +name: My Workflow on: issues: types: - labeled -jobs: - add-comment: - if: github.event.label.name == 'needs community feedback' - runs-on: ubuntu-latest - - permissions: - issues: write - steps: - - name: Check For Existing Comment - uses: peter-evans/find-comment@v2 - id: finder - with: - issue-number: ${{ github.event.issue.number }} - comment-author: 'github-actions[bot]' - body-includes: Thanks for the feature request! We are going to give the community - - - name: Add Community Feedback Comment - if: steps.finder.outputs.comment-id == '' - uses: peter-evans/create-or-update-comment@v3 - with: - issue-number: ${{ github.event.issue.number }} - body: | - Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue. +jobs: + community-feedback-auto-comment: + - name: Checkout Actions + uses: actions/checkout@v3 + with: + repository: 'karrtikr/vscode-python-github-actions' + path: ./actions + - name: Install Actions + run: npm install --production --prefix ./actions + - name: Add community feedback auto comment if applicable + uses: ./actions/community-feedback-auto-comment diff --git a/.github/workflows/triage-info-needed.yml b/.github/workflows/triage-info-needed.yml index c3b883ddee99..fabb17ffa484 100644 --- a/.github/workflows/triage-info-needed.yml +++ b/.github/workflows/triage-info-needed.yml @@ -42,3 +42,4 @@ jobs: with: triagers: ${{ env.TRIAGERS }} action: 'remove' + token: ${{secrets.GITHUB_TOKEN}} From be5e3aa9acae035cd362ae136c6f4c0ba368b400 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Tue, 2 May 2023 16:22:29 -0700 Subject: [PATCH 05/21] Update --- .../community-feedback-auto-comment.yml | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/community-feedback-auto-comment.yml b/.github/workflows/community-feedback-auto-comment.yml index 965e50eb7ffb..ca06acff2c57 100644 --- a/.github/workflows/community-feedback-auto-comment.yml +++ b/.github/workflows/community-feedback-auto-comment.yml @@ -1,18 +1,26 @@ -name: My Workflow +name: Community Feedback Auto Comment on: issues: types: - labeled - jobs: - community-feedback-auto-comment: - - name: Checkout Actions - uses: actions/checkout@v3 - with: - repository: 'karrtikr/vscode-python-github-actions' - path: ./actions - - name: Install Actions - run: npm install --production --prefix ./actions - - name: Add community feedback auto comment if applicable - uses: ./actions/community-feedback-auto-comment + add-comment: + if: github.event.label.name == 'needs community feedback' + runs-on: ubuntu-latest + + permissions: + issues: write + + steps: + - name: Check For Existing Comment + uses: peter-evans/find-comment@v2 + id: finder + with: + issue-number: ${{ github.event.issue.number }} + + - name: Add Community Feedback Comment + if: steps.finder.outputs.comment-id == '' + uses: peter-evans/create-or-update-comment@v3 + with: + issue-number: ${{ github.event.issue.number }} From e93ed5ffafbf0e0fab5ec133211e8a27d8f9965d Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Tue, 2 May 2023 16:37:28 -0700 Subject: [PATCH 06/21] How a --- .github/workflows/community-feedback-auto-comment.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/community-feedback-auto-comment.yml b/.github/workflows/community-feedback-auto-comment.yml index ca06acff2c57..42406549626b 100644 --- a/.github/workflows/community-feedback-auto-comment.yml +++ b/.github/workflows/community-feedback-auto-comment.yml @@ -18,9 +18,12 @@ jobs: id: finder with: issue-number: ${{ github.event.issue.number }} + body-includes: Thanks for the feature request! We are going to give the community - name: Add Community Feedback Comment if: steps.finder.outputs.comment-id == '' uses: peter-evans/create-or-update-comment@v3 with: issue-number: ${{ github.event.issue.number }} + body: | + Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue. From e03687be4bec18042c475759c998e1699cffcddd Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Tue, 2 May 2023 16:39:18 -0700 Subject: [PATCH 07/21] k --- .../community-feedback-auto-comment.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/community-feedback-auto-comment.yml b/.github/workflows/community-feedback-auto-comment.yml index 42406549626b..54e5781cd54c 100644 --- a/.github/workflows/community-feedback-auto-comment.yml +++ b/.github/workflows/community-feedback-auto-comment.yml @@ -13,17 +13,14 @@ jobs: issues: write steps: - - name: Check For Existing Comment - uses: peter-evans/find-comment@v2 - id: finder + - name: Checkout Actions + uses: actions/checkout@v3 with: - issue-number: ${{ github.event.issue.number }} - body-includes: Thanks for the feature request! We are going to give the community - - - name: Add Community Feedback Comment - if: steps.finder.outputs.comment-id == '' - uses: peter-evans/create-or-update-comment@v3 + repository: 'karrtikr/vscode-python-github-actions' + path: ./actions + - name: Install Actions + run: npm install --production --prefix ./actions + - name: Add Community Feedback Comment if applicable + uses: ./actions/community-feedback-auto-comment with: issue-number: ${{ github.event.issue.number }} - body: | - Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue. From 5453e50f92faedc59cc7d5990795c9606bd0227d Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Tue, 2 May 2023 17:10:06 -0700 Subject: [PATCH 08/21] As --- .github/workflows/issue-labels.yml | 63 ++++++------------------------ 1 file changed, 12 insertions(+), 51 deletions(-) diff --git a/.github/workflows/issue-labels.yml b/.github/workflows/issue-labels.yml index 520592be2fce..ffed05979daf 100644 --- a/.github/workflows/issue-labels.yml +++ b/.github/workflows/issue-labels.yml @@ -18,55 +18,16 @@ jobs: name: "Add 'triage-needed' and remove unrecognizable labels & assignees" runs-on: ubuntu-latest steps: - - uses: actions/github-script@v6 + - name: Checkout Actions + uses: actions/checkout@v3 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const result = await github.rest.issues.listLabelsOnIssue({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - }) - const labels = result.data.map((label) => label.name) - const hasNeedsOrTPI = labels.some((label) => (label.startsWith('needs') || label === 'testplan-item' || label.startsWith('iteration-plan') || label === 'release-plan')) - - if (!hasNeedsOrTPI) { - console.log('This issue is not labeled with a "needs __", "iteration-plan", "release-plan", or the "testplan-item" label; add the "triage-needed" label.') - - github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - labels: ['triage-needed'] - }) - } else { - console.log('This issue already has a "needs __", "iteration-plan", "release-plan", or the "testplan-item" label, do not add the "triage-needed" label.') - } - const knownTriagers = ${{ env.TRIAGERS }} - const currentAssignees = await github.rest.issues - .get({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - }) - .then((result) => result.data.assignees.map((a) => a.login)); - console.log('Known triagers:', JSON.stringify(knownTriagers)); - console.log('Current assignees:', JSON.stringify(currentAssignees)); - const assigneesToRemove = currentAssignees.filter(a => !knownTriagers.includes(a)); - console.log('Assignees to remove:', JSON.stringify(assigneesToRemove)); - github.rest.issues.removeAssignees({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - assignees: assigneesToRemove, - }); - const knownLabels = ${{ env.REPO_LABELS }} - for( const label of labels) { - if (!knownLabels.includes(label)) { - await github.rest.issues.deleteLabel({ - owner: context.repo.owner, - repo: context.repo.repo, - name: label, - }) - } - } + repository: 'karrtikr/vscode-python-github-actions' + path: ./actions + - name: Install Actions + run: npm install --production --prefix ./actions + - name: "Add 'triage-needed' and remove unrecognizable labels & assignees" + uses: ./actions/issue-labels + with: + triagers: ${{ env.TRIAGERS }} + token: ${{secrets.GITHUB_TOKEN}} + repo_labels: ${{ env.REPO_LABELS }} From 6934ea85fc759f827abd33ce9bdb43034e9ad598 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Wed, 3 May 2023 15:03:56 -0700 Subject: [PATCH 09/21] Refacor lock issues --- .github/workflows/lock-issues.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lock-issues.yml b/.github/workflows/lock-issues.yml index 6417d415fcfe..2a2024108d78 100644 --- a/.github/workflows/lock-issues.yml +++ b/.github/workflows/lock-issues.yml @@ -15,9 +15,14 @@ jobs: lock-issues: runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@v4 + - name: Checkout Actions + uses: actions/checkout@v3 with: - github-token: ${{ github.token }} - issue-inactive-days: '30' - process-only: 'issues' - log-output: true + repository: 'karrtikr/vscode-python-github-actions' + path: ./actions + - name: Install Actions + run: npm install --production --prefix ./actions + - name: 'Lock Issues' + uses: ./actions/lock-issues + with: + token: ${{ github.token }} From 3e849bd3abfdc69bcb0764e0fbc61305c3871ad6 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Wed, 3 May 2023 16:21:45 -0700 Subject: [PATCH 10/21] Use microsoft repo --- .github/workflows/community-feedback-auto-comment.yml | 2 +- .github/workflows/issue-labels.yml | 2 +- .github/workflows/lock-issues.yml | 2 +- .github/workflows/triage-info-needed.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/community-feedback-auto-comment.yml b/.github/workflows/community-feedback-auto-comment.yml index 54e5781cd54c..8627972e65a6 100644 --- a/.github/workflows/community-feedback-auto-comment.yml +++ b/.github/workflows/community-feedback-auto-comment.yml @@ -16,7 +16,7 @@ jobs: - name: Checkout Actions uses: actions/checkout@v3 with: - repository: 'karrtikr/vscode-python-github-actions' + repository: 'microsoft/vscode-python-engineering' path: ./actions - name: Install Actions run: npm install --production --prefix ./actions diff --git a/.github/workflows/issue-labels.yml b/.github/workflows/issue-labels.yml index ffed05979daf..cd92e58be93f 100644 --- a/.github/workflows/issue-labels.yml +++ b/.github/workflows/issue-labels.yml @@ -21,7 +21,7 @@ jobs: - name: Checkout Actions uses: actions/checkout@v3 with: - repository: 'karrtikr/vscode-python-github-actions' + repository: 'microsoft/vscode-python-engineering' path: ./actions - name: Install Actions run: npm install --production --prefix ./actions diff --git a/.github/workflows/lock-issues.yml b/.github/workflows/lock-issues.yml index 2a2024108d78..c4c78cbaf5cb 100644 --- a/.github/workflows/lock-issues.yml +++ b/.github/workflows/lock-issues.yml @@ -18,7 +18,7 @@ jobs: - name: Checkout Actions uses: actions/checkout@v3 with: - repository: 'karrtikr/vscode-python-github-actions' + repository: 'microsoft/vscode-python-engineering' path: ./actions - name: Install Actions run: npm install --production --prefix ./actions diff --git a/.github/workflows/triage-info-needed.yml b/.github/workflows/triage-info-needed.yml index fabb17ffa484..868e773cefc6 100644 --- a/.github/workflows/triage-info-needed.yml +++ b/.github/workflows/triage-info-needed.yml @@ -15,7 +15,7 @@ jobs: - name: Checkout Actions uses: actions/checkout@v3 with: - repository: 'karrtikr/vscode-python-github-actions' + repository: 'microsoft/vscode-python-engineering' path: ./actions - name: Install Actions run: npm install --production --prefix ./actions @@ -33,7 +33,7 @@ jobs: - name: Checkout Actions uses: actions/checkout@v3 with: - repository: 'karrtikr/vscode-python-github-actions' + repository: 'microsoft/vscode-python-engineering' path: ./actions - name: Install Actions run: npm install --production --prefix ./actions From 5b5be2c5e5924f99416990574cc259f135a36211 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Wed, 3 May 2023 16:30:16 -0700 Subject: [PATCH 11/21] pr file check --- .github/workflows/pr-file-check.yml | 33 +++++++---------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/.github/workflows/pr-file-check.yml b/.github/workflows/pr-file-check.yml index 3eb7ad7b6338..e398221be31c 100644 --- a/.github/workflows/pr-file-check.yml +++ b/.github/workflows/pr-file-check.yml @@ -15,29 +15,12 @@ jobs: name: 'Check for changed files' runs-on: ubuntu-latest steps: - - name: 'package-lock.json matches package.json' - uses: brettcannon/check-for-changed-files@v1.1.0 + - name: Checkout Actions + uses: actions/checkout@v3 with: - prereq-pattern: 'package.json' - file-pattern: 'package-lock.json' - skip-label: 'skip package*.json' - failure-message: '${prereq-pattern} was edited but ${file-pattern} was not (the ${skip-label} label can be used to pass this check)' - - - name: 'package.json matches package-lock.json' - uses: brettcannon/check-for-changed-files@v1.1.0 - with: - prereq-pattern: 'package-lock.json' - file-pattern: 'package.json' - skip-label: 'skip package*.json' - failure-message: '${prereq-pattern} was edited but ${file-pattern} was not (the ${skip-label} label can be used to pass this check)' - - - name: 'Tests' - uses: brettcannon/check-for-changed-files@v1.1.0 - with: - prereq-pattern: src/**/*.ts - file-pattern: | - src/**/*.test.ts - src/**/*.testvirtualenvs.ts - .github/test_plan.md - skip-label: 'skip tests' - failure-message: 'TypeScript code was edited without also editing a ${file-pattern} file; see the Testing page in our wiki on testing guidelines (the ${skip-label} label can be used to pass this check)' + repository: 'microsoft/vscode-python-engineering' + path: ./actions + - name: Install Actions + run: npm install --production --prefix ./actions + - name: Check for changed files + uses: ./actions/pr-file-check From 4e679e9401c9d29179c073657ba12202cd567319 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Wed, 3 May 2023 16:33:02 -0700 Subject: [PATCH 12/21] hello --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fd6ddcea84ca..5e07a9b4e696 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "envCollectionWorkspace" ], "author": { - "name": "Microsoft Corporation" + "name": "Microsoft Corporationsasd" }, "license": "MIT", "homepage": "https://github.com/Microsoft/vscode-python", From 8043b719abe0e15776d7ab7a5990b4141ea816f3 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Wed, 3 May 2023 16:38:53 -0700 Subject: [PATCH 13/21] Use pr label action --- .github/workflows/pr-labels.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml index e953f62d2011..0f58620cf276 100644 --- a/.github/workflows/pr-labels.yml +++ b/.github/workflows/pr-labels.yml @@ -13,9 +13,12 @@ jobs: name: 'Classify PR' runs-on: ubuntu-latest steps: - - name: 'PR impact specified' - uses: mheap/github-action-required-labels@v4 + - name: Checkout Actions + uses: actions/checkout@v3 with: - mode: exactly - count: 1 - labels: 'bug, debt, feature-request, no-changelog' + repository: 'microsoft/vscode-python-engineering' + path: ./actions + - name: Install Actions + run: npm install --production --prefix ./actions + - name: Classify PR + uses: ./actions/pr-labels From 55e25366400580078e4d390b10e14d141228b2eb Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Wed, 3 May 2023 16:40:24 -0700 Subject: [PATCH 14/21] hiya --- .github/workflows/pr-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml index 0f58620cf276..2936a9a766e2 100644 --- a/.github/workflows/pr-labels.yml +++ b/.github/workflows/pr-labels.yml @@ -10,7 +10,7 @@ on: jobs: classify: - name: 'Classify PR' + name: 'Classiasdsadfy PR' runs-on: ubuntu-latest steps: - name: Checkout Actions From 73fdaac02afeaaeb1826447b03431c7aa5f8b5bc Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Wed, 3 May 2023 16:48:21 -0700 Subject: [PATCH 15/21] Correct --- .github/workflows/pr-labels.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml index 2936a9a766e2..0f58620cf276 100644 --- a/.github/workflows/pr-labels.yml +++ b/.github/workflows/pr-labels.yml @@ -10,7 +10,7 @@ on: jobs: classify: - name: 'Classiasdsadfy PR' + name: 'Classify PR' runs-on: ubuntu-latest steps: - name: Checkout Actions diff --git a/package.json b/package.json index 5e07a9b4e696..fd6ddcea84ca 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "envCollectionWorkspace" ], "author": { - "name": "Microsoft Corporationsasd" + "name": "Microsoft Corporation" }, "license": "MIT", "homepage": "https://github.com/Microsoft/vscode-python", From acd89be8939a737ae73fa319c46c94bc90e471f7 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Wed, 3 May 2023 16:52:51 -0700 Subject: [PATCH 16/21] Use lint from separate repo --- .github/actions/lint/action.yml | 49 --------------------------------- .github/workflows/build.yml | 10 +++++-- .github/workflows/pr-check.yml | 10 +++++-- 3 files changed, 14 insertions(+), 55 deletions(-) delete mode 100644 .github/actions/lint/action.yml diff --git a/.github/actions/lint/action.yml b/.github/actions/lint/action.yml deleted file mode 100644 index 9478550c107b..000000000000 --- a/.github/actions/lint/action.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: 'Lint' -description: 'Lint TypeScript and Python code' - -inputs: - node_version: - description: 'Version of Node to install' - required: true - -runs: - using: 'composite' - steps: - - name: Install Node - uses: actions/setup-node@v2 - with: - node-version: ${{ inputs.node_version }} - cache: 'npm' - - - name: Install Node dependencies - run: npm ci --prefer-offline - shell: bash - - - name: Run `gulp prePublishNonBundle` - run: npx gulp prePublishNonBundle - shell: bash - - - name: Check dependencies - run: npm run checkDependencies - shell: bash - - - name: Lint TypeScript code - run: npm run lint - shell: bash - - - name: Check TypeScript format - run: npm run format-check - shell: bash - - - name: Install Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - cache: 'pip' - - - name: Check Python format - run: | - python -m pip install -U black - python -m black . --check - working-directory: pythonFiles - shell: bash diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 805077ffdb46..7c15296d8cb7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,11 +63,15 @@ jobs: if: github.repository == 'microsoft/vscode-python' runs-on: ubuntu-latest steps: - - name: Checkout + - name: Checkout Actions uses: actions/checkout@v3 - + with: + repository: 'microsoft/vscode-python-engineering' + path: ./actions + - name: Install Actions + run: npm install --production --prefix ./actions - name: Lint - uses: ./.github/actions/lint + uses: ./actions/lint with: node_version: ${{ env.NODE_VERSION }} diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 2ac560af995d..d1b6bc147f52 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -38,11 +38,15 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - name: Checkout + - name: Checkout Actions uses: actions/checkout@v3 - + with: + repository: 'microsoft/vscode-python-engineering' + path: ./actions + - name: Install Actions + run: npm install --production --prefix ./actions - name: Lint - uses: ./.github/actions/lint + uses: ./actions/lint with: node_version: ${{ env.NODE_VERSION }} From 004c66140b058fb0081ac4b1cb53af83cd1a3b0f Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Thu, 4 May 2023 00:41:31 -0700 Subject: [PATCH 17/21] Fix lint --- .github/workflows/build.yml | 4 +++- .github/workflows/pr-check.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c15296d8cb7..ec737ce7177a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,8 +70,10 @@ jobs: path: ./actions - name: Install Actions run: npm install --production --prefix ./actions + - name: Checkout Actions + uses: actions/checkout@v3 - name: Lint - uses: ./actions/lint + uses: ./.github/actions/lint with: node_version: ${{ env.NODE_VERSION }} diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index d1b6bc147f52..8edf176041e1 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -45,8 +45,10 @@ jobs: path: ./actions - name: Install Actions run: npm install --production --prefix ./actions + - name: Checkout Actions + uses: actions/checkout@v3 - name: Lint - uses: ./actions/lint + uses: ./.github/actions/lint with: node_version: ${{ env.NODE_VERSION }} From c249a964897b00f62080c64af79fe4eac236926f Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Thu, 4 May 2023 00:44:28 -0700 Subject: [PATCH 18/21] shot in the dark --- .github/workflows/build.yml | 2 +- .github/workflows/pr-check.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ec737ce7177a..987ee5f4fb97 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,7 +73,7 @@ jobs: - name: Checkout Actions uses: actions/checkout@v3 - name: Lint - uses: ./.github/actions/lint + uses: ./actions/lint with: node_version: ${{ env.NODE_VERSION }} diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 8edf176041e1..7f16050df43e 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -48,7 +48,7 @@ jobs: - name: Checkout Actions uses: actions/checkout@v3 - name: Lint - uses: ./.github/actions/lint + uses: ./actions/lint with: node_version: ${{ env.NODE_VERSION }} From 0697223c8ab2e8c3434996c05ecd4859b15cba03 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Thu, 4 May 2023 01:01:02 -0700 Subject: [PATCH 19/21] Restore lint yml --- .github/actions/lint/action.yml | 49 +++++++++++++++++++++++++++++++++ .github/workflows/build.yml | 12 ++------ .github/workflows/pr-check.yml | 12 ++------ 3 files changed, 55 insertions(+), 18 deletions(-) create mode 100644 .github/actions/lint/action.yml diff --git a/.github/actions/lint/action.yml b/.github/actions/lint/action.yml new file mode 100644 index 000000000000..9478550c107b --- /dev/null +++ b/.github/actions/lint/action.yml @@ -0,0 +1,49 @@ +name: 'Lint' +description: 'Lint TypeScript and Python code' + +inputs: + node_version: + description: 'Version of Node to install' + required: true + +runs: + using: 'composite' + steps: + - name: Install Node + uses: actions/setup-node@v2 + with: + node-version: ${{ inputs.node_version }} + cache: 'npm' + + - name: Install Node dependencies + run: npm ci --prefer-offline + shell: bash + + - name: Run `gulp prePublishNonBundle` + run: npx gulp prePublishNonBundle + shell: bash + + - name: Check dependencies + run: npm run checkDependencies + shell: bash + + - name: Lint TypeScript code + run: npm run lint + shell: bash + + - name: Check TypeScript format + run: npm run format-check + shell: bash + + - name: Install Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + cache: 'pip' + + - name: Check Python format + run: | + python -m pip install -U black + python -m black . --check + working-directory: pythonFiles + shell: bash diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 987ee5f4fb97..805077ffdb46 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,17 +63,11 @@ jobs: if: github.repository == 'microsoft/vscode-python' runs-on: ubuntu-latest steps: - - name: Checkout Actions - uses: actions/checkout@v3 - with: - repository: 'microsoft/vscode-python-engineering' - path: ./actions - - name: Install Actions - run: npm install --production --prefix ./actions - - name: Checkout Actions + - name: Checkout uses: actions/checkout@v3 + - name: Lint - uses: ./actions/lint + uses: ./.github/actions/lint with: node_version: ${{ env.NODE_VERSION }} diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 7f16050df43e..2ac560af995d 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -38,17 +38,11 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - name: Checkout Actions - uses: actions/checkout@v3 - with: - repository: 'microsoft/vscode-python-engineering' - path: ./actions - - name: Install Actions - run: npm install --production --prefix ./actions - - name: Checkout Actions + - name: Checkout uses: actions/checkout@v3 + - name: Lint - uses: ./actions/lint + uses: ./.github/actions/lint with: node_version: ${{ env.NODE_VERSION }} From 6a5402d039f69e8265812f6a7832215008ff8d92 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Thu, 4 May 2023 10:49:13 -0700 Subject: [PATCH 20/21] Use `microsoft/vscode-github-triage-actions` instead --- .github/workflows/community-feedback-auto-comment.yml | 5 +++-- .github/workflows/issue-labels.yml | 5 +++-- .github/workflows/lock-issues.yml | 5 +++-- .github/workflows/pr-file-check.yml | 5 +++-- .github/workflows/pr-labels.yml | 5 +++-- .github/workflows/triage-info-needed.yml | 10 ++++++---- 6 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/community-feedback-auto-comment.yml b/.github/workflows/community-feedback-auto-comment.yml index 8627972e65a6..74fc2ef35f80 100644 --- a/.github/workflows/community-feedback-auto-comment.yml +++ b/.github/workflows/community-feedback-auto-comment.yml @@ -16,11 +16,12 @@ jobs: - name: Checkout Actions uses: actions/checkout@v3 with: - repository: 'microsoft/vscode-python-engineering' + repository: 'microsoft/vscode-github-triage-actions' + ref: stable path: ./actions - name: Install Actions run: npm install --production --prefix ./actions - name: Add Community Feedback Comment if applicable - uses: ./actions/community-feedback-auto-comment + uses: ./actions/python-community-feedback-auto-comment with: issue-number: ${{ github.event.issue.number }} diff --git a/.github/workflows/issue-labels.yml b/.github/workflows/issue-labels.yml index cd92e58be93f..3b2c0adeedb2 100644 --- a/.github/workflows/issue-labels.yml +++ b/.github/workflows/issue-labels.yml @@ -21,12 +21,13 @@ jobs: - name: Checkout Actions uses: actions/checkout@v3 with: - repository: 'microsoft/vscode-python-engineering' + repository: 'microsoft/vscode-github-triage-actions' + ref: stable path: ./actions - name: Install Actions run: npm install --production --prefix ./actions - name: "Add 'triage-needed' and remove unrecognizable labels & assignees" - uses: ./actions/issue-labels + uses: ./actions/python-issue-labels with: triagers: ${{ env.TRIAGERS }} token: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/lock-issues.yml b/.github/workflows/lock-issues.yml index c4c78cbaf5cb..fb442d765437 100644 --- a/.github/workflows/lock-issues.yml +++ b/.github/workflows/lock-issues.yml @@ -18,11 +18,12 @@ jobs: - name: Checkout Actions uses: actions/checkout@v3 with: - repository: 'microsoft/vscode-python-engineering' + repository: 'microsoft/vscode-github-triage-actions' + ref: stable path: ./actions - name: Install Actions run: npm install --production --prefix ./actions - name: 'Lock Issues' - uses: ./actions/lock-issues + uses: ./actions/python-lock-issues with: token: ${{ github.token }} diff --git a/.github/workflows/pr-file-check.yml b/.github/workflows/pr-file-check.yml index e398221be31c..4f9461cfafe0 100644 --- a/.github/workflows/pr-file-check.yml +++ b/.github/workflows/pr-file-check.yml @@ -18,9 +18,10 @@ jobs: - name: Checkout Actions uses: actions/checkout@v3 with: - repository: 'microsoft/vscode-python-engineering' + repository: 'microsoft/vscode-github-triage-actions' + ref: stable path: ./actions - name: Install Actions run: npm install --production --prefix ./actions - name: Check for changed files - uses: ./actions/pr-file-check + uses: ./actions/python-pr-file-check diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml index 0f58620cf276..a474d83da418 100644 --- a/.github/workflows/pr-labels.yml +++ b/.github/workflows/pr-labels.yml @@ -16,9 +16,10 @@ jobs: - name: Checkout Actions uses: actions/checkout@v3 with: - repository: 'microsoft/vscode-python-engineering' + repository: 'microsoft/vscode-github-triage-actions' + ref: stable path: ./actions - name: Install Actions run: npm install --production --prefix ./actions - name: Classify PR - uses: ./actions/pr-labels + uses: ./actions/python-pr-labels diff --git a/.github/workflows/triage-info-needed.yml b/.github/workflows/triage-info-needed.yml index 868e773cefc6..e5d4d2bc7492 100644 --- a/.github/workflows/triage-info-needed.yml +++ b/.github/workflows/triage-info-needed.yml @@ -15,12 +15,13 @@ jobs: - name: Checkout Actions uses: actions/checkout@v3 with: - repository: 'microsoft/vscode-python-engineering' + repository: 'microsoft/vscode-github-triage-actions' + ref: stable path: ./actions - name: Install Actions run: npm install --production --prefix ./actions - name: Add "info-needed" label - uses: ./actions/triage-info-needed + uses: ./actions/python-triage-info-needed with: triagers: ${{ env.TRIAGERS }} action: 'add' @@ -33,12 +34,13 @@ jobs: - name: Checkout Actions uses: actions/checkout@v3 with: - repository: 'microsoft/vscode-python-engineering' + repository: 'microsoft/vscode-github-triage-actions' + ref: stable path: ./actions - name: Install Actions run: npm install --production --prefix ./actions - name: Remove "info-needed" label - uses: ./actions/triage-info-needed + uses: ./actions/python-triage-info-needed with: triagers: ${{ env.TRIAGERS }} action: 'remove' From 6c6fb8ec4585466eaac08f3c69e568a56d9ecb5d Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Thu, 4 May 2023 16:00:43 -0700 Subject: [PATCH 21/21] Code review --- .github/workflows/community-feedback-auto-comment.yml | 2 ++ .github/workflows/issue-labels.yml | 2 ++ .github/workflows/lock-issues.yml | 2 ++ .github/workflows/pr-file-check.yml | 2 ++ .github/workflows/pr-labels.yml | 2 ++ .github/workflows/test-plan-item-validator.yml | 2 ++ .github/workflows/triage-info-needed.yml | 4 ++++ 7 files changed, 16 insertions(+) diff --git a/.github/workflows/community-feedback-auto-comment.yml b/.github/workflows/community-feedback-auto-comment.yml index 74fc2ef35f80..57bbd97bf430 100644 --- a/.github/workflows/community-feedback-auto-comment.yml +++ b/.github/workflows/community-feedback-auto-comment.yml @@ -19,8 +19,10 @@ jobs: repository: 'microsoft/vscode-github-triage-actions' ref: stable path: ./actions + - name: Install Actions run: npm install --production --prefix ./actions + - name: Add Community Feedback Comment if applicable uses: ./actions/python-community-feedback-auto-comment with: diff --git a/.github/workflows/issue-labels.yml b/.github/workflows/issue-labels.yml index 3b2c0adeedb2..98ac4eaca81d 100644 --- a/.github/workflows/issue-labels.yml +++ b/.github/workflows/issue-labels.yml @@ -24,8 +24,10 @@ jobs: repository: 'microsoft/vscode-github-triage-actions' ref: stable path: ./actions + - name: Install Actions run: npm install --production --prefix ./actions + - name: "Add 'triage-needed' and remove unrecognizable labels & assignees" uses: ./actions/python-issue-labels with: diff --git a/.github/workflows/lock-issues.yml b/.github/workflows/lock-issues.yml index fb442d765437..8c828ff766cb 100644 --- a/.github/workflows/lock-issues.yml +++ b/.github/workflows/lock-issues.yml @@ -21,8 +21,10 @@ jobs: repository: 'microsoft/vscode-github-triage-actions' ref: stable path: ./actions + - name: Install Actions run: npm install --production --prefix ./actions + - name: 'Lock Issues' uses: ./actions/python-lock-issues with: diff --git a/.github/workflows/pr-file-check.yml b/.github/workflows/pr-file-check.yml index 4f9461cfafe0..258e07daace7 100644 --- a/.github/workflows/pr-file-check.yml +++ b/.github/workflows/pr-file-check.yml @@ -21,7 +21,9 @@ jobs: repository: 'microsoft/vscode-github-triage-actions' ref: stable path: ./actions + - name: Install Actions run: npm install --production --prefix ./actions + - name: Check for changed files uses: ./actions/python-pr-file-check diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml index a474d83da418..7ddb781e2a85 100644 --- a/.github/workflows/pr-labels.yml +++ b/.github/workflows/pr-labels.yml @@ -19,7 +19,9 @@ jobs: repository: 'microsoft/vscode-github-triage-actions' ref: stable path: ./actions + - name: Install Actions run: npm install --production --prefix ./actions + - name: Classify PR uses: ./actions/python-pr-labels diff --git a/.github/workflows/test-plan-item-validator.yml b/.github/workflows/test-plan-item-validator.yml index 43713049f5e8..9d0805a9db9b 100644 --- a/.github/workflows/test-plan-item-validator.yml +++ b/.github/workflows/test-plan-item-validator.yml @@ -17,8 +17,10 @@ jobs: repository: 'microsoft/vscode-github-triage-actions' path: ./actions ref: stable + - name: Install Actions run: npm install --production --prefix ./actions + - name: Run Test Plan Item Validator uses: ./actions/test-plan-item-validator with: diff --git a/.github/workflows/triage-info-needed.yml b/.github/workflows/triage-info-needed.yml index e5d4d2bc7492..1c384d824da5 100644 --- a/.github/workflows/triage-info-needed.yml +++ b/.github/workflows/triage-info-needed.yml @@ -18,8 +18,10 @@ jobs: repository: 'microsoft/vscode-github-triage-actions' ref: stable path: ./actions + - name: Install Actions run: npm install --production --prefix ./actions + - name: Add "info-needed" label uses: ./actions/python-triage-info-needed with: @@ -37,8 +39,10 @@ jobs: repository: 'microsoft/vscode-github-triage-actions' ref: stable path: ./actions + - name: Install Actions run: npm install --production --prefix ./actions + - name: Remove "info-needed" label uses: ./actions/python-triage-info-needed with: