Skip to content

Commit

Permalink
Merge branch 'master' into send-hello-world-tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
asyncapi-bot authored Feb 7, 2025
2 parents 606e55d + 99e65e6 commit a168a51
Show file tree
Hide file tree
Showing 540 changed files with 13,729 additions and 7,240 deletions.
15 changes: 12 additions & 3 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@
]
},
{
"login": "alequetzalli",
"name": "Alejandra Quetzalli ",
"login": "quetzalliwrites",
"name": "Quetzalli Writes",
"avatar_url": "https://avatars.githubusercontent.com/u/19964402?v=4",
"profile": "https://github.com/alequetzalli",
"profile": "https://github.com/quetzalliwrites",
"contributions": [
"doc",
"review",
Expand Down Expand Up @@ -555,6 +555,15 @@
"contributions": [
"doc"
]
},
{
"login": "raj17ce",
"name": "Raj Patel",
"avatar_url": "https://avatars.githubusercontent.com/u/116947399?v=4",
"profile": "https://github.com/raj17ce",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
35 changes: 35 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
language: "en-US"
reviews:
high_level_summary: true
tools:
markdownlint:
enabled: true
biome:
enabled: true
github-checks:
enabled: true
timeout_ms: 180000
languagetool:
enabled: true
enabled_only: false
level: default
hadolint:
enabled: true
yamllint:
enabled: true
gitleaks:
enabled: true
eslint:
enabled: true
actionlint:
enabled: true
semgrep:
enabled: true
knowledge_base:
opt_out: false
learnings:
scope: "local"
issues:
scope: "local"
pull_requests:
scope: "local"
5 changes: 3 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"env": {
"browser": true,
"es2021": true,
"node": true
"node": true,
"jest": true
},
"plugins": [
"react",
Expand Down Expand Up @@ -313,4 +314,4 @@
}
}
]
}
}
49 changes: 49 additions & 0 deletions .github/workflows/check-edit-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Weekly Docs Link Checker

on:
schedule:
- cron: '0 0 * * 0' # Runs every week at midnight on Sunday
workflow_dispatch:

jobs:
check-links:
name: Run Link Checker and Notify Slack
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Install dependencies
run: npm install

- name: Run link checker
id: linkcheck
run: |
npm run test:editlinks | tee output.log
- name: Extract 404 URLs from output
id: extract-404
run: |
ERRORS=$(sed -n '/URLs returning 404:/,$p' output.log)
echo "errors<<EOF" >> $GITHUB_OUTPUT
echo "$ERRORS" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Notify Slack
if: ${{ steps.extract-404.outputs.errors != '' }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.WEBSITE_SLACK_WEBHOOK }}
SLACK_TITLE: 'Docs Edit Link Checker Errors Report'
SLACK_MESSAGE: |
🚨 The following URLs returned 404 during the link check:
```
${{ steps.extract-404.outputs.errors }}
```
MSG_MINIMAL: true
96 changes: 70 additions & 26 deletions .github/workflows/if-nodejs-pr-testing.yml
Original file line number Diff line number Diff line change
@@ -1,81 +1,125 @@
# 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 does magic only if there is package.json file in the root of the project
name: PR testing - if Node project

on:
pull_request:
pull_request_target:
types: [opened, reopened, synchronize, ready_for_review]
push:
branches: [master]

jobs:
test-nodejs-pr:
name: Test NodeJS PR - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# 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 && !(
(github.actor == 'asyncapi-bot' && (
startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') ||
startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') ||
startsWith(github.event.pull_request.title, 'chore(release):')
)) ||
(github.actor == 'asyncapi-bot-eve' && (
startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') ||
startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') ||
startsWith(github.event.pull_request.title, 'chore(release):')
)) ||
(github.actor == 'allcontributors[bot]' &&
(github.actor == 'allcontributors[bot]' &&
startsWith(github.event.pull_request.title, 'docs: add')
)
)
id: should_run
name: Should Run
run: echo "shouldrun=true" >> $GITHUB_OUTPUT
shell: bash
- if: steps.should_run.outputs.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
shell: bash
- if: steps.should_run.outputs.shouldrun == 'true'
- if: steps.should_run.outputs.shouldrun == 'true'
name: Checkout repository
uses: actions/checkout@v4
- if: steps.should_run.outputs.shouldrun == 'true'
with:
# Checkout the merge commit instead of the pull request head commit for a pull request
# Fallback to the head commit if its not a pull request
ref: ${{ github.event.pull_request.number != '' && format('refs/pull/{0}/merge', github.event.pull_request.number) || github.ref }}

- 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 "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
id: lockversion
- if: steps.packagejson.outputs.exists == 'true'
name: Check if .nvmrc exists
id: nvmrc
run: test -e .nvmrc && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT
shell: bash
- if: steps.nvmrc.outputs.exists == 'true'
name: Read Node.js version from .nvmrc
id: nodeversion
run: echo "version=$(cat .nvmrc)" >> $GITHUB_OUTPUT
shell: bash
- if: steps.packagejson.outputs.exists == 'true' && steps.nvmrc.outputs.exists == 'true'
name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "${{ steps.lockversion.outputs.version }}"
- 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 [email protected]
- if: steps.packagejson.outputs.exists == 'true'
name: Install dependencies
shell: bash
node-version: '${{ steps.nodeversion.outputs.version }}'
- name: Install dependencies
run: npm ci
- if: steps.packagejson.outputs.exists == 'true'
name: Test
run: npm test --if-present
- 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

