Skip to content

Commit

Permalink
Merge branch 'develop' into hs/build-vite-esm
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot authored Apr 11, 2024
2 parents 62ca955 + f740e5c commit 1411e6d
Show file tree
Hide file tree
Showing 20 changed files with 83 additions and 41 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docs-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Build docs
on:
pull_request:
push:
branches: ["develop", "release-*"]

jobs:
build:
Expand Down
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
2.0.0 (2024-04-08)
==================

**Note**: This release drops support for Node 18. The minimum required version is now 20+.

Bugfixes
--------

- Fix Redis <=6.2 failing to clear the command queue in pooling mode. ([\#1763](https://github.com/matrix-org/matrix-appservice-irc/issues/1763))
- Fix GitHub CI docker builds failing for community PRs. ([\#1767](https://github.com/matrix-org/matrix-appservice-irc/issues/1767))


Improved Documentation
----------------------

- Mention that the libera.chat bridge has since been shut down. ([\#1784](https://github.com/matrix-org/matrix-appservice-irc/issues/1784))


Deprecations and Removals
-------------------------

- Drop `dynamicChannels.groupId` config option. Groups were unstable and are no longer supported by any Matrix implementations. ([\#1772](https://github.com/matrix-org/matrix-appservice-irc/issues/1772))


Internal Changes
----------------

- Remove some build-time dependencies from the runtime dependency list. ([\#1758](https://github.com/matrix-org/matrix-appservice-irc/issues/1758))
- Add option to ignore "functional members" when checking if an admin room contains two users. ([\#1782](https://github.com/matrix-org/matrix-appservice-irc/issues/1782))
- Fixup types for Timers so the bridge works with newer node versions. ([\#1788](https://github.com/matrix-org/matrix-appservice-irc/issues/1788))
- Update dependencies. ([\#1798](https://github.com/matrix-org/matrix-appservice-irc/issues/1798))
- Add tests for various forms of rich replies. ([\#1799](https://github.com/matrix-org/matrix-appservice-irc/issues/1799))


1.0.1 (2023-07-31)
==================

Expand Down
1 change: 0 additions & 1 deletion changelog.d/1758.misc

This file was deleted.

2 changes: 0 additions & 2 deletions changelog.d/1763.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/1767.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/1772.removal

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/1782.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/1784.doc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/1788.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/1798.misc

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/1799.misc

This file was deleted.

1 change: 1 addition & 0 deletions changelog.d/1803.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve e2e test reliability.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "matrix-appservice-irc",
"version": "1.0.1",
"version": "2.0.0",
"description": "An IRC Bridge for Matrix",
"main": "app.js",
"bin": "./bin/matrix-appservice-irc",
Expand Down Expand Up @@ -57,7 +57,7 @@
},
"devDependencies": {
"@tailwindcss/forms": "^0.5.3",
"@tsconfig/node20": "^20.1.2",
"@tsconfig/node20": "^20.1.4",
"@types/bluebird": "^3.5.36",
"@types/diff": "^5.0.2",
"@types/express": "4.17.21",
Expand Down
1 change: 1 addition & 0 deletions spec/e2e/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
reporters: [['github-actions', {silent: false}], 'summary'],
transformIgnorePatterns: ['<rootDir>/node_modules/'],
testTimeout: 60000,
transform: {
Expand Down
4 changes: 3 additions & 1 deletion spec/e2e/quit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('Ensure quit messsage is sent', () => {
const cRoomId = await testEnv.joinChannelHelper(alice, adminRoom, channel);

// Ensure we join the IRC side
await alice.sendText(cRoomId, `Hello world!`);
alice.sendText(cRoomId, `Hello world!`);
await bob.waitForEvent('message', 10000);

const quitEvent = bob.waitForEvent('quit', 10000);
Expand All @@ -39,5 +39,7 @@ describe('Ensure quit messsage is sent', () => {
expect(nick).toEqual(`M-${opts.matrixLocalparts?.[0]}`);
expect(message).toEqual('Quit: Reconnecting');
expect(channels).toContain(channel);
alice.sendText(cRoomId, `I'm back baby!`);
await bob.waitForEvent('message', 10000);
});
});
1 change: 1 addition & 0 deletions spec/e2e/replies.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ describe('Reply handling', () => {
expect(ircMessage[2]).toContain("Short reply");
expect(ircMessage[2]).not.toContain("Original message");

// Delay for the duration it takes to get a long reply.
await new Promise(r => setTimeout(r, 1000));

bridgedMessage = bob.waitForEvent('message', 10000);
Expand Down
14 changes: 7 additions & 7 deletions spec/util/e2e-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,14 @@ export class IrcBridgeE2ETest {
}

public async tearDown(): Promise<void> {
await Promise.allSettled([
this.ircBridge?.kill(),
this.ircTest.tearDown(),
this.homeserver?.users.map(c => c.client.stop()),
this.homeserver && destroyHS(this.homeserver.id),
this.dropDatabase(),
]);
// This is specifically ordered this way so that
// it's closed in dependency order.
await this.ircBridge?.kill();
await this.ircTest.tearDown();
await this.homeserver?.users.map(c => c.client.stop());
await (this.homeserver && destroyHS(this.homeserver.id));
await this.pool?.close();
await this.dropDatabase();
if (this.traceLog) {
this.traceLog.close();
}
Expand Down
44 changes: 29 additions & 15 deletions spec/util/homerunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createHash, createHmac } from "crypto";
import { Homerunner } from "homerunner-client";
import { default as crossFetch } from 'cross-fetch';
import { E2ETestMatrixClient } from "./e2e-test";
import { delay } from "../../src/promiseutil";

const HOMERUNNER_IMAGE = process.env.HOMERUNNER_IMAGE || 'complement-synapse';
export const DEFAULT_REGISTRATION_SHARED_SECRET = (
Expand Down Expand Up @@ -69,28 +70,41 @@ export async function createHS(localparts: string[] = [], workerId: number): Pro
SenderLocalpart: AppserviceConfig.senderLocalpart,
RateLimited: false,
};

const blueprintResponse = await homerunner.create({
base_image_uri: HOMERUNNER_IMAGE,
blueprint: {
Name: blueprint,
Homeservers: [{
Name: AppserviceConfig.id,
ApplicationServices: [{
...asRegistration,
URL: `http://host.docker.internal:${AppserviceConfig.port}`,
}],
Users: localparts.map(localpart => ({Localpart: localpart, DisplayName: localpart})),
}],
let blueprintResponse: Awaited<ReturnType<Homerunner.Client["create"]>>|undefined;
let retries = 0;
do {
try {
blueprintResponse = await homerunner.create({
base_image_uri: HOMERUNNER_IMAGE,
blueprint: {
Name: blueprint,
Homeservers: [{
Name: AppserviceConfig.id,
ApplicationServices: [{
...asRegistration,
URL: `http://host.docker.internal:${AppserviceConfig.port}`,
}],
Users: localparts.map(localpart => ({Localpart: localpart, DisplayName: localpart})),
}],
}
});
}
catch (ex) {
console.warn("Failed to create deployment", ex);
retries++;
if (retries >= 5) {
throw ex;
}
await delay(1000);
}
});
} while (!blueprintResponse)
const [homeserverName, homeserver] = Object.entries(blueprintResponse.homeservers)[0];
const users = Object.entries(homeserver.AccessTokens).map(([userId, accessToken]) => ({
userId: userId,
accessToken,
deviceId: homeserver.DeviceIDs[userId],
client: new E2ETestMatrixClient(homeserver.BaseURL, accessToken),
}));
})).filter(u => u.userId !== `@${AppserviceConfig.senderLocalpart}:${homeserverName}`);

// Start syncing proactively.
await Promise.all(users.map(u => u.client.start()));
Expand Down
2 changes: 0 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
"useUnknownInCatchVariables": false,
/* matrix-js-sdk throws up errors */
"skipLibCheck": true,
"module": "Node16",
"moduleResolution": "Node16"
},
"include": [
"src/**/*"
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -991,10 +991,10 @@
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9"
integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==

"@tsconfig/node20@^20.1.2":
version "20.1.2"
resolved "https://registry.yarnpkg.com/@tsconfig/node20/-/node20-20.1.2.tgz#b93128c411d38e9507035255195bc8a6718541e3"
integrity sha512-madaWq2k+LYMEhmcp0fs+OGaLFk0OenpHa4gmI4VEmCKX4PJntQ6fnnGADVFrVkBj0wIdAlQnK/MrlYTHsa1gQ==
"@tsconfig/node20@^20.1.4":
version "20.1.4"
resolved "https://registry.yarnpkg.com/@tsconfig/node20/-/node20-20.1.4.tgz#3457d42eddf12d3bde3976186ab0cd22b85df928"
integrity sha512-sqgsT69YFeLWf5NtJ4Xq/xAF8p4ZQHlmGW74Nu2tD4+g5fAsposc4ZfaaPixVu4y01BEiDCWLRDCvDM5JOsRxg==

"@types/babel__core@^7.1.14", "@types/babel__core@^7.20.5":
version "7.20.5"
Expand Down

0 comments on commit 1411e6d

Please sign in to comment.