Skip to content

Commit

Permalink
Merge branch 'master' into test-editor
Browse files Browse the repository at this point in the history
  • Loading branch information
princerajpoot20 authored Apr 16, 2024
2 parents 1b1fd96 + 8408c10 commit b821555
Show file tree
Hide file tree
Showing 7 changed files with 298 additions and 244 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
24 changes: 12 additions & 12 deletions .github/workflows/if-nodejs-pr-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 [email protected]
- 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.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: 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
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 /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

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.filter(reviewer => reviewer !== 'asyncapi-bot-eve' ).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:`
});
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import { VisualEditor, CodeEditor, Examples } from '@asyncapi/studio-ui';

export default {
const VisualEditorStory = {
component: VisualEditor,
parameters: {
layout: 'fullscreen',
Expand Down Expand Up @@ -282,3 +282,4 @@ export const nestead_array = () => (
/>
);

export default VisualEditorStory
4 changes: 1 addition & 3 deletions apps/studio-next/src/components/Editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import { useFilesState } from '@/state/files.state';
import { CodeMirror } from './CodeMirror';

interface IEditorProps {}

export const Editor = (props: IEditorProps) => {
export const Editor = () => {
const { language, content } = useFilesState(state => state.files['asyncapi']);
const handleUpdateFile = useFilesState(state => state.updateFile);

Expand Down
16 changes: 8 additions & 8 deletions apps/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"./LICENSE"
],
"dependencies": {
"@asyncapi/avro-schema-parser": "^3.0.19",
"@asyncapi/converter": "^1.4.16",
"@asyncapi/openapi-schema-parser": "^3.0.18",
"@asyncapi/parser": "^3.0.11",
"@asyncapi/protobuf-schema-parser": "^3.2.8",
"@asyncapi/avro-schema-parser": "^3.0.21",
"@asyncapi/converter": "^1.4.18",
"@asyncapi/openapi-schema-parser": "^3.0.21",
"@asyncapi/parser": "^3.0.13",
"@asyncapi/protobuf-schema-parser": "^3.2.11",
"@asyncapi/react-component": "^1.2.2",
"@asyncapi/specs": "^6.5.4",
"@asyncapi/specs": "^6.5.6",
"@ebay/nice-modal-react": "^1.2.10",
"@headlessui/react": "^1.7.4",
"@hookstate/core": "^4.0.0-rc21",
Expand Down Expand Up @@ -75,8 +75,8 @@
},
"devDependencies": {
"@asyncapi/dotnet-nats-template": "^0.12.1",
"@asyncapi/go-watermill-template": "^0.2.72",
"@asyncapi/html-template": "^2.3.0",
"@asyncapi/go-watermill-template": "^0.2.74",
"@asyncapi/html-template": "^2.3.2",
"@asyncapi/java-spring-cloud-stream-template": "^0.13.4",
"@asyncapi/java-spring-template": "^1.5.1",
"@asyncapi/java-template": "^0.2.1",
Expand Down
Loading

0 comments on commit b821555

Please sign in to comment.