Skip to content

ci: Add support for run plugin tests in BBB's CI - #23028

Merged
gustavotrott merged 4 commits into
bigbluebutton:v3.0.x-releasefrom
GuiLeme:plugin-test-support
May 6, 2025
Merged

gustavotrott merged 4 commits into
bigbluebutton:v3.0.x-releasefrom
GuiLeme:plugin-test-support

Conversation

@GuiLeme

@GuiLeme GuiLeme commented Apr 25, 2025 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Add support for run plugin tests in BBB's CI. This basically fix the typescript issues that arise from importing a commit and building it all inside the CI.

Motivation

Add CI tests for plugins in BBB's repo

More

Closely related to bigbluebutton/bigbluebutton-html-plugin-sdk#176

Needs to be updated once a new SDK version is published

@coderabbitai

coderabbitai Bot commented Apr 25, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

The changes update the bigbluebutton-html5/package.json file by adding a new postinstall script in the scripts section. This script checks if the bigbluebutton-html-plugin-sdk dependency is specified as a URL matching "https://codeload". If so, it changes directory into the installed bigbluebutton-html-plugin-sdk package inside node_modules, runs npm ci to install its dependencies, executes npm run build to build the package, and then removes the package's node_modules directory. If the condition is not met, the script exits without error. No other scripts or dependencies were modified.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant NPM
    participant Postinstall Script
    participant PluginSDK

    Developer->>NPM: Run npm install
    NPM->>PluginSDK: Download from GitHub tarball URL
    NPM->>NPM: Install dependencies
    NPM->>Postinstall Script: Trigger postinstall
    Postinstall Script->>NPM: Check package.json for URL dependency
    alt If dependency is a URL
        Postinstall Script->>PluginSDK: cd to package directory
        Postinstall Script->>PluginSDK: Run npm ci
        Postinstall Script->>PluginSDK: Run npm run build
        Postinstall Script->>PluginSDK: Remove node_modules
    end
    Postinstall Script->>NPM: Complete postinstall (ignore errors)
Loading

Suggested reviewers

  • antobinary

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ad0988 and d909f78.

⛔ Files ignored due to path filters (1)
  • bigbluebutton-html5/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • bigbluebutton-html5/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • bigbluebutton-html5/package.json
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: build-package (others)
  • GitHub Check: build-package (bbb-html5)
  • GitHub Check: build-package (bbb-graphql-server)
  • GitHub Check: build-package (bbb-playback-record)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
bigbluebutton-html5/package.json (3)

6-6: Refactor and modularize the postinstall script for maintainability
The one-liner at scripts.postinstall is hard to read, test, and extend. Consider extracting this logic into a dedicated script (e.g. scripts/postinstall-plugin-sdk.sh or a Node script) and then invoking it:

-  "postinstall": "grep -q '\"bigbluebutton-html-plugin-sdk\" *: *\"https://codeload' package.json && echo executing postInstall... && cd node_modules/bigbluebutton-html-plugin-sdk 2>/dev/null && npm ci && npm run build && rm -rf node_modules || true",
+  "postinstall": "sh scripts/postinstall-plugin-sdk.sh"

This lets you add robust error handling, clear logging, and easier cross-platform support.


60-60: Consider using a git+https dependency for clarity
Many workflows support git+https references more predictably than codeload tarballs. You could rewrite the dependency as:

-"bigbluebutton-html-plugin-sdk": "https://codeload.github.com/bigbluebutton/bigbluebutton-html-plugin-sdk/tar.gz/2239fd4159f0853ed9405de3b8a00818ff36ec86",
+"bigbluebutton-html-plugin-sdk": "git+https://github.com/bigbluebutton/bigbluebutton-html-plugin-sdk.git#2239fd4159f0853ed9405de3b8a00818ff36ec86",

This approach is easier to pin and can improve cache hits in CI.


5-14: Add dedicated scripts for plugin SDK build & test
To streamline CI and local workflows, you might expose separate npm scripts:

"scripts": {
  "build:plugin-sdk": "sh scripts/postinstall-plugin-sdk.sh",
  "test:plugin-sdk": "cd node_modules/bigbluebutton-html-plugin-sdk && npm test",
  "postinstall": "npm run build:plugin-sdk"
}

Then CI can explicitly run npm run test:plugin-sdk after npm ci, making the intent clearer and failures easier to diagnose.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6df4902 and b1d7cc3.

⛔ Files ignored due to path filters (1)
  • bigbluebutton-html5/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • bigbluebutton-html5/package.json (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: build-package (others)
  • GitHub Check: build-package (bbb-html5)
  • GitHub Check: build-package (bbb-graphql-server)
  • GitHub Check: build-package (bbb-playback-record)
  • GitHub Check: ts-code-compilation
  • GitHub Check: ts-code-validation
🔇 Additional comments (1)
bigbluebutton-html5/package.json (1)

60-60:

Details

❓ Verification inconclusive

Validate tarball URL installation across package managers
Referencing a raw tarball can behave differently under npm, Yarn, and pnpm, and can break CI caching. Please verify that the URL is reachable in your CI environment and that the SDK installs correctly:

Ensure all pipelines still pass with this change.


🏁 Script executed:

npm install
npm ls bigbluebutton-html-plugin-sdk

yarn install --frozen-lockfile
pnpm install

Length of output: 1100


Please verify tarball URL installation in each package manager
It looks like the install commands were run from the repo root (no package.json found). To confirm the SDK URL works across npm, Yarn, and pnpm, cd into bigbluebutton-html5/ and run:

cd bigbluebutton-html5
npm install
npm ls bigbluebutton-html-plugin-sdk
yarn install --frozen-lockfile
pnpm install

Ensure the tarball URL is reachable, the SDK installs correctly, and all CI pipelines pass.

@antobinary antobinary added this to the Release 3.0 milestone Apr 25, 2025
Comment thread bigbluebutton-html5/package.json Resolved
@GuiLeme
GuiLeme requested a review from gustavotrott April 28, 2025 14:33
@github-actions

Copy link
Copy Markdown

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@sonarqubecloud

sonarqubecloud Bot commented May 6, 2025

Copy link
Copy Markdown

@github-actions

github-actions Bot commented May 6, 2025

Copy link
Copy Markdown

Automated tests Summary

✅ All the CI tests have passed!

@gustavotrott gustavotrott left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@gustavotrott
gustavotrott merged commit 27451cd into bigbluebutton:v3.0.x-release May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants