diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 28c11be9c..7d03201ed 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -4,7 +4,6 @@ about: Create a report to help us improve title: '' labels: '' assignees: '' - --- **Describe the bug** @@ -12,6 +11,7 @@ A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: + 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' @@ -24,8 +24,9 @@ A clear and concise description of what you expected to happen. If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - - OS: [e.g. Ubuntu] - - Version [e.g. 18.04] + +- OS: [e.g. Ubuntu] +- Version [e.g. 18.04] **Additional context** Add any other context about the problem here. diff --git a/.github/pr_bug_template.md b/.github/pr_bug_template.md index ae607227f..47c683bc1 100644 --- a/.github/pr_bug_template.md +++ b/.github/pr_bug_template.md @@ -1,15 +1,19 @@ # Monika Pull Request (PR) ## What bug/issue does this PR fix -1. + +1. ## How do to reproduce the bug -1. + +1. ## Expected behaviour -1. -2. + +1. +2. ## How to test -1. -2. + +1. +2. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 8c66ab39e..6b0895a78 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,12 +1,15 @@ # Monika Pull Request (PR) ## What feature/issue does this PR add -1. + +1. ## How did you implement / how did you fix it -1. + +1. ## How to test -1. -2. -3. + +1. +2. +3. diff --git a/.github/workflows/auto-pr-schemastore.yml b/.github/workflows/auto-pr-schemastore.yml index ed647171e..2d90c6fe4 100644 --- a/.github/workflows/auto-pr-schemastore.yml +++ b/.github/workflows/auto-pr-schemastore.yml @@ -9,7 +9,7 @@ on: workflow_dispatch: push: paths: - - "src/monika-config-schema.json" # only run the workflow if the schema file is changed + - 'src/monika-config-schema.json' # only run the workflow if the schema file is changed branches: - main env: @@ -19,7 +19,7 @@ env: permissions: issues: read pull-requests: read - + jobs: create-auto-PR: runs-on: ubuntu-latest @@ -38,7 +38,7 @@ jobs: git config --global user.name "$USERNAME" git config --global user.email "$EMAIL" git add . - git commit -m "update json schema" + git commit -m "update json schema" - name: ✍🏻 Setup node uses: actions/setup-node@v3 @@ -46,7 +46,7 @@ jobs: node-version: 18 - name: Run Test on Schema - run : | + run: | cd src npm ci npm run build @@ -62,7 +62,7 @@ jobs: base: master push-to-fork: hyperjumptech/schemastore branch: feat/Update-monika-schema - title: "[PR] Update monika config schema" + title: '[PR] Update monika config schema' body: | In this PR: - Update config json schema to improve suggestions @@ -73,7 +73,7 @@ jobs: - name: Check outputs if: ${{ steps.cpr.outputs.pull-request-number }} - env: + env: PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }} PR_URL: ${{ steps.cpr.outputs.pull-request-url }} run: | diff --git a/.github/workflows/docker-push.yml b/.github/workflows/docker-push.yml index 0d28e02ea..fcf802746 100644 --- a/.github/workflows/docker-push.yml +++ b/.github/workflows/docker-push.yml @@ -1,4 +1,3 @@ - name: DockerPush on: @@ -9,16 +8,14 @@ on: permissions: issues: read pull-requests: read - + jobs: docker: runs-on: ubuntu-latest steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v2 - - - name: Docker meta + - name: Docker meta id: meta uses: docker/metadata-action@v4 with: @@ -30,20 +27,16 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} - - - name: Set up QEMU + - name: Set up QEMU uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - - name: Login to DockerHub + - name: Login to DockerHub uses: docker/login-action@v1 with: username: ${{secrets.HYPERJUMP_DOCKER_USERNAME}} password: ${{secrets.HYPERJUMP_DOCKER_PASSWORD}} - - - name: Build and push + - name: Build and push id: docker_build uses: docker/build-push-action@v2 with: diff --git a/.github/workflows/docker-release-from-tag.yml b/.github/workflows/docker-release-from-tag.yml index 9a6ac6160..febff1214 100644 --- a/.github/workflows/docker-release-from-tag.yml +++ b/.github/workflows/docker-release-from-tag.yml @@ -4,14 +4,14 @@ on: workflow_dispatch: inputs: version: - description: "Monika NPM version to create docker image" + description: 'Monika NPM version to create docker image' required: true type: string permissions: issues: read pull-requests: read - + jobs: testing: name: Testing Release diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index bb5b67c3b..24224a90f 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -6,7 +6,7 @@ on: types: [opened, synchronize, reopened] branches: [main] paths: - - "docs/**" # only run if the PR makes changes to the docs content. + - 'docs/**' # only run if the PR makes changes to the docs content. env: CI: true @@ -17,7 +17,7 @@ env: permissions: issues: read pull-requests: read - + jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1e796c9ee..a77cb79b7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,7 +5,7 @@ on: release: types: [created] schedule: - - cron: "0 9 * * 3" # Every 9AM on Wednesday + - cron: '0 9 * * 3' # Every 9AM on Wednesday env: CI: true @@ -16,7 +16,7 @@ env: permissions: issues: read pull-requests: read - + jobs: build: permissions: @@ -89,4 +89,4 @@ jobs: env: APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }} API_KEY: ${{ secrets.ALGOLIA_ADMIN_API_KEY }} - CONFIG: ${{ steps.algolia_config.outputs.config }} \ No newline at end of file + CONFIG: ${{ steps.algolia_config.outputs.config }} diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml index 6eed121b8..6d4098851 100644 --- a/.github/workflows/nightly-release.yml +++ b/.github/workflows/nightly-release.yml @@ -3,12 +3,12 @@ name: 🌒 Nightly Release on: workflow_dispatch: schedule: - - cron: "0 7 * * *" # every day at 12AM PST + - cron: '0 7 * * *' # every day at 12AM PST permissions: issues: read pull-requests: read - + jobs: nightly: permissions: diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 86e03bd3a..ddb26c9f4 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -15,6 +15,7 @@ on: permissions: issues: read pull-requests: read + actions: write jobs: lint: @@ -27,7 +28,10 @@ jobs: node-version: 18.x - run: npm ci - run: npm run build -w packages/notification - - run: npm run lint + - run: npm run lint + - name: Cancel workflow on failure + if: 'failure()' + uses: 'andymckay/cancel-action@0.3' format: runs-on: ubuntu-latest steps: @@ -38,7 +42,10 @@ jobs: node-version: 18.x - run: npm ci - run: npm run build -w packages/notification - - run: npm run format + - run: npm run format + - name: Cancel workflow on failure + if: 'failure()' + uses: 'andymckay/cancel-action@0.3' prod_test_npm: runs-on: ubuntu-latest steps: @@ -52,6 +59,9 @@ jobs: - run: npm pack - run: npm install -g ./hyperjumptech-monika-*.tgz - run: npm run prod_test + - name: Cancel workflow on failure + if: 'failure()' + uses: 'andymckay/cancel-action@0.3' prod_test_binary: runs-on: ubuntu-latest steps: @@ -67,6 +77,9 @@ jobs: name: Pack the binary using vercel/pkg - run: ./dist/monika -v name: Test to make sure printing the version succeeds + - name: Cancel workflow on failure + if: 'failure()' + uses: 'andymckay/cancel-action@0.3' test: runs-on: ubuntu-latest steps: @@ -77,4 +90,7 @@ jobs: node-version: 18.x - run: npm ci - run: npm run build -w packages/notification - - run: npm test && npx codecov \ No newline at end of file + - run: npm test && npx codecov + - name: Cancel workflow on failure + if: 'failure()' + uses: 'andymckay/cancel-action@0.3' diff --git a/.github/workflows/npm-notification-publish.yml b/.github/workflows/npm-notification-publish.yml index c951d2c05..a19fed3fa 100644 --- a/.github/workflows/npm-notification-publish.yml +++ b/.github/workflows/npm-notification-publish.yml @@ -6,17 +6,17 @@ name: Notification Package Release on: workflow_dispatch: push: - paths: - - 'package/notification' - branches: - - 'main' + paths: + - 'package/notification' + branches: + - 'main' permissions: issues: read pull-requests: read -jobs: - build-test: +jobs: + build-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -43,4 +43,3 @@ jobs: working-directory: ./packages/notification env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - diff --git a/.github/workflows/sonar-cloud.yml b/.github/workflows/sonar-cloud.yml index 806d82084..013e0085b 100644 --- a/.github/workflows/sonar-cloud.yml +++ b/.github/workflows/sonar-cloud.yml @@ -9,7 +9,7 @@ on: - main pull_request_target: types: [opened, reopened] - workflow_dispatch: # allow manual trigger for scans + workflow_dispatch: # allow manual trigger for scans permissions: issues: read @@ -19,12 +19,12 @@ jobs: sonarcloud: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - # Disabling shallow clone is recommended for improving relevancy of reporting - fetch-depth: 0 - - name: SonarCloud Scan - uses: sonarsource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - uses: actions/checkout@v2 + with: + # Disabling shallow clone is recommended for improving relevancy of reporting + fetch-depth: 0 + - name: SonarCloud Scan + uses: sonarsource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/teams-notify.yml b/.github/workflows/teams-notify.yml index a4ece3178..e7e64dfae 100644 --- a/.github/workflows/teams-notify.yml +++ b/.github/workflows/teams-notify.yml @@ -18,22 +18,22 @@ jobs: notify: runs-on: ubuntu-latest steps: - - name: Set variables - id: set_variables - env: + - name: Set variables + id: set_variables + env: ISSUE_TITLE: ${{ github.event.issue.title }} PR_TITLE: ${{ github.event.pull_request.title }} GITHUB_EVENT_NAME: ${{ github.event_name }} - run: | - if [ "$GITHUB_EVENT_NAME" = "issues" ]; then - echo "::set-output name=webhook_title::New issue opened: $ISSUE_TITLE" - echo "::set-output name=webhook_text::${{ github.event.issue.html_url }}" - else - echo "::set-output name=webhook_title::New PR opened: $PR_TITLE" - echo "::set-output name=webhook_text::${{ github.event.pull_request.html_url }}" - fi - - name: Notify Teams - uses: joelwmale/webhook-action@fd99bb3b8272237103e349e9bb4d9b0ead9a217c - with: - url: ${{secrets.HYPERJUMP_TEAMS_SYMON_WEBHOOK}} - body: '{"title": "${{ steps.set_variables.outputs.webhook_title }}", "text": "${{ steps.set_variables.outputs.webhook_text }}"}' + run: | + if [ "$GITHUB_EVENT_NAME" = "issues" ]; then + echo "::set-output name=webhook_title::New issue opened: $ISSUE_TITLE" + echo "::set-output name=webhook_text::${{ github.event.issue.html_url }}" + else + echo "::set-output name=webhook_title::New PR opened: $PR_TITLE" + echo "::set-output name=webhook_text::${{ github.event.pull_request.html_url }}" + fi + - name: Notify Teams + uses: joelwmale/webhook-action@fd99bb3b8272237103e349e9bb4d9b0ead9a217c + with: + url: ${{secrets.HYPERJUMP_TEAMS_SYMON_WEBHOOK}} + body: '{"title": "${{ steps.set_variables.outputs.webhook_title }}", "text": "${{ steps.set_variables.outputs.webhook_text }}"}' diff --git a/.github/workflows/upload-binary.yml b/.github/workflows/upload-binary.yml index 73c0b1050..6b7f82169 100644 --- a/.github/workflows/upload-binary.yml +++ b/.github/workflows/upload-binary.yml @@ -10,7 +10,7 @@ on: permissions: issues: read - pull-requests: read + pull-requests: read jobs: test: diff --git a/.prettierignore b/.prettierignore index c4a0a474a..77abb78e5 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,11 +3,10 @@ coverage .nyc_output lib package-lock.json -.eslintrc -.github +.eslintrc docs/out docs/.next docs/.cache docs/node_modules oclif.manifest.json -bin \ No newline at end of file +bin