Skip to content

Commit a2b1373

Browse files
committed
[add-lint-and-ci] - added lint, ci and boilerplate for plugin building
1 parent 9496076 commit a2b1373

15 files changed

Lines changed: 470 additions & 1 deletion

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

.eslintrc

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
{
3+
"root": true,
4+
"parser": "@typescript-eslint/parser",
5+
"extends": [
6+
"airbnb",
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/eslint-recommended",
9+
"plugin:@typescript-eslint/recommended"
10+
],
11+
"parserOptions": {
12+
"ecmaVersion": 2020
13+
},
14+
"plugins": [
15+
"@typescript-eslint",
16+
"react",
17+
"jsx-a11y",
18+
"import"
19+
],
20+
"env": {
21+
"es6": true,
22+
"node": true,
23+
"browser": true
24+
},
25+
"rules": {
26+
"react/jsx-filename-extension": [1, { "extensions": [".tsx", ".jsx"] }],
27+
"no-shadow": "off",
28+
"@typescript-eslint/no-shadow": "warn",
29+
"import/prefer-default-export": "off",
30+
"no-underscore-dangle": 0,
31+
"import/extensions": [2, "never"],
32+
"import/no-absolute-path": 0,
33+
"import/no-unresolved": 0,
34+
"import/no-extraneous-dependencies": 1,
35+
"react/prop-types": 1,
36+
"jsx-a11y/no-access-key": 0,
37+
"react/jsx-props-no-spreading": "off",
38+
"max-classes-per-file": "off",
39+
"class-methods-use-this": "off"
40+
},
41+
"globals": {
42+
"browser": "writable"
43+
}
44+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: BBB-Plugin-SDK
3+
about: Template for creating BBB-Plugin-SDK Issue (SDK to create plugins for Bigbluebutton).
4+
title: ''
5+
labels: 'module: client'
6+
assignees: ''
7+
8+
---
9+
10+
<!--PLEASE DO NOT FILE ISSUES FOR GENERAL SUPPORT QUESTIONS.
11+
This issue tracker is only for bbb development related issues.-->
12+
13+
**Describe the bug**
14+
A clear and concise description of what the bug is.
15+
16+
**To Reproduce**
17+
Steps to reproduce the behavior:
18+
1. Go to '...'
19+
2. Click on '....'
20+
3. Scroll down to '....'
21+
4. See error
22+
23+
**Expected behavior**
24+
A clear and concise description of what you expected to happen.
25+
26+
**Actual behavior**
27+
A clear and concise description of what you expected to happen.
28+
29+
**Screenshots**
30+
If applicable, add screenshots to help explain your problem.
31+
32+
**BBB version, plugin in which The bug happened and SDK version:**
33+
BigBlueButton continually evolves. Providing the version/build helps us to pinpoint when an issue was introduced.
34+
Example:
35+
$ sudo bbb-conf --check | grep BigBlueButton
36+
BigBlueButton Server 2.2.2 (1816)
37+
38+
The SDK version is mentioned in the package.json file of the plugin, so search for "bigbluebutton-html-plugin-sdk" inside that file.
39+
40+
**Desktop (please complete the following information):**
41+
- OS: [e.g. Windows, Mac]
42+
- Browser [e.g. Chrome, Safari]
43+
- Version [e.g. 22]
44+
45+
**Smartphone (please complete the following information):**
46+
- Device: [e.g. iPhone6]
47+
- OS: [e.g. iOS8.1]
48+
- Browser [e.g. stock browser, Safari]
49+
- Version [e.g. 22]
50+
51+
**Additional context**
52+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: BigBlueButton GitHub Repository
4+
url: https://github.com/bigbluebutton/bigbluebutton
5+
about: Everything BigBlueButton (in case you are looking for something different than plugin sdk)
6+
- name: Looking for commercial support in building/maintaining plugins
7+
url: https://bigbluebutton.org/commercial-support
8+
about: List of companies offering commercial BigBlueButton support
9+
- name: BigBlueButton Developers Mailing List:
10+
url: https://groups.google.com/forum/#!forum/bigbluebutton-dev
11+
about: Ask questions and share experiences with other BigBlueButton developers (including about plugins).

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!--
2+
PLEASE READ THIS MESSAGE.
3+
4+
HOW TO WRITE A GOOD PULL REQUEST?
5+
6+
- Make it small.
7+
- Do only one thing.
8+
- Avoid re-formatting.
9+
- Make sure the code builds and works.
10+
- Write useful descriptions and titles.
11+
- Address review comments in terms of additional commits.
12+
- Do not amend/squash existing ones unless the PR is trivial.
13+
- Read the contributing guide: https://docs.bigbluebutton.org/support/faq.html#bigbluebutton-development-process
14+
- Sign and send the Contributor License Agreement: https://docs.bigbluebutton.org/support/faq.html#why-do-i-need-to-sign-a-contributor-license-agreement-to-contribute-source-code
15+
16+
-->
17+
18+
### What does this PR do?
19+
20+
<!-- A brief description of each change being made with this pull request. -->
21+
22+
### Closes Issue(s)
23+
<!-- List here all the issues closed by this pull request. Use keyword `closes` before each issue number
24+
Closes #123456
25+
-->
26+
Closes #
27+
28+
29+
### Motivation
30+
31+
<!-- What inspired you to submit this pull request? -->
32+
33+
### More
34+
35+
<!-- Anything else we should know when reviewing? -->
36+
- [ ] Added/updated documentation
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Merge branches
2+
on:
3+
workflow_call:
4+
5+
runs:
6+
using: "composite"
7+
steps:
8+
- name: Checkout ${{ github.event.pull_request.base.ref || 'master' }}
9+
uses: actions/checkout@v4
10+
with:
11+
ref: ${{ github.event.pull_request.base.ref || '' }}
12+
fetch-depth: 0 # Fetch all history
13+
- name: Merge pr-${{ github.event.number }} into ${{ github.event.pull_request.base.ref }}
14+
if: github.event_name == 'pull_request'
15+
shell: bash
16+
run: |
17+
git config user.name "BBB Automated Tests"
18+
git config user.email "tests@bigbluebutton.org"
19+
git config pull.rebase false
20+
git pull origin pull/${{ github.event.number }}/head:${{ github.head_ref }}

.github/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ newPRWelcomeComment: >
55
Thank you for this contribution!
66
Could you please confirm if you already sent in the signed Contributor License Agreement? See https://docs.bigbluebutton.org/support/faq.html#why-do-i-need-to-sign-a-contributor-license-agreement-to-contribute-source-code
77
Thanks in advance!
8-

.github/stale.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Number of days of inactivity before an issue becomes stale
2+
daysUntilStale: 270
3+
# Number of days of inactivity before a stale issue is closed
4+
daysUntilClose: 90
5+
# Issues with these labels will never be considered stale
6+
exemptLabels:
7+
- "status: accepted"
8+
- "status: verify"
9+
- "target: security"
10+
- "type: discussion"
11+
# Label to use when marking an issue as stale
12+
staleLabel: "status: stale"
13+
# Comment to post when marking an issue as stale. Set to `false` to disable
14+
markComment: >
15+
This issue has been automatically marked as stale because it has not had
16+
recent activity. It will be closed if no further activity occurs. Thank you
17+
for your contributions.
18+
# Comment to post when closing a stale issue. Set to `false` to disable
19+
closeComment: false
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Automated tests - publish results
2+
on:
3+
workflow_run:
4+
workflows:
5+
- Automated tests
6+
types:
7+
- completed
8+
9+
jobs:
10+
get-pr-data:
11+
runs-on: ubuntu-latest
12+
if: ${{ github.event.workflow_run.event == 'pull_request' }}
13+
outputs:
14+
pr-number: ${{ steps.set-env.outputs.pr-number }}
15+
workflow-id: ${{ steps.set-env.outputs.workflow-id }}
16+
steps:
17+
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow
18+
- name: Download artifact
19+
uses: actions/github-script@v6
20+
with:
21+
script: |
22+
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
23+
owner: context.repo.owner,
24+
repo: context.repo.repo,
25+
run_id: context.payload.workflow_run.id,
26+
});
27+
28+
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
29+
return artifact.name == "pr-comment-data"
30+
})[0];
31+
let download = await github.rest.actions.downloadArtifact({
32+
owner: context.repo.owner,
33+
repo: context.repo.repo,
34+
artifact_id: matchArtifact.id,
35+
archive_format: 'zip',
36+
});
37+
let fs = require('fs');
38+
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/pr-comment-data.zip`, Buffer.from(download.data));
39+
- name: Unzip artifact
40+
run: unzip pr-comment-data.zip
41+
- name: Set env variables
42+
id: set-env
43+
run: |
44+
echo "pr-number=$(cat ./pr_number)" >> $GITHUB_OUTPUT
45+
echo "workflow-id=$(cat ./workflow_id)" >> $GITHUB_OUTPUT
46+
comment-pr:
47+
runs-on: ubuntu-latest
48+
permissions:
49+
pull-requests: write
50+
needs: get-pr-data
51+
steps:
52+
- name: Find Comment
53+
uses: peter-evans/find-comment@v2
54+
id: fc
55+
with:
56+
issue-number: ${{ needs.get-pr-data.outputs.pr-number }}
57+
comment-author: "github-actions[bot]"
58+
body-includes: Automated tests Summary
59+
- name: Remove previous comment
60+
if: steps.fc.outputs.comment-id != ''
61+
uses: actions/github-script@v6
62+
with:
63+
script: |
64+
github.rest.issues.deleteComment({
65+
owner: context.repo.owner,
66+
repo: context.repo.repo,
67+
comment_id: ${{ steps.fc.outputs.comment-id }}
68+
})
69+
- name: Passing tests comment
70+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
71+
uses: peter-evans/create-or-update-comment@v2
72+
with:
73+
issue-number: ${{ needs.get-pr-data.outputs.pr-number }}
74+
body: |
75+
<h1>Automated tests Summary</h1>
76+
<h3><strong>:white_check_mark:</strong> All the CI tests have passed!</h3>
77+
- name: Failing tests comment
78+
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
79+
uses: peter-evans/create-or-update-comment@v2
80+
with:
81+
issue-number: ${{ needs.get-pr-data.outputs.pr-number }}
82+
body: |
83+
<h1> Automated tests Summary</h1>
84+
<h3><strong>:rotating_light:</strong> Test workflow has failed</h3>
85+
86+
___
87+
88+
[Click here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ needs.get-pr-data.outputs.workflow-id }}) to check the action test reports
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Merge conflict check
2+
on:
3+
push:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- synchronize
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
main:
14+
permissions:
15+
pull-requests: write # for eps1lon/actions-label-merge-conflict to label PRs
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Check for dirty pull requests
19+
uses: eps1lon/actions-label-merge-conflict@v3
20+
with:
21+
dirtyLabel: "status: conflict"
22+
repoToken: "${{ secrets.GITHUB_TOKEN }}"
23+
commentOnDirty: |
24+
This pull request has conflicts ☹
25+
Please resolve those so we can review the pull request.
26+
Thanks.

0 commit comments

Comments
 (0)