Fix npm audit findings, adjust test harness#205
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the project’s Node/Hubot tooling and test harness to address audit findings and improve reliability, while also refactoring Grafana command handlers to use async/await for clearer async control flow.
Changes:
- Updated dev dependencies (Hubot 14, Mocha 11) and replaced
nycwithc8for coverage reporting. - Replaced
hubot-mock-adapterwith a custom in-repoMockAdapterand adjusted the test bot harness async flow. - Refactored multiple
src/grafana.jsHubot responders from.then(...)chains toasync/await.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
package.json |
Bumps Hubot/dev tooling versions, switches coverage tooling to c8, and adds overrides to address audit items. |
package-lock.json |
Updates the dependency graph to match the dependency/tooling upgrades and overrides. |
src/grafana.js |
Converts several command handlers to async/await for simpler async logic. |
test/common/TestBot.js |
Updates the test harness to use the new mock adapter and tweaks async send/wait behavior. |
test/common/MockAdapter.js |
Adds a minimal Hubot adapter implementation for tests, replacing the external mock-adapter dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request modernizes dependencies, improves test reliability, and refactors the Grafana bot command handlers for better async/await usage. The most important changes are summarized below.
Dependency and Tooling Updates
hubotand several dev dependencies inpackage.json, replacingnycwithc8for code coverage, and adjusted the test script accordingly. Also addedoverridesfordiffandserialize-javascriptto address potential security or compatibility concerns. [1] [2]Grafana Bot Async Refactor
src/grafana.jsto useasync/awaitinstead of.then()for improved readability and error handling. This affects dashboard, alert, and search commands. [1] [2] [3] [4]Test Infrastructure Improvements
hubot-mock-adapterdependency with a customMockAdapterimplementation intest/common/MockAdapter.js, and updated test bot setup intest/common/TestBot.jsto use this adapter. [1] [2] [3]