From f334d433a2f89c656a7c33b6ad034425e7cfee18 Mon Sep 17 00:00:00 2001 From: Bishal <153212508+ibishal@users.noreply.github.com> Date: Thu, 4 Apr 2024 19:38:59 +0530 Subject: [PATCH 1/4] ci: fix the escape character typo in `/ptal` command (#284) --- .github/workflows/help-command.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index ada81682..55353bb8 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -31,7 +31,7 @@ jobs: At the moment the following comments are supported in pull requests: - - \`/please-take-a-look` or \`/ptal\` - This comment will add a comment to the PR asking for attention from the reviewrs who have not reviewed the PR yet. + - \`/please-take-a-look\` or \`/ptal\` - This comment will add a comment to the PR asking for attention from the reviewrs who have not reviewed the PR yet. - \`/ready-to-merge\` or \`/rtm\` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added - \`/do-not-merge\` or \`/dnm\` - This comment will block automerging even if all conditions are met and ready-to-merge label is added - \`/autoupdate\` or \`/au\` - This comment will add \`autoupdate\` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR.` From 69f31a8789ac3cb9ae573d7c0f2bea06197f53f2 Mon Sep 17 00:00:00 2001 From: Bishal <153212508+ibishal@users.noreply.github.com> Date: Thu, 4 Apr 2024 19:41:56 +0530 Subject: [PATCH 2/4] ci: add a filter to check if reviewer is bot or not in `/ptal` command (#285) Co-authored-by: Lukasz Gornicki --- .github/workflows/please-take-a-look-command.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/please-take-a-look-command.yml b/.github/workflows/please-take-a-look-command.yml index 216055ca..b26cbc41 100644 --- a/.github/workflows/please-take-a-look-command.yml +++ b/.github/workflows/please-take-a-look-command.yml @@ -2,8 +2,8 @@ # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo # It uses Github actions to listen for comments on issues and pull requests and -# if the comment contains /ping-for-attention or /pfa it will add a comment pinging -# the code-owners who have not yet reviewed the pull request +# if the comment contains /please-take-a-look or /ptal it will add a comment pinging +# the code-owners who are reviewers for PR name: Please take a Look @@ -44,7 +44,7 @@ jobs: const reviewersWhoHaveNotReviewed = reviewers.filter(reviewer => !reviewersWhoHaveReviewed.includes(reviewer)); if (reviewersWhoHaveNotReviewed.length > 0) { - const comment = reviewersWhoHaveNotReviewed.map(reviewer => `@${reviewer}`).join(' '); + const comment = reviewersWhoHaveNotReviewed.filter(reviewer => reviewer !== 'asyncapi-bot-eve' ).map(reviewer => `@${reviewer}`).join(' '); await github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, From 6f736ec2a4d8e3d364392b08cd5388d032bd1af7 Mon Sep 17 00:00:00 2001 From: Lukasz Gornicki Date: Tue, 9 Apr 2024 18:10:39 +0200 Subject: [PATCH 3/4] ci: improve node testing and release (#287) --- .github/workflows/if-nodejs-pr-testing.yml | 24 ++++++++--------- .github/workflows/if-nodejs-release.yml | 31 ++++++++++------------ 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/.github/workflows/if-nodejs-pr-testing.yml b/.github/workflows/if-nodejs-pr-testing.yml index 73a2af5c..66ea6552 100644 --- a/.github/workflows/if-nodejs-pr-testing.yml +++ b/.github/workflows/if-nodejs-pr-testing.yml @@ -39,9 +39,10 @@ jobs: run: | git config --global core.autocrlf false git config --global core.eol lf + shell: bash - if: steps.should_run.outputs.shouldrun == 'true' name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - if: steps.should_run.outputs.shouldrun == 'true' name: Check if Node.js project and has package.json id: packagejson @@ -53,27 +54,26 @@ jobs: id: lockversion - if: steps.packagejson.outputs.exists == 'true' name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: "${{ steps.lockversion.outputs.version }}" - cache: 'npm' - cache-dependency-path: '**/package-lock.json' + - if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest' + #npm cli 10 is buggy because of some cache issue + name: Install npm cli 8 + shell: bash + run: npm install -g npm@8.19.4 - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies - id: first-installation + shell: bash run: npm ci - continue-on-error: true - - if: steps.first-installation.outcome != 'success' && steps.packagejson.outputs.exists == 'true' - name: Clear NPM cache and install deps again - run: | - npm cache clean --force - npm ci - if: steps.packagejson.outputs.exists == 'true' name: Test run: npm test --if-present - - if: steps.packagejson.outputs.exists == 'true' + - if: steps.packagejson.outputs.exists == 'true' && matrix.os == 'ubuntu-latest' + #linting should run just one and not on all possible operating systems name: Run linter run: npm run lint --if-present - if: steps.packagejson.outputs.exists == 'true' name: Run release assets generation to make sure PR does not break it + shell: bash run: npm run generate:assets --if-present diff --git a/.github/workflows/if-nodejs-release.yml b/.github/workflows/if-nodejs-release.yml index f407e59a..234c5a9c 100644 --- a/.github/workflows/if-nodejs-release.yml +++ b/.github/workflows/if-nodejs-release.yml @@ -38,8 +38,9 @@ jobs: run: | git config --global core.autocrlf false git config --global core.eol lf + shell: bash - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check if Node.js project and has package.json id: packagejson run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT @@ -50,14 +51,18 @@ jobs: id: lockversion - if: steps.packagejson.outputs.exists == 'true' name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: "${{ steps.lockversion.outputs.version }}" - cache: 'npm' - cache-dependency-path: '**/package-lock.json' + - if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest' + name: Install npm cli 8 + shell: bash + #npm cli 10 is buggy because of some cache issues + run: npm install -g npm@8.19.4 - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies - run: npm install + shell: bash + run: npm ci - if: steps.packagejson.outputs.exists == 'true' name: Run test run: npm test --if-present @@ -81,7 +86,7 @@ jobs: git config --global core.autocrlf false git config --global core.eol lf - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check if Node.js project and has package.json id: packagejson run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT @@ -92,21 +97,13 @@ jobs: id: lockversion - if: steps.packagejson.outputs.exists == 'true' name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: "${{ steps.lockversion.outputs.version }}" - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies - id: first-installation + shell: bash run: npm ci - continue-on-error: true - - if: steps.first-installation.outcome != 'success' && steps.packagejson.outputs.exists == 'true' - name: Clear NPM cache and install deps again - run: | - npm cache clean --force - npm ci - if: steps.packagejson.outputs.exists == 'true' name: Add plugin for conventional commits for semantic-release run: npm install --save-dev conventional-changelog-conventionalcommits@5.0.0 @@ -131,4 +128,4 @@ jobs: fields: repo,action,workflow text: 'Release workflow failed in release job' env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} \ No newline at end of file From ac7b58a83d945996b7243dc19c0f49d493547b43 Mon Sep 17 00:00:00 2001 From: Lukasz Gornicki Date: Tue, 9 Apr 2024 18:23:42 +0200 Subject: [PATCH 4/4] ci: use latest bumping action feature to reuse PRs (#288) Co-authored-by: Khuda Dad Nomani <32505158+KhudaDad414@users.noreply.github.com> --- .github/workflows/bump.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml index dff50cfa..1e17ccf2 100644 --- a/.github/workflows/bump.yml +++ b/.github/workflows/bump.yml @@ -26,9 +26,10 @@ jobs: run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT - if: steps.packagejson.outputs.exists == 'true' name: Bumping latest version of this package in other repositories - uses: derberg/npm-dependency-manager-for-your-github-org@3df56be95bcaa5c76a9c9a4af863ab151545b649 # using v6.-.- https://github.com/derberg/npm-dependency-manager-for-your-github-org/releases/tag/v6 + uses: derberg/npm-dependency-manager-for-your-github-org@1eafd3bf3974f21d395c1abac855cb04b295d570 # using v6.-.- https://github.com/derberg/npm-dependency-manager-for-your-github-org/releases/tag/v6 with: github_token: ${{ secrets.GH_TOKEN }} committer_username: asyncapi-bot committer_email: info@asyncapi.io repos_to_ignore: spec,bindings,saunter + custom_id: "dependency update from asyncapi bot"