Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

60 changes: 0 additions & 60 deletions .eslintrc.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/nodejs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:

strategy:
matrix:
node-version: ["20.x"]
node-version: ["24.x"]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm run lint
- run: npm test
4 changes: 0 additions & 4 deletions .mversionrc

This file was deleted.

16 changes: 16 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Supply-chain guardrails (npm >= 11.10).
# Recent npm compromises shipped payloads in install scripts and were pulled from the registry
# within hours to days. No package in this tree needs an install script.
ignore-scripts=true
# Only resolve versions that have been public for at least 14 days.
min-release-age=14
# Dependencies come from the registry only, never from git URLs.
allow-git=none
engine-strict=true
# Security fixes reviewed by hand (tarball diffed against the previous release, same publisher,
# no new dependencies or scripts) and pinned exactly via "overrides" in package.json. Drop
# each line, and its override pin, once the version is older than min-release-age:
# body-parser 2.4.0 (2026-10-22, GHSA-27r3-jxmh-p828) -> 2026-11-05
# follow-redirects 1.16.2 (2026-10-25, GHSA-mrwp-f3q8-3g9p) -> 2026-11-08
min-release-age-exclude[]=body-parser
min-release-age-exclude[]=follow-redirects
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
39 changes: 39 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,45 @@ in development
* Use Github Actions for tests.
* Remove TravisCI.

0.14.0
------

* Works with Hubot 14 as well as 11–13, on Node.js 24 LTS.

- Hubot 14 turned ``robot.commands`` into its CommandBus and keeps help text in
``robot.helpStrings``. The aliases' help entries now go to whichever list the running Hubot
has. Before, ``robot.commands.indexOf`` failed and no StackStorm commands loaded.
- Hubot 13.1.2 and later name the Slack adapter ``SlackBot`` instead of
``@hubot-friends/hubot-slack``. Both names now select the Slack formatting; before, replies
fell back to plain text.

* Fixed the bot exiting when the StackStorm API answered with an error body that has no
``faultstring``. st2client then passes the body object as the error message, and
``err.message.includes`` threw inside the handler.
* Dependencies:

- Removed ``uuid`` (Node's ``crypto.randomUUID``) and the unused ``cli-table``.
- lodash 4.18, truncate 3.
- ``overrides`` replace st2client's ``axios`` 0.21 with 1.x and ``eventsource`` 0.1 with 2.0.
Both had published advisories, and eventsource's was critical. st2client 1.2.6 is still
its latest release. Projects that depend on hubot-stackstorm need the same overrides,
because npm only applies them from the top-level ``package.json``.
- ``.npmrc`` with supply-chain guardrails: no install scripts, no git dependencies, and only
versions published at least 14 days ago. Two reviewed security fixes are pinned until
they pass that age.
- Production dependencies have no ``npm audit`` findings.

* Tests and tooling:

- mocha 12 with c8 coverage; ESLint 10 with a flat config.
- Removed gulp, babel-eslint, nyc, mversion and hubot-mock-adapter.
- The six test files that start a real Hubot never ran: their ``describe`` callbacks were
async, so mocha registered no tests. They are ported to Hubot 14's API with an in-memory
adapter (``test/support/robot.js``).
- New tests cover Hubot 14 help, adapter selection and the API-error crash.
- 94 tests pass, with 88% line coverage.
- CI runs lint and tests on Node.js 24.

0.13.0
------

Expand Down
22 changes: 7 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,29 +107,21 @@ Please see https://github.com/StackStorm/hubot-stackstorm/issues

## Testing

### Lint
Node.js 24 (`.nvmrc`) with npm 11.10 or later: `.npmrc` turns off install scripts and only
accepts package versions published at least 14 days ago.

```bash
gulp lint
```

### Tests

```bash
gulp test
npm ci
npm run lint
npm test # mocha, with c8 coverage in coverage/
```

## Publishing

Reminder to ourselves, instead of bumping the version manually, use `mversion`.

```
npm install -g mversion
mversion patch
```bash
npm version patch # bumps package.json, commits and tags v<version>
```

This will bump the version in `package.json`, commit and create a tag with format described in `.mversionrc`.

## Copyright, License, and Contributors Agreement

Copyright 2015-2019 Extreme Networks, Inc.
Expand Down
79 changes: 79 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// ESLint flat config: the rules of the old .eslintrc.yml (which listed its rules rather than extend
// a preset), minus the formatting-only rules ESLint no longer ships (arrow-spacing,
// rest-spread-spacing, template-curly-spacing, wrap-iife).
"use strict";

const globals = require('globals');

const LICENSE = "(// Copyright \\d{4} [a-zA-Z0-9,\\.\\s]+\\n)+//\\n// Licensed under the Apache License, Version 2\\.0 \\(the \"License\"\\);\\n// you may not use this file except in compliance with the License\\.\\n// You may obtain a copy of the License at\\n//\\n//\\s+http://www\\.apache\\.org/licenses/LICENSE-2\\.0\\n//\\n// Unless required by applicable law or agreed to in writing, software\\n// distributed under the License is distributed on an \"AS IS\" BASIS,\\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\\.\\n// See the License for the specific language governing permissions and\\n// limitations under the License\\.\\n";

// Every source file starts with the Apache 2.0 header (one or more copyright lines, then the
// license text). A local rule, as in st2web, since eslint-plugin-notice doesn't run on ESLint 10.
const license = {
rules: {
header: {
meta: {
type: 'problem',
messages: { missing: 'Missing or malformed Apache 2.0 license header.' },
schema: [],
},
create(context) {
const header = new RegExp(`^${LICENSE}`);
return {
Program(node) {
if (!header.test(context.sourceCode.text)) {
context.report({ node, loc: { line: 1, column: 0 }, messageId: 'missing' });
}
},
};
},
},
},
};

module.exports = [
{ ignores: ['node_modules/', 'coverage/'] },
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 2024,
sourceType: 'commonjs',
globals: { ...globals.node, ...globals.mocha },
},
plugins: { license },
rules: {
camelcase: 'off',
curly: ['error', 'all'],
eqeqeq: ['error', 'allow-null'],
strict: 'off',
'new-cap': 'error',
'no-bitwise': 'error',
'no-caller': 'error',
'no-case-declarations': 'off',
'no-cond-assign': ['error', 'except-parens'],
'no-debugger': 'error',
'no-empty': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-irregular-whitespace': 'error',
'no-iterator': 'error',
'no-loop-func': 'error',
'no-multi-str': 'error',
'no-new': 'error',
'no-proto': 'error',
'no-script-url': 'error',
'no-sequences': 'error',
'no-undef': 'error',
'no-with': 'error',
'valid-typeof': 'error',
'prefer-const': 'error',
'prefer-spread': 'error',
'license/header': 'error',
},
},
{
// this file has no license header of its own
files: ['eslint.config.js'],
rules: { 'license/header': 'off' },
},
];
31 changes: 0 additions & 31 deletions gulpfile.js

This file was deleted.

Loading
Loading