# Run the test:md script and capture output
- if: ${{ steps.packagejson.outputs.exists == 'true' && matrix.os == 'ubuntu-latest' }}
name: Run markdown checks
id: markdown_check
run: |
ERRORS=$(npm run test:md | sed -n '/Errors in file/,$p')
echo "markdown_output<<EOF" >> $GITHUB_OUTPUT
echo "$ERRORS" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
# Post a comment using sticky-pull-request-comment
- name: Comment on PR with markdown issues
if: ${{ steps.markdown_check.outputs.markdown_output != '' && matrix.os == 'ubuntu-latest' }}
uses: marocchino/sticky-pull-request-comment@3d60a5b2dae89d44e0c6ddc69dd7536aec2071cd
with:
header: markdown-check-error
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
message: |
### Markdown Check Results
We found issues in the following markdown files:
```
${{ steps.markdown_check.outputs.markdown_output }}
```
# Delete the comment if there are no issues
- if: ${{ steps.markdown_check.outputs.markdown_output == '' && matrix.os == 'ubuntu-latest' }}
name: Delete markdown check comment
uses: marocchino/sticky-pull-request-comment@3d60a5b2dae89d44e0c6ddc69dd7536aec2071cd
with:
header: markdown-check-error
delete: true
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

- if: steps.packagejson.outputs.exists == 'true'
name: Upload Coverage to Codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673
with:
fail_ci_if_error: true
files: ./coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
21 changes: 21 additions & 0 deletions .github/workflows/netlify-edge-functions-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Run tests for netlify edge-functions

on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]

jobs:
netlify-tests:
strategy:
matrix:
deno-version: [1.46.0]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Deno
uses: denoland/setup-deno@3a041055d2e2068f6e2c59904ee0ec2dfa9d9665
with:
deno-version: ${{ matrix.deno-version }}
- name: Test with Deno
run: deno test --allow-env --trace-ops netlify/**/*.test.ts

37 changes: 21 additions & 16 deletions .github/workflows/notify-triager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ jobs:
- name: Checkout Repository
uses: actions/[email protected]
with:
fetch-depth: 0
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}

- name: Get commit message
id: commit-message
run: |
# Extract the commit message
commit_message=$(git log --format=%B -n 1 ${{ github.event.pull_request.head.sha }})
commit_message=$(echo "$commit_message" | tr '\n' ' ')
commit_message=$(echo "$commit_message" | sed 's/[<>|]//g' | sed 's/[][]//g' | sed 's/(//g' | sed 's/)//g' | xargs)
echo "commit_message=$commit_message" >> $GITHUB_OUTPUT
- name: Check if last commit is a merge commit
Expand All @@ -31,23 +35,23 @@ jobs:
echo "isMergeCommit=false" >> $GITHUB_OUTPUT
fi
- name: Checkout asyncapi/website Repository
uses: actions/[email protected]
- name: Count changed files
id: changed_files
run: |
# Get the list of files changed in the latest commit
changed_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }})
- name: Check PR Changes for .md files
id: md-pr-changes
uses: tj-actions/changed-files@aa08304bd477b800d468db44fe10f6c61f7f7b11 # version 42.1.0 https://github.com/tj-actions/changed-files/releases/tag/v42.1.0
with:
files: |
**.md
# Initialize counters
md_count=0
non_md_count=0
- name: Check PR Changes for non-.md files
id: non-md-pr-changes
uses: tj-actions/changed-files@aa08304bd477b800d468db44fe10f6c61f7f7b11 # version 42.1.0 https://github.com/tj-actions/changed-files/releases/tag/v42.1.0
with:
files: |
!**.md
# Count .md files
md_count=$(echo "$changed_files" | grep -c '\.md$' || true)
# Count non-.md files
non_md_count=$(echo "$changed_files" | grep -vc '\.md$' || true)
echo "md_count=$md_count" >> $GITHUB_OUTPUT
echo "non_md_count=$non_md_count" >> $GITHUB_OUTPUT
- name: Extract Doc Triage Maintainers
id: doc-triager
Expand All @@ -68,7 +72,7 @@ jobs:
echo "codeTriagers=$codeTriagers" >> $GITHUB_ENV
- name: Add Reviewers for code files
if: steps.check-merge-branch.outputs.isMergeCommit == 'false' && steps.non-md-pr-changes.outputs.any_changed == 'true'
if: ${{ steps.check-merge-branch.outputs.isMergeCommit == 'false' && steps.changed_files.outputs.non_md_count > 0 }}
run: |
IFS=' ' read -r -a codeTriagers <<< "${{ env.codeTriagers }}"
reviewers=$(printf ', "%s"' "${codeTriagers[@]}")
Expand All @@ -83,7 +87,7 @@ jobs:
}"
- name: Add Reviewers for doc files
if: steps.check-merge-branch.outputs.isMergeCommit == 'false' && steps.md-pr-changes.outputs.any_changed == 'true'
if: ${{ steps.check-merge-branch.outputs.isMergeCommit == 'false' && steps.changed_files.outputs.md_count > 0 }}
run: |
IFS=' ' read -r -a docTriagers <<< "${{ env.docTriagers }}"
reviewers=$(printf ', "%s"' "${docTriagers[@]}")
Expand All @@ -96,3 +100,4 @@ jobs:
-d "{
\"reviewers\": $reviewers
}"
Loading

0 comments on commit a168a51

Please sign in to comment.