Skip to content

Commit

Permalink
Merge branch 'master' into fix/494
Browse files Browse the repository at this point in the history
  • Loading branch information
smoya authored Apr 3, 2024
2 parents a9a7d47 + a4ae97a commit eba77ed
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/help-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +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.
- \`/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.`
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/if-nodejs-pr-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
id: should_run
name: Should Run
run: echo "shouldrun=true" >> $GITHUB_OUTPUT
shell: bash
- if: steps.should_run.outputs.shouldrun == 'true'
name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows
run: |
Expand Down Expand Up @@ -60,13 +61,13 @@ jobs:
- if: steps.packagejson.outputs.exists == 'true'
name: Install dependencies
id: first-installation
run: npm install --loglevel verbose
run: npm ci
continue-on-error: true
- if: steps.first-installation.outputs.status == 'failure' && steps.packagejson.outputs.exists == 'true'
name: Clear NPM cache and install deps again
run: |
npm cache clean --force
npm install --loglevel verbose
npm ci
- if: steps.packagejson.outputs.exists == 'true'
name: Test
run: npm test --if-present
Expand All @@ -75,4 +76,4 @@ jobs:
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
run: npm run generate:assets --if-present
run: npm run generate:assets --if-present
10 changes: 9 additions & 1 deletion .github/workflows/if-nodejs-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ jobs:
- 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
shell: bash
- if: steps.packagejson.outputs.exists == 'true'
name: Check package-lock version
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master
Expand All @@ -98,7 +99,14 @@ jobs:
cache-dependency-path: '**/package-lock.json'
- if: steps.packagejson.outputs.exists == 'true'
name: Install dependencies
run: npm install
id: first-installation
run: npm ci
continue-on-error: true
- if: steps.first-installation.outputs.status == 'failure' && 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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/if-nodejs-version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
cache-dependency-path: '**/package-lock.json'
- if: steps.packagejson.outputs.exists == 'true'
name: Install dependencies
run: npm install
run: npm ci
- if: steps.packagejson.outputs.exists == 'true'
name: Assets generation
run: npm run generate:assets --if-present
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/please-take-a-look-command.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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

# 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

name: Please take a Look

on:
issue_comment:
types: [created]

jobs:
ping-for-attention:
if: >
github.event.issue.pull_request &&
github.event.issue.state != 'closed' &&
github.actor != 'asyncapi-bot' &&
(
contains(github.event.comment.body, '/please-take-a-look') ||
contains(github.event.comment.body, '/ptal') ||
contains(github.event.comment.body, '/PTAL')
)
runs-on: ubuntu-latest
steps:
- name: Check for Please Take a Look Command
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
const prDetailsUrl = context.payload.issue.pull_request.url;
const { data: pull } = await github.request(prDetailsUrl);
const reviewers = pull.requested_reviewers.map(reviewer => reviewer.login);
const { data: reviews } = await github.rest.pulls.listReviews({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
const reviewersWhoHaveReviewed = reviews.map(review => review.user.login);
const reviewersWhoHaveNotReviewed = reviewers.filter(reviewer => !reviewersWhoHaveReviewed.includes(reviewer));
if (reviewersWhoHaveNotReviewed.length > 0) {
const comment = reviewersWhoHaveNotReviewed.map(reviewer => `@${reviewer}`).join(' ');
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `${comment} Please take a look at this PR. Thanks! :wave:`
});
}
2 changes: 1 addition & 1 deletion definitions/3.0.0/operationBindingsObject.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"kafka": {
"properties": {
"bindingVersion": {
"enum": ["0.4.0", "0.3.0"]
"enum": ["0.5.0", "0.4.0", "0.3.0"]
}
},
"allOf": [
Expand Down
2 changes: 1 addition & 1 deletion definitions/3.0.0/serverBindingsObject.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"kafka": {
"properties": {
"bindingVersion": {
"enum": ["0.4.0", "0.3.0"]
"enum": ["0.5.0", "0.4.0", "0.3.0"]
}
},
"allOf": [
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@asyncapi/specs",
"version": "6.5.3",
"version": "6.5.4",
"description": "AsyncAPI schema versions",
"main": "index.js",
"types": "index.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions schemas/3.0.0-without-$id.json
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,7 @@
"properties": {
"bindingVersion": {
"enum": [
"0.5.0",
"0.4.0",
"0.3.0"
]
Expand Down Expand Up @@ -6877,6 +6878,7 @@
"properties": {
"bindingVersion": {
"enum": [
"0.5.0",
"0.4.0",
"0.3.0"
]
Expand Down
2 changes: 2 additions & 0 deletions schemas/3.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,7 @@
"properties": {
"bindingVersion": {
"enum": [
"0.5.0",
"0.4.0",
"0.3.0"
]
Expand Down Expand Up @@ -6965,6 +6966,7 @@
"properties": {
"bindingVersion": {
"enum": [
"0.5.0",
"0.4.0",
"0.3.0"
]
Expand Down

0 comments on commit eba77ed

Please sign in to comment.