Skip to content

Fix npm audit findings, adjust test harness#205

Merged
stephenyeargin merged 2 commits into
mainfrom
spring-cleaning
May 30, 2026
Merged

Fix npm audit findings, adjust test harness#205
stephenyeargin merged 2 commits into
mainfrom
spring-cleaning

Conversation

@stephenyeargin

Copy link
Copy Markdown
Owner

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

  • Updated hubot and several dev dependencies in package.json, replacing nyc with c8 for code coverage, and adjusted the test script accordingly. Also added overrides for diff and serialize-javascript to address potential security or compatibility concerns. [1] [2]

Grafana Bot Async Refactor

  • Refactored all Grafana bot command handlers in src/grafana.js to use async/await instead of .then() for improved readability and error handling. This affects dashboard, alert, and search commands. [1] [2] [3] [4]

Test Infrastructure Improvements

  • Replaced the hubot-mock-adapter dependency with a custom MockAdapter implementation in test/common/MockAdapter.js, and updated test bot setup in test/common/TestBot.js to use this adapter. [1] [2] [3]
  • Improved the test bot's message sending and response waiting logic to ensure async correctness and reliability in tests. [1] [2]

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 nyc with c8 for coverage reporting.
  • Replaced hubot-mock-adapter with a custom in-repo MockAdapter and adjusted the test bot harness async flow.
  • Refactored multiple src/grafana.js Hubot responders from .then(...) chains to async/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.

Comment thread test/common/TestBot.js Outdated
@stephenyeargin
stephenyeargin merged commit ee64d0f into main May 30, 2026
6 checks passed
@stephenyeargin
stephenyeargin deleted the spring-cleaning branch May 30, 2026 05:03
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.

2 participants