mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-10-01 01:36:06 -04:00
Bump node version to 18 (#496)
* try win dns res * add dns hack to application service tests * fix unused import * update types * add note about why dns resolution order is necessary
This commit is contained in:
parent
7ca748c3c0
commit
8bf628e5bd
12
.github/workflows/mjolnir.yml
vendored
12
.github/workflows/mjolnir.yml
vendored
@ -17,10 +17,10 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Specifically use node 16 like in the readme.
|
||||
- name: Specifically use node 18 like in the readme.
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: '18'
|
||||
- run: yarn install
|
||||
- run: yarn build
|
||||
- run: yarn lint
|
||||
@ -29,10 +29,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Specifically use node 16 like in the readme.
|
||||
- name: Specifically use node 18 like in the readme.
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: '18'
|
||||
- run: yarn install
|
||||
- run: yarn test
|
||||
integration:
|
||||
@ -43,7 +43,7 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: '18'
|
||||
- name: Fetch and build mx-tester (cached across runs)
|
||||
uses: baptiste0928/cargo-install@v1
|
||||
with:
|
||||
@ -65,7 +65,7 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: '18'
|
||||
- name: Fetch and build mx-tester (cached across runs)
|
||||
uses: baptiste0928/cargo-install@v1
|
||||
with:
|
||||
|
@ -1,5 +1,5 @@
|
||||
# We can't use alpine anymore because crypto has rust deps.
|
||||
FROM node:16-slim
|
||||
FROM node:18-slim
|
||||
COPY . /tmp/src
|
||||
RUN cd /tmp/src \
|
||||
&& yarn install \
|
||||
|
@ -1,5 +1,5 @@
|
||||
These instructions are to build and run mjolnir without using [Docker](./setup_docker.md).
|
||||
To build mjolnir, you have to have installed [Node >=16](https://nodejs.org/en/download/), [npm](https://docs.npmjs.com/cli/v7/configuring-npm/install) and [yarn >1.x](https://classic.yarnpkg.com/en/docs/install).
|
||||
To build mjolnir, you have to have installed [Node >=18](https://nodejs.org/en/download/), [npm](https://docs.npmjs.com/cli/v7/configuring-npm/install) and [yarn >1.x](https://classic.yarnpkg.com/en/docs/install).
|
||||
|
||||
Copy the latest release tag from https://github.com/matrix-org/mjolnir/releases/latest/ to use when cloning. For example `v1.6.1` - please check the link for the current version as this mentioned example might be outdated.
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
"@types/jsdom": "^16.2.11",
|
||||
"@types/mocha": "^9.0.0",
|
||||
"@types/nedb": "^1.8.12",
|
||||
"@types/node": "^16.7.10",
|
||||
"@types/node": "^18.0.0",
|
||||
"@types/pg": "^8.6.5",
|
||||
"@types/request": "^2.48.8",
|
||||
"@types/shell-quote": "1.7.1",
|
||||
@ -64,6 +64,6 @@
|
||||
"yaml": "^2.2.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
"node": ">=18.0.0"
|
||||
}
|
||||
}
|
||||
|
@ -3,12 +3,16 @@ import { newTestUser } from "../../integration/clientHelper";
|
||||
import { getFirstReply } from "../../integration/commands/commandUtils";
|
||||
import { MatrixClient } from "matrix-bot-sdk";
|
||||
import { MjolnirAppService } from "../../../src/appservice/AppService";
|
||||
import dns from 'node:dns';
|
||||
|
||||
interface Context extends Mocha.Context {
|
||||
moderator?: MatrixClient,
|
||||
appservice?: MjolnirAppService
|
||||
}
|
||||
|
||||
// Necessary for CI: Node 17+ defaults to using ipv6 first, but Github Actions does not support ipv6
|
||||
dns.setDefaultResultOrder('ipv4first');
|
||||
|
||||
describe("Test that the app service can provision a mjolnir on invite of the appservice bot", function () {
|
||||
afterEach(function(this: Context) {
|
||||
this.moderator?.stop();
|
||||
|
@ -5,6 +5,7 @@ import { CreateMjolnirResponse, MjolnirWebAPIClient } from "../utils/webAPIClien
|
||||
import { MatrixClient } from "matrix-bot-sdk";
|
||||
import { getFirstReply } from "../../integration/commands/commandUtils";
|
||||
import expect from "expect";
|
||||
import dns from 'node:dns';
|
||||
|
||||
|
||||
interface Context extends Mocha.Context {
|
||||
@ -12,6 +13,8 @@ interface Context extends Mocha.Context {
|
||||
moderator?: MatrixClient
|
||||
}
|
||||
|
||||
// Necessary for CI: Node 17+ defaults to using ipv6 first, but Github Actions does not support ipv6
|
||||
dns.setDefaultResultOrder('ipv4first');
|
||||
|
||||
describe("Test that the app service can provision a mjolnir when requested from the web API", function () {
|
||||
afterEach(function(this: Context) {
|
||||
|
@ -1,6 +1,10 @@
|
||||
import { read as configRead } from "../../src/config";
|
||||
import { makeMjolnir, teardownManagementRoom } from "./mjolnirSetupUtils";
|
||||
import { register } from "prom-client";
|
||||
import dns from 'node:dns';
|
||||
|
||||
// Necessary for CI: Node 17+ defaults to using ipv6 first, but Github Actions does not support ipv6
|
||||
dns.setDefaultResultOrder('ipv4first');
|
||||
|
||||
// When Mjolnir starts (src/index.ts) it clobbers the config by resolving the management room
|
||||
// alias specified in the config (config.managementRoom) and overwriting that with the room ID.
|
||||
|
14
yarn.lock
14
yarn.lock
@ -268,11 +268,18 @@
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/node@*", "@types/node@^16.7.10":
|
||||
"@types/node@*":
|
||||
version "16.10.2"
|
||||
resolved "https://registry.npmjs.org/@types/node/-/node-16.10.2.tgz"
|
||||
integrity sha512-zCclL4/rx+W5SQTzFs9wyvvyCwoK9QtBpratqz2IYJ3O8Umrn0m3nsTv0wQBk9sRGpvUe9CwPDrQFB10f1FIjQ==
|
||||
|
||||
"@types/node@^18.0.0":
|
||||
version "18.18.9"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.18.9.tgz#5527ea1832db3bba8eb8023ce8497b7d3f299592"
|
||||
integrity sha512-0f5klcuImLnG4Qreu9hPj/rEfFq6YRc5n2mAjSsH+ec/mJL+3voBH0+8T7o8RpFjH7ovc+TRsL/c7OYIQsPTfQ==
|
||||
dependencies:
|
||||
undici-types "~5.26.4"
|
||||
|
||||
"@types/parse5@*":
|
||||
version "6.0.1"
|
||||
resolved "https://registry.npmjs.org/@types/parse5/-/parse5-6.0.1.tgz"
|
||||
@ -3364,6 +3371,11 @@ underscore@~1.4.4:
|
||||
resolved "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz"
|
||||
integrity sha512-ZqGrAgaqqZM7LGRzNjLnw5elevWb5M8LEoDMadxIW3OWbcv72wMMgKdwOKpd5Fqxe8choLD8HN3iSj3TUh/giQ==
|
||||
|
||||
undici-types@~5.26.4:
|
||||
version "5.26.5"
|
||||
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
|
||||
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==
|
||||
|
||||
universalify@^0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz"
|
||||
|
Loading…
Reference in New Issue
Block a user