Skip to content

Migrate to NodeJS 24 - #196

Open
bishopbm1 wants to merge 5 commits into
StackStorm:masterfrom
EncoreTechnologies:master
Open

bishopbm1 wants to merge 5 commits into
StackStorm:masterfrom
EncoreTechnologies:master

Conversation

@bishopbm1

Copy link
Copy Markdown

st2chatops on Node 24 LTS with hubot 14 and hubot-slack 3.8

Moves st2chatops from Node 20 and npm 6 tooling to Node 24 LTS, updates hubot, the Slack adapter
and hubot-stackstorm, patches vulnerable transitive dependencies, adds automated tests, and builds
a noarch RPM that requires Node 24. Per-change detail is in CHANGELOG.rst.

What changed

  • Node 24 LTS: .nvmrc and engines are set. npm-shrinkwrap.json is regenerated with
    npm 11 (lockfile v3).
  • Dependencies:
    • hubot 11.3 → 14.1 (Express 5, connect-multiparty removed, and a CommandBus for commands).
    • @hubot-friends/hubot-slack 3.1 → 3.8.0.
    • hubot-stackstorm 0.13 → 0.14.0, from Encore's fork. It adds hubot 14 support and the Slack
      adapter-name fix, and the bot no longer exits on some API errors. It is vendored as
      vendor/hubot-stackstorm-0.14.0.tgz, because git dependencies are blocked; the tarball's
      integrity hash is in the lockfile.
    • botbuilder removed: it was left over from the Microsoft Teams adapter, and nothing loads it.
    • overrides replace st2client's axios 0.21 with 1.20 and eventsource 0.1 with 2.0.2 (the
      latter's advisory was critical). They also pin body-parser 2.4.0 and follow-redirects
      1.16.2: security fixes still inside the 14-day window, reviewed and listed with expiry dates
      in .npmrc.
    • Production dependencies have no npm audit findings.
  • scripts/st2-help.js: hubot 14's built-in help answers <bot> help before any script
    sees it, and lists only CommandBus commands. This script removes it, so hubot-help answers
    <bot> help and !help alike with the StackStorm aliases, as before.
  • bin/hubot: honours HUBOT_ADAPTER (slack maps to the bundled hubot-slack) instead of
    always loading Slack. That makes bin/hubot --test (the Shell adapter) work again.
  • npm supply-chain guardrails (.npmrc):
    • only versions published at least 14 days ago;
    • no install scripts;
    • no git dependencies;
    • engine-strict.
  • Tests: npm test uses Node's built-in test runner, so it adds no dependencies. There are
    two parts:
    • an end-to-end test that starts bin/hubot --test against a running StackStorm. It checks that
      the aliases load and appear in both !help and <bot> help, then runs !pack get core and
      waits for the reply to come back through the chatops.notify rule;
    • a unit test for st2-help.js.
  • Packaging:
    • The RPM Requires: nodejs >= 1:24. RHEL's nodejs has Epoch 1, so the old >= 20.0 accepted
      any version.
    • The RPM is noarch, since there is no native code.
    • make build runs npm ci --omit=dev, and a make rpm target is added.
    • The EL9 packaging image uses the nodejs:24 module stream.
  • Docker image: node:24-alpine, built with npm ci, and running as the node user. Its
    CMD works now.
  • Removed: dev/ (Teams-era development image) and scripts/self-check.sh (Python 2, EL7).

Testing

  • npm test: all 6 tests pass, both from the Docker image and against the installed RPM (run as
    the st2 service user). Each regression test was checked to fail without its fix.
  • RPM on RHEL 9:
    • built with Node 24 from the nodejs:24 module stream;
    • refused by dnf while the host is on Node 20, as intended;
    • upgrades st2chatops-3.9.0, and keeps an edited st2chatops.env (%config(noreplace)).
  • On Slack (Socket Mode): the bot connects with hubot-stackstorm's Slack formatting, loads the
    aliases, and answers !help and alias commands.

Comment thread rpm/st2chatops.spec
Release: %{release}
Requires: nodejs >= 20.0
# RHEL's nodejs carries Epoch 1: without it any version satisfies the requirement
Requires: nodejs >= 1:24

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.

Is this true if I install it via module and/or with the curl bash script?

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