Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/next-major' into feature/mock_im…
Browse files Browse the repository at this point in the history
…plementation
  • Loading branch information
smoya committed Feb 21, 2022
2 parents 5fdb98b + 802a420 commit 4481bcf
Show file tree
Hide file tree
Showing 15 changed files with 450 additions and 64 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,15 @@ name: Automerge release bump PR
on:
pull_request_target:
types:
- labeled
- unlabeled
- synchronize
- opened
- edited
- ready_for_review
- reopened
- unlocked
pull_request_review:
types:
- submitted
- synchronize

jobs:
autoapprove:
if: github.event.pull_request.draft == false && (github.actor == 'asyncapi-bot' || github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]') && !contains(github.event.pull_request.labels.*.name, 'released')
if: >
contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]"]'), github.event.pull_request.user.login) &&
contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]"]'), github.actor) &&
!contains(github.event.pull_request.labels.*.name, 'released')
runs-on: ubuntu-latest
steps:
- name: Autoapproving
Expand All @@ -42,7 +36,6 @@ jobs:
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
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ on:

jobs:
bump:
if: startsWith(github.event.commits[0].message, 'chore(release):')
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- 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):')
- 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@v3
uses: derberg/npm-dependency-manager-for-your-github-org@v4
with:
github_token: ${{ secrets.GH_TOKEN }}
committer_username: asyncapi-bot
Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/if-go-pr-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,21 @@ name: PR testing - if Go project
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]

jobs:
lint:
if: github.event.pull_request.draft == false
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
- if: "github.event.pull_request.draft == false &&!((github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'ci: update global workflows')) || (github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'chore(release):')) || (github.actor == 'allcontributors' && startsWith(github.event.pull_request.title, 'docs: add')))"
id: should_run
name: Should Run
run: echo "::set-output name=shouldrun::true"
- if: steps.should_run.outputs.shouldrun == 'true'
name: Checkout repository
uses: actions/checkout@v2
- name: Check if Go project and has go.mod
- if: steps.should_run.outputs.shouldrun == 'true'
name: Check if Go project and has go.mod
id: gomod
run: test -e ./go.mod && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
shell: bash
Expand All @@ -31,16 +36,21 @@ jobs:
skip-go-installation: true # we wanna control the version of Go in use

test:
if: github.event.pull_request.draft == false
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout repository
- if: "github.event.pull_request.draft == false &&!((github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'ci: update global workflows')) || (github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'chore(release):')) || (github.actor == 'allcontributors' && startsWith(github.event.pull_request.title, 'docs: add')))"
id: should_run
name: Should Run
run: echo "::set-output name=shouldrun::true"
- if: steps.should_run.outputs.shouldrun == 'true'
name: Checkout repository
uses: actions/checkout@v2
- name: Check if Go project and has go.mod
- if: steps.should_run.outputs.shouldrun == 'true'
name: Check if Go project and has go.mod
id: gomod
run: test -e ./go.mod && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
shell: bash
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/if-nodejs-pr-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,26 @@ on:

jobs:
test:
if: github.event.pull_request.draft == false
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows
- if: "github.event.pull_request.draft == false &&!((github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'ci: update global workflows')) || (github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'chore(release):')) || (github.actor == 'allcontributors' && startsWith(github.event.pull_request.title, 'docs: add')))"
id: should_run
name: Should Run
run: echo "::set-output name=shouldrun::true"
- 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: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout repository
- if: steps.should_run.outputs.shouldrun == 'true'
name: Checkout repository
uses: actions/checkout@v2
- name: Check if Node.js project and has package.json
- if: steps.should_run.outputs.shouldrun == 'true'
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"
shell: bash
Expand Down
142 changes: 142 additions & 0 deletions .github/workflows/notify-tsc-members-mention.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
#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 notifies community on slack whenever there is a new issue, PR or discussion started in given repository
name: Notify slack whenever TSC members are mentioned in GitHub

on:
issue_comment:
types:
- created
- edited

discussion_comment:
types:
- created
- edited

issues:
types:
- opened
- reopened

pull_request_target:
types:
- opened
- reopened
- ready_for_review

discussion:
types:
- created
- edited

jobs:

issue:
if: github.event_name == 'issues' && contains(github.event.issue.body, '@asyncapi/tsc_members')
name: On every new issue
runs-on: ubuntu-latest
steps:
- name: Convert markdown to slack markdown
uses: LoveToKnow/slackify-markdown-action@v1.0.0
id: issuemarkdown
with:
text: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}"
- name: Send info about issue
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}}
SLACK_TITLE: 🆘 New issue that requires TSC Members attention 🆘
SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}}
MSG_MINIMAL: true

