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 01/18] 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 02/18] 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 03/18] 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 04/18] 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" From 9b309c0c57107cc0df37a0cbe003d4bd6ab805f2 Mon Sep 17 00:00:00 2001 From: Ashish Padhy <100484401+Shurtu-gal@users.noreply.github.com> Date: Thu, 18 Apr 2024 16:16:01 +0530 Subject: [PATCH 05/18] ci: add update pr workflow (#262) Co-authored-by: Lukasz Gornicki --- ...d-ready-to-merge-or-do-not-merge-label.yml | 4 +- .github/workflows/autoupdate.yml | 68 ++++++------ .github/workflows/global-replicator.yml | 2 +- .github/workflows/help-command.yml | 3 +- .github/workflows/update-pr.yml | 102 ++++++++++++++++++ 5 files changed, 142 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/update-pr.yml diff --git a/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml b/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml index 66606fc1..02d71a79 100644 --- a/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml +++ b/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml @@ -59,7 +59,9 @@ jobs: body: `Hello, @${{ github.actor }}! 👋🏼 This PR is not up to date with the base branch and can't be merged. Please update your branch manually with the latest version of the base branch. - PRO-TIP: Add a comment to your PR with the text: \`/au\` or \`/autoupdate\` and our bot will take care of updating the branch in the future. The only requirement for this to work is to enable [Allow edits from maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) option in your PR. + PRO-TIP: To request an update from the upstream branch, simply comment \`/u\` or \`/update\` and our bot will handle the update operation promptly. + + The only requirement for this to work is to enable [Allow edits from maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) option in your PR. Also the update will not work if your fork is located in an organization, not under your personal profile. Thanks 😄` }) } diff --git a/.github/workflows/autoupdate.yml b/.github/workflows/autoupdate.yml index ad8e0198..eeb77a47 100644 --- a/.github/workflows/autoupdate.yml +++ b/.github/workflows/autoupdate.yml @@ -1,34 +1,34 @@ -# This action is centrally managed in https://github.com/asyncapi/.github/ -# 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 - -# This workflow is designed to work with: -# - autoapprove and automerge workflows for dependabot and asyncapibot. -# - special release branches that we from time to time create in upstream repos. If we open up PRs for them from the very beginning of the release, the release branch will constantly update with new things from the destination branch they are opened against - -# It uses GitHub Action that auto-updates pull requests branches, whenever changes are pushed to their destination branch. -# Autoupdating to latest destination branch works only in the context of upstream repo and not forks - -name: autoupdate - -on: - push: - branches-ignore: - - 'version-bump/**' - - 'dependabot/**' - - 'bot/**' - - 'all-contributors/**' - -jobs: - autoupdate-for-bot: - if: startsWith(github.repository, 'asyncapi/') - name: Autoupdate autoapproved PR created in the upstream - runs-on: ubuntu-latest - steps: - - name: Autoupdating - uses: docker://chinthakagodawita/autoupdate-action:v1 - env: - GITHUB_TOKEN: '${{ secrets.GH_TOKEN_BOT_EVE }}' - PR_FILTER: "labelled" - PR_LABELS: "autoupdate" - PR_READY_STATE: "ready_for_review" - MERGE_CONFLICT_ACTION: "ignore" +# This action is centrally managed in https://github.com/asyncapi/.github/ +# 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 + +# This workflow is designed to work with: +# - autoapprove and automerge workflows for dependabot and asyncapibot. +# - special release branches that we from time to time create in upstream repos. If we open up PRs for them from the very beginning of the release, the release branch will constantly update with new things from the destination branch they are opened against + +# It uses GitHub Action that auto-updates pull requests branches, whenever changes are pushed to their destination branch. +# Autoupdating to latest destination branch works only in the context of upstream repo and not forks + +name: autoupdate + +on: + push: + branches-ignore: + - 'version-bump/**' + - 'dependabot/**' + - 'bot/**' + - 'all-contributors/**' + +jobs: + autoupdate-for-bot: + if: startsWith(github.repository, 'asyncapi/') + name: Autoupdate autoapproved PR created in the upstream + runs-on: ubuntu-latest + steps: + - name: Autoupdating + uses: docker://chinthakagodawita/autoupdate-action:v1 + env: + GITHUB_TOKEN: '${{ secrets.GH_TOKEN_BOT_EVE }}' + PR_FILTER: "labelled" + PR_LABELS: "autoupdate" + PR_READY_STATE: "ready_for_review" + MERGE_CONFLICT_ACTION: "ignore" diff --git a/.github/workflows/global-replicator.yml b/.github/workflows/global-replicator.yml index 2e66ff04..66d6e449 100644 --- a/.github/workflows/global-replicator.yml +++ b/.github/workflows/global-replicator.yml @@ -138,7 +138,7 @@ jobs: uses: derberg/manage-files-in-multiple-repositories@beecbe897cf5ed7f3de5a791a3f2d70102fe7c25 with: github_token: ${{ secrets.GH_TOKEN }} - patterns_to_include: .github/workflows/scripts,.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml,.github/workflows/add-good-first-issue-labels.yml,.github/workflows/automerge-for-humans-merging.yml,.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml,.github/workflows/automerge-orphans.yml,.github/workflows/automerge.yml,.github/workflows/autoupdate.yml,.github/workflows/help-command.yml,.github/workflows/issues-prs-notifications.yml,.github/workflows/lint-pr-title.yml,.github/workflows/notify-tsc-members-mention.yml,.github/workflows/stale-issues-prs.yml,.github/workflows/welcome-first-time-contrib.yml,.github/workflows/release-announcements.yml,.github/workflows/bounty-program-commands.yml,.github/workflows/please-take-a-look-command.yml + patterns_to_include: .github/workflows/scripts,.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml,.github/workflows/add-good-first-issue-labels.yml,.github/workflows/automerge-for-humans-merging.yml,.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml,.github/workflows/automerge-orphans.yml,.github/workflows/automerge.yml,.github/workflows/autoupdate.yml,.github/workflows/help-command.yml,.github/workflows/issues-prs-notifications.yml,.github/workflows/lint-pr-title.yml,.github/workflows/notify-tsc-members-mention.yml,.github/workflows/stale-issues-prs.yml,.github/workflows/welcome-first-time-contrib.yml,.github/workflows/release-announcements.yml,.github/workflows/bounty-program-commands.yml,.github/workflows/please-take-a-look-command.yml,.github/workflows/update-pr.yml committer_username: asyncapi-bot committer_email: info@asyncapi.io commit_message: "ci: update of files from global .github repo" diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index 55353bb8..3f4dcbc4 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -34,7 +34,8 @@ jobs: - \`/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.` + - \`/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. (Currently only works for upstream branches.) + - \`/update\` or \`/u\` - This comment will update the PR with the latest changes from the target branch. Unless there is a merge conflict or it is a draft PR. NOTE: this only updates the PR once, so if you need to update again, you need to call the command again.` }) create_help_comment_issue: diff --git a/.github/workflows/update-pr.yml b/.github/workflows/update-pr.yml new file mode 100644 index 00000000..2fa19b0a --- /dev/null +++ b/.github/workflows/update-pr.yml @@ -0,0 +1,102 @@ +# This workflow is centrally managed in https://github.com/asyncapi/.github/ +# 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 + +# This workflow will run on every comment with /update or /u. And will create merge-commits for the PR. +# This also works with forks, not only with branches in the same repository/organization. +# Currently, does not work with forks in different organizations. + +# This workflow will be distributed to all repositories in the AsyncAPI organization + +name: Update PR branches from fork + +on: + issue_comment: + types: [created] + +jobs: + update-pr: + if: > + startsWith(github.repository, 'asyncapi/') && + github.event.issue.pull_request && + github.event.issue.state != 'closed' && ( + contains(github.event.comment.body, '/update') || + contains(github.event.comment.body, '/u') + ) + runs-on: ubuntu-latest + steps: + - name: Get Pull Request Details + id: pr + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} + previews: 'merge-info-preview' # https://docs.github.com/en/graphql/overview/schema-previews#merge-info-preview-more-detailed-information-about-a-pull-requests-merge-state-preview + script: | + const prNumber = context.payload.issue.number; + core.debug(`PR Number: ${prNumber}`); + const { data: pr } = await github.rest.pulls.get({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: prNumber + }); + + // If the PR has conflicts, we don't want to update it + const updateable = ['behind', 'blocked', 'unknown', 'draft', 'clean'].includes(pr.mergeable_state); + console.log(`PR #${prNumber} is ${pr.mergeable_state} and is ${updateable ? 'updateable' : 'not updateable'}`); + core.setOutput('updateable', updateable); + + core.debug(`Updating PR #${prNumber} with head ${pr.head.sha}`); + + return { + id: pr.node_id, + number: prNumber, + head: pr.head.sha, + } + - name: Update the Pull Request + if: steps.pr.outputs.updateable == 'true' + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const mutation = `mutation update($input: UpdatePullRequestBranchInput!) { + updatePullRequestBranch(input: $input) { + pullRequest { + mergeable + } + } + }`; + + const pr_details = ${{ steps.pr.outputs.result }}; + + try { + const { data } = await github.graphql(mutation, { + input: { + pullRequestId: pr_details.id, + expectedHeadOid: pr_details.head, + } + }); + } catch (GraphQLError) { + core.debug(GraphQLError); + if ( + GraphQLError.name === 'GraphqlResponseError' && + GraphQLError.errors.some( + error => error.type === 'FORBIDDEN' || error.type === 'UNAUTHORIZED' + ) + ) { + // Add comment to PR if the bot doesn't have permissions to update the PR + const comment = `Hi @${context.actor}. Update of PR has failed. It can be due to one of the following reasons: + - I don't have permissions to update this PR. To update your fork with upstream using bot you need to enable [Allow edits from maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) option in the PR. + - The fork is located in an organization, not under your personal profile. No solution for that. You are on your own with manual update. + - There may be a conflict in the PR. Please resolve the conflict and try again.`; + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: comment + }); + + core.setFailed('Bot does not have permissions to update the PR'); + } else { + core.setFailed(GraphQLError.message); + } + } From a47f8ac321ff0fc90ad05a901ae54e725b191e0a Mon Sep 17 00:00:00 2001 From: Sergio Moya <1083296+smoya@users.noreply.github.com> Date: Thu, 18 Apr 2024 12:52:57 +0200 Subject: [PATCH 06/18] ci: ignore server-api repo in bump workflow (#291) --- .github/workflows/bump.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml index 1e17ccf2..43ba75fd 100644 --- a/.github/workflows/bump.yml +++ b/.github/workflows/bump.yml @@ -31,5 +31,5 @@ jobs: github_token: ${{ secrets.GH_TOKEN }} committer_username: asyncapi-bot committer_email: info@asyncapi.io - repos_to_ignore: spec,bindings,saunter + repos_to_ignore: spec,bindings,saunter,server-api custom_id: "dependency update from asyncapi bot" From e6b0dd93c31424e4147b24971d7e1c9727b6999b Mon Sep 17 00:00:00 2001 From: Jonas Lagoni Date: Tue, 30 Apr 2024 11:05:22 +0200 Subject: [PATCH 07/18] ci: add support for `next` release branch (#294) --- .github/workflows/.releaserc | 2 ++ .github/workflows/if-nodejs-release.yml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/.releaserc b/.github/workflows/.releaserc index bc27e350..1ac05cb1 100644 --- a/.github/workflows/.releaserc +++ b/.github/workflows/.releaserc @@ -13,6 +13,8 @@ branches: prerelease: true - name: alpha prerelease: true +- name: next + prerelease: true plugins: - - "@semantic-release/commit-analyzer" - preset: conventionalcommits diff --git a/.github/workflows/if-nodejs-release.yml b/.github/workflows/if-nodejs-release.yml index 234c5a9c..e578d900 100644 --- a/.github/workflows/if-nodejs-release.yml +++ b/.github/workflows/if-nodejs-release.yml @@ -15,6 +15,7 @@ on: - next-major-spec - beta - alpha + - next jobs: @@ -128,4 +129,4 @@ jobs: fields: repo,action,workflow text: 'Release workflow failed in release job' env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} \ No newline at end of file + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} From d0b2e01c78a03d0803d09bd6fa0a0e0bc0225923 Mon Sep 17 00:00:00 2001 From: Viacheslav Turovskyi Date: Mon, 6 May 2024 09:48:50 +0300 Subject: [PATCH 08/18] ci: add Bounty Program command `/unbounty` (#295) --- .github/workflows/bounty-program-commands.yml | 50 ++++++++++++++++--- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/.github/workflows/bounty-program-commands.yml b/.github/workflows/bounty-program-commands.yml index 433f7d95..645e0c90 100644 --- a/.github/workflows/bounty-program-commands.yml +++ b/.github/workflows/bounty-program-commands.yml @@ -14,12 +14,18 @@ on: types: - created +env: + BOUNTY_PROGRAM_LABELS_JSON: | + [ + {"name": "bounty", "color": "0e8a16", "description": "Participation in the Bounty Program"} + ] + jobs: guard-against-unauthorized-use: if: > github.actor != ('aeworxet' || 'thulieblack') && ( - contains(github.event.comment.body, '/bounty' ) + startsWith(github.event.comment.body, '/bounty' ) ) runs-on: ubuntu-latest @@ -46,15 +52,10 @@ jobs: if: > github.actor == ('aeworxet' || 'thulieblack') && ( - contains(github.event.comment.body, '/bounty' ) + startsWith(github.event.comment.body, '/bounty' ) ) runs-on: ubuntu-latest - env: - BOUNTY_PROGRAM_LABELS_JSON: | - [ - {"name": "bounty", "color": "0e8a16", "description": "Participation in the Bounty Program"} - ] steps: - name: Add label `bounty` @@ -88,3 +89,38 @@ jobs: repo: context.repo.repo, labels: [BOUNTY_PROGRAM_LABELS[0].name] }) + + remove-label-bounty: + if: > + github.actor == ('aeworxet' || 'thulieblack') && + ( + startsWith(github.event.comment.body, '/unbounty' ) + ) + + runs-on: ubuntu-latest + + steps: + - name: Remove label `bounty` + uses: actions/github-script@v6 + + with: + github-token: ${{ secrets.GH_TOKEN }} + script: | + const BOUNTY_PROGRAM_LABELS = JSON.parse(process.env.BOUNTY_PROGRAM_LABELS_JSON); + let LIST_OF_LABELS_FOR_ISSUE = await github.rest.issues.listLabelsOnIssue({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + }); + + LIST_OF_LABELS_FOR_ISSUE = LIST_OF_LABELS_FOR_ISSUE.data.map(key => key.name); + + if (LIST_OF_LABELS_FOR_ISSUE.includes(BOUNTY_PROGRAM_LABELS[0].name)) { + console.log('Removing label `bounty`...'); + github.rest.issues.removeLabel({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + name: [BOUNTY_PROGRAM_LABELS[0].name] + }) + } From abf0ae65b0fb87c30472a75cbc212ace09073a8e Mon Sep 17 00:00:00 2001 From: Lukasz Gornicki Date: Tue, 14 May 2024 11:01:23 +0200 Subject: [PATCH 09/18] chore: ignore website for contribution guide replication (#296) --- .github/workflows/global-replicator.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/global-replicator.yml b/.github/workflows/global-replicator.yml index 66d6e449..feed9dc1 100644 --- a/.github/workflows/global-replicator.yml +++ b/.github/workflows/global-replicator.yml @@ -46,7 +46,7 @@ jobs: with: github_token: ${{ secrets.GH_TOKEN }} patterns_to_include: CONTRIBUTING.md - repos_to_ignore: shape-up-process,glee-hello-world,spec,community,php-template,tck,modelina,dotnet-nats-template,ts-nats-template,extensions-catalog,saunter + repos_to_ignore: shape-up-process,glee-hello-world,spec,community,php-template,tck,modelina,dotnet-nats-template,ts-nats-template,extensions-catalog,saunter,website committer_username: asyncapi-bot committer_email: info@asyncapi.io commit_message: "ci: update of files from global .github repo" From 66b5d6d3c5624dd2a16ca81cc9081d6225237b0d Mon Sep 17 00:00:00 2001 From: Sergio Moya <1083296+smoya@users.noreply.github.com> Date: Wed, 5 Jun 2024 10:20:06 +0200 Subject: [PATCH 10/18] fix: downgrade macos-latest to macos-13 (#301) --- .github/workflows/if-nodejs-pr-testing.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/if-nodejs-pr-testing.yml b/.github/workflows/if-nodejs-pr-testing.yml index 66ea6552..462e6131 100644 --- a/.github/workflows/if-nodejs-pr-testing.yml +++ b/.github/workflows/if-nodejs-pr-testing.yml @@ -14,7 +14,9 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + # Using macos-13 instead of latest (macos-14) due to an issue with Puppeteer and such runner. + # See: https://github.com/puppeteer/puppeteer/issues/12327 and https://github.com/asyncapi/parser-js/issues/1001 + os: [ubuntu-latest, macos-13, windows-latest] steps: - if: > !github.event.pull_request.draft && !( From 1edb10cc91dcdf4f3d5af7192478107d2f7be64f Mon Sep 17 00:00:00 2001 From: Sergio Moya <1083296+smoya@users.noreply.github.com> Date: Wed, 5 Jun 2024 10:48:36 +0200 Subject: [PATCH 11/18] fix: downgrade macos-latest to macos-13 (#302) --- .github/workflows/if-go-pr-testing.yml | 4 +++- .github/workflows/if-nodejs-release.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/if-go-pr-testing.yml b/.github/workflows/if-go-pr-testing.yml index ca29021f..239c391c 100644 --- a/.github/workflows/if-go-pr-testing.yml +++ b/.github/workflows/if-go-pr-testing.yml @@ -56,7 +56,9 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + # Using macos-13 instead of latest (macos-14) due to an issue with Puppeteer and such runner. + # See: https://github.com/puppeteer/puppeteer/issues/12327 and https://github.com/asyncapi/parser-js/issues/1001 + os: [ubuntu-latest, macos-13, windows-latest] steps: - if: > !github.event.pull_request.draft && !( diff --git a/.github/workflows/if-nodejs-release.yml b/.github/workflows/if-nodejs-release.yml index e578d900..72d01de4 100644 --- a/.github/workflows/if-nodejs-release.yml +++ b/.github/workflows/if-nodejs-release.yml @@ -33,7 +33,9 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + # Using macos-13 instead of latest (macos-14) due to an issue with Puppeteer and such runner. + # See: https://github.com/puppeteer/puppeteer/issues/12327 and https://github.com/asyncapi/parser-js/issues/1001 + os: [ubuntu-latest, macos-13, windows-latest] steps: - name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows run: | From e27f9f18f1bf553cf364c9448d0736301038346e Mon Sep 17 00:00:00 2001 From: Khuda Dad Nomani <32505158+KhudaDad414@users.noreply.github.com> Date: Tue, 11 Jun 2024 12:56:53 +0100 Subject: [PATCH 12/18] ci: do not checkout branch when notifying slack (#300) --- .github/actions/slackify-markdown/action.yml | 2 -- .github/workflows/issues-prs-notifications.yml | 6 ------ 2 files changed, 8 deletions(-) diff --git a/.github/actions/slackify-markdown/action.yml b/.github/actions/slackify-markdown/action.yml index b5bc7cdb..a1a2b257 100644 --- a/.github/actions/slackify-markdown/action.yml +++ b/.github/actions/slackify-markdown/action.yml @@ -19,8 +19,6 @@ runs: uses: actions/setup-node@v3 with: node-version: 16 - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - name: Install slackify-markdown package shell: bash run: npm install slackify-markdown@4.3.1 diff --git a/.github/workflows/issues-prs-notifications.yml b/.github/workflows/issues-prs-notifications.yml index 78ebe960..b8b20c6b 100644 --- a/.github/workflows/issues-prs-notifications.yml +++ b/.github/workflows/issues-prs-notifications.yml @@ -20,8 +20,6 @@ jobs: name: Notify slack on every new issue runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v3 - name: Convert markdown to slack markdown for issue uses: asyncapi/.github/.github/actions/slackify-markdown@master id: issuemarkdown @@ -40,8 +38,6 @@ jobs: name: Notify slack on every new pull request runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v3 - name: Convert markdown to slack markdown for pull request uses: asyncapi/.github/.github/actions/slackify-markdown@master id: prmarkdown @@ -60,8 +56,6 @@ jobs: name: Notify slack on every new pull request runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v3 - name: Convert markdown to slack markdown for pull request uses: asyncapi/.github/.github/actions/slackify-markdown@master id: discussionmarkdown From 2751ab4d92fbb4802bb2229b6d20a7ca48a475f3 Mon Sep 17 00:00:00 2001 From: Mateusz Szostok Date: Wed, 21 Aug 2024 16:55:33 +0200 Subject: [PATCH 13/18] ci: trigger MAINTAINERS.yaml update for each CODEOWNERS file change (#307) --- .github/workflows/global-replicator.yml | 22 ++++++++++++++- .../workflows/update-maintainers-trigger.yaml | 28 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/update-maintainers-trigger.yaml diff --git a/.github/workflows/global-replicator.yml b/.github/workflows/global-replicator.yml index feed9dc1..b4ee56f2 100644 --- a/.github/workflows/global-replicator.yml +++ b/.github/workflows/global-replicator.yml @@ -215,4 +215,24 @@ jobs: committer_username: asyncapi-bot committer_email: info@asyncapi.io commit_message: "ci: update .prettierignore from global .github repo" - bot_branch_name: bot/update-files-from-global-repo \ No newline at end of file + bot_branch_name: bot/update-files-from-global-repo + + # This setup is separate from the generic workflow setup because this workflow is mandatory. + # Maintainers cannot opt out for any reason except technical ones. + replicate_update_maintainers_workflow: + if: startsWith(github.repository, 'asyncapi/') + name: Replicate update-maintainers-trigger.yml workflow in the required repositories + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Replicating file + uses: derberg/manage-files-in-multiple-repositories@beecbe897cf5ed7f3de5a791a3f2d70102fe7c25 + with: + github_token: ${{ secrets.GH_TOKEN }} + patterns_to_include: .github/workflows/update-maintainers-trigger.yml + repos_to_ignore: community,shape-up-process # community repo is ignored as it has its own version of this workflow, version that is triggered by this workflow + committer_username: asyncapi-bot + committer_email: info@asyncapi.io + commit_message: "ci: update update-maintainers-trigger.yml workflow from global .github repo" + bot_branch_name: bot/update-files-from-global-repo diff --git a/.github/workflows/update-maintainers-trigger.yaml b/.github/workflows/update-maintainers-trigger.yaml new file mode 100644 index 00000000..12fc4abe --- /dev/null +++ b/.github/workflows/update-maintainers-trigger.yaml @@ -0,0 +1,28 @@ +# This action is centrally managed in https://github.com/asyncapi/.github/ +# 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 + +name: Trigger MAINTAINERS.yaml file update + +on: + push: + branches: [ master ] + paths: + # Check all valid CODEOWNERS locations: + # https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-file-location + - 'CODEOWNERS' + - '.github/CODEOWNERS' + - '.docs/CODEOWNERS' + +jobs: + trigger-maintainers-update: + name: Trigger updating MAINTAINERS.yaml because of CODEOWNERS change + runs-on: ubuntu-latest + + steps: + - name: Repository Dispatch + uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # https://github.com/peter-evans/repository-dispatch/releases/tag/v3.0.0 + with: + # The PAT with the 'public_repo' scope is required + token: ${{ secrets.GH_TOKEN }} + repository: ${{ github.repository_owner }}/community + event-type: trigger-maintainers-update From 9878ca5dcc1c76f5f6155ee2dff13d0edaacfe4e Mon Sep 17 00:00:00 2001 From: ANUSHKA SAXENA Date: Wed, 9 Oct 2024 16:15:17 +0530 Subject: [PATCH 14/18] fix: add destination for .prettierignore replication (#317) --- .github/workflows/global-replicator.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/global-replicator.yml b/.github/workflows/global-replicator.yml index b4ee56f2..bbb51f6d 100644 --- a/.github/workflows/global-replicator.yml +++ b/.github/workflows/global-replicator.yml @@ -216,6 +216,7 @@ jobs: committer_email: info@asyncapi.io commit_message: "ci: update .prettierignore from global .github repo" bot_branch_name: bot/update-files-from-global-repo + destination: ./ # This setup is separate from the generic workflow setup because this workflow is mandatory. # Maintainers cannot opt out for any reason except technical ones. From d72a5e70610078bde4180983dc84013977b3689a Mon Sep 17 00:00:00 2001 From: Antonio Date: Mon, 21 Oct 2024 20:48:52 +0300 Subject: [PATCH 15/18] docs: fix link to specification reference docs (#315) Co-authored-by: Lukasz Gornicki --- profile/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profile/README.md b/profile/README.md index 56a91d39..701e1fa4 100644 --- a/profile/README.md +++ b/profile/README.md @@ -35,7 +35,7 @@ Are you wondering where to look first? Then search no more! Here are some great - [Intro to AsyncAPI](https://www.asyncapi.com/docs/getting-started) 🔮 - [Tutorials](https://www.asyncapi.com/docs/tutorials) 📚 -- [Spec Details](https://www.asyncapi.com/docs/specifications/latest) 🔍 +- [Spec Details](https://www.asyncapi.com/docs/reference/specification/latest) 🔍 - [Tools](https://www.asyncapi.com/docs/community/tooling) 🛠️ ## 👩🏽‍💻 Contribute to AsyncAPI From c6d223f951d0cb54ca9db7d9940862abbbaa4428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20M=C3=A9ndez?= Date: Wed, 30 Oct 2024 17:08:06 +0100 Subject: [PATCH 16/18] ci: install slackify globally to avoid conflicts with pnpm (#318) --- .github/actions/slackify-markdown/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/slackify-markdown/action.yml b/.github/actions/slackify-markdown/action.yml index a1a2b257..7279ee56 100644 --- a/.github/actions/slackify-markdown/action.yml +++ b/.github/actions/slackify-markdown/action.yml @@ -21,7 +21,7 @@ runs: node-version: 16 - name: Install slackify-markdown package shell: bash - run: npm install slackify-markdown@4.3.1 + run: npm install -g slackify-markdown@4.3.1 - name: Slackify uses: actions/github-script@v6 id: slackify From 9dd38e48f4dcd488a5b7bf3fd070006d5a949c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20M=C3=A9ndez?= Date: Mon, 4 Nov 2024 11:46:46 +0100 Subject: [PATCH 17/18] fix: global installs do not work as I expected (#319) --- .github/actions/slackify-markdown/action.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/actions/slackify-markdown/action.yml b/.github/actions/slackify-markdown/action.yml index 7279ee56..9449cc7a 100644 --- a/.github/actions/slackify-markdown/action.yml +++ b/.github/actions/slackify-markdown/action.yml @@ -19,12 +19,21 @@ runs: uses: actions/setup-node@v3 with: node-version: 16 + - name: Create and initialize slackify directory + shell: bash + run: | # We need to create a directory to install the slackify-markdown package to avoid conflicting with repositories using pnpm. + mkdir slackify + cd slackify + npm init -y - name: Install slackify-markdown package shell: bash - run: npm install -g slackify-markdown@4.3.1 + working-directory: slackify + run: | + npm install slackify-markdown@4.3.1 - name: Slackify uses: actions/github-script@v6 id: slackify + working-directory: slackify env: MARKDOWN: ${{ inputs.markdown }} with: @@ -37,4 +46,8 @@ runs: core.setOutput('text', mrkdwn); } catch (error) { core.setFailed(error.message); - } \ No newline at end of file + } + - name: Clean up slackify directory + shell: bash + run: | + rm -rf slackify From 4314ad34f442116dcef5eeaf3b138c73fd1f10db Mon Sep 17 00:00:00 2001 From: Lukasz Gornicki Date: Mon, 4 Nov 2024 20:33:49 +0100 Subject: [PATCH 18/18] ci: "fix: global installs do not work as I expected" (#320) --- .github/actions/slackify-markdown/action.yml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/.github/actions/slackify-markdown/action.yml b/.github/actions/slackify-markdown/action.yml index 9449cc7a..9dead14c 100644 --- a/.github/actions/slackify-markdown/action.yml +++ b/.github/actions/slackify-markdown/action.yml @@ -19,21 +19,12 @@ runs: uses: actions/setup-node@v3 with: node-version: 16 - - name: Create and initialize slackify directory - shell: bash - run: | # We need to create a directory to install the slackify-markdown package to avoid conflicting with repositories using pnpm. - mkdir slackify - cd slackify - npm init -y - name: Install slackify-markdown package shell: bash - working-directory: slackify - run: | - npm install slackify-markdown@4.3.1 + run: npm install slackify-markdown@4.3.1 - name: Slackify uses: actions/github-script@v6 id: slackify - working-directory: slackify env: MARKDOWN: ${{ inputs.markdown }} with: @@ -47,7 +38,3 @@ runs: } catch (error) { core.setFailed(error.message); } - - name: Clean up slackify directory - shell: bash - run: | - rm -rf slackify