pull_request:
if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.body, '@asyncapi/tsc_members')
name: On every new pull request
runs-on: ubuntu-latest
steps:
- name: Convert markdown to slack markdown
uses: LoveToKnow/slackify-markdown-action@v1.0.0
id: prmarkdown
with:
text: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}"
- name: Send info about pull request
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}}
SLACK_TITLE: 🆘 New PR that requires TSC Members attention 🆘
SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}}
MSG_MINIMAL: true

discussion:
if: github.event_name == 'discussion' && contains(github.event.discussion.body, '@asyncapi/tsc_members')
name: On every new discussion
runs-on: ubuntu-latest
steps:
- name: Convert markdown to slack markdown
uses: LoveToKnow/slackify-markdown-action@v1.0.0
id: discussionmarkdown
with:
text: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}"
- name: Send info about pull request
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}}
SLACK_TITLE: 🆘 New discussion that requires TSC Members attention 🆘
SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}}
MSG_MINIMAL: true

issue_comment:
if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members') }}
name: On every new comment in issue
runs-on: ubuntu-latest
steps:
- name: Convert markdown to slack markdown
uses: LoveToKnow/slackify-markdown-action@v1.0.0
id: issuemarkdown
with:
text: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}"
- name: Send info about issue comment
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}}
SLACK_TITLE: 🆘 New comment under existing issue that requires TSC Members attention 🆘
SLACK_MESSAGE: ${{steps.issuemarkdown.outputs.text}}
MSG_MINIMAL: true

pr_comment:
if: github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members')
name: On every new comment in pr
runs-on: ubuntu-latest
steps:
- name: Convert markdown to slack markdown
uses: LoveToKnow/slackify-markdown-action@v1.0.0
id: prmarkdown
with:
text: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}"
- name: Send info about PR comment
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}}
SLACK_TITLE: 🆘 New comment under existing PR that requires TSC Members attention 🆘
SLACK_MESSAGE: ${{steps.prmarkdown.outputs.text}}
MSG_MINIMAL: true

discussion_comment:
if: github.event_name == 'discussion_comment' && contains(github.event.comment.body, '@asyncapi/tsc_members')
name: On every new comment in discussion
runs-on: ubuntu-latest
steps:
- name: Convert markdown to slack markdown
uses: LoveToKnow/slackify-markdown-action@v1.0.0
id: discussionmarkdown
with:
text: "[${{github.event.discussion.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}"
- name: Send info about discussion comment
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{secrets.SLACK_TSC_MEMBERS_NOTIFY}}
SLACK_TITLE: 🆘 New comment under existing discussion that requires TSC Members attention 🆘
SLACK_MESSAGE: ${{steps.discussionmarkdown.outputs.text}}
MSG_MINIMAL: true
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,25 @@ Head over to [asyncapi/raml-dt-schema-parser](https://www.github.com/asyncapi/ra

## API documentation

The parser API is generally structured the same way as the AsyncAPI specification, with additional support functions such as `has<Something>()`. The parser uses wrapped functions to get the properties stored in JSON. This means in order to get the info object you would use the function `doc.info()` and to get the title inside the info object you call `doc.info().title()`.
Parser-JS API implements a global API definition for all AsyncAPI parser implementations known as the [Parser-API](https://github.com/asyncapi/parser-api).
This API is designed having in mind developer experience and resiliency to breaking changes.

See [API documentation](/API.md) for more example and full API reference information.
The following table shows a compatibility matrix between this parser, and the [Parser-API](https://github.com/asyncapi/parser-api), as well as the AsyncAPI spec version supported by each release of this parser.

Parser-JS | Parser-API | Spec 2.x | Spec 3.x
----------|----------------------------------------------------------------------|----------|---------
1.x | | ✓ |
2.x | [1.x](https://github.com/asyncapi/parser-api/blob/master/docs/v1.md) | | ✓

- `` Fully supported version.
- `-` The AsyncAPI Spec version has features the Parser-JS can't use but the rest are fully supported.
- Empty means not supported version.

Additionally to all the methods declared in the [Parser-API](https://github.com/asyncapi/parser-api), this parser might introduce some helper functions.

Direct access to the parsed JSON document is always available through the `doc.raw()` method.

See [API documentation](/docs/api/v2.md) for more example and full API reference information.

## Using in the browser

Expand Down Expand Up @@ -197,7 +213,7 @@ This package throws a bunch of different error types. All errors contain a `type
|`schema-validation-errors`| `parsedJSON`, `validationErrors` | Schema of the payload provided in the AsyncAPI document is not valid with AsyncAPI schema format.
|`fetch-url-error`| None | The URL provided for fetching AsynAPI document is invalid.
For more information about the `ParserError` class, [check out the documentation](./API.md#new_ParserError_new).
For more information about the `ParserError` class, [check out the documentation](./docs/api/v1.md#new_ParserError_new).
## Custom extensions
Expand Down
2 changes: 1 addition & 1 deletion dist/bundle.js

Large diffs are not rendered by default.

Loading

0 comments on commit 4481bcf

Please sign in to comment.