fix: stabilize matrix and teams ci assertions

This commit is contained in:
Peter Steinberger
2026-03-24 05:28:08 +00:00
parent 0b54b64fe7
commit 0f84aac487
6 changed files with 23 additions and 6 deletions

View File

@@ -57,7 +57,7 @@ const meta = {
selectionLabel: "Microsoft Teams (Bot Framework)",
docsPath: "/channels/msteams",
docsLabel: "msteams",
blurb: "Bot Framework; enterprise support.",
blurb: "Teams SDK; enterprise support.",
aliases: ["teams"],
order: 60,
} as const;

View File

@@ -130,7 +130,7 @@ const createMSTeamsPlugin = (params: { outbound: ChannelOutboundAdapter }): Chan
label: "Microsoft Teams",
selectionLabel: "Microsoft Teams (Bot Framework)",
docsPath: "/channels/msteams",
blurb: "Bot Framework; enterprise support.",
blurb: "Teams SDK; enterprise support.",
},
capabilities: { chatTypes: ["direct"] },
config: {

View File

@@ -118,7 +118,7 @@ describe("config doc baseline integration", () => {
});
expect(byPath.get("channels.msteams")).toMatchObject({
label: "Microsoft Teams",
help: "Bot Framework; enterprise support.",
help: "Teams SDK; enterprise support.",
});
expect(byPath.get("channels.matrix")).toMatchObject({
label: "Matrix",

View File

@@ -48,7 +48,7 @@ const createMSTeamsPlugin = (params?: { aliases?: string[] }): ChannelPlugin =>
label: "Microsoft Teams",
selectionLabel: "Microsoft Teams (Bot Framework)",
docsPath: "/channels/msteams",
blurb: "Bot Framework; enterprise support.",
blurb: "Teams SDK; enterprise support.",
aliases: params?.aliases,
},
capabilities: { chatTypes: ["direct"] },

View File

@@ -37,15 +37,32 @@ export async function writeTextAtomic(
mkdirOptions.mode = options.ensureDirMode;
}
await fs.mkdir(path.dirname(filePath), mkdirOptions);
const parentDir = path.dirname(filePath);
const tmp = `${filePath}.${randomUUID()}.tmp`;
try {
await fs.writeFile(tmp, payload, { encoding: "utf8", mode });
const tmpHandle = await fs.open(tmp, "w", mode);
try {
await tmpHandle.writeFile(payload, { encoding: "utf8" });
await tmpHandle.sync();
} finally {
await tmpHandle.close().catch(() => undefined);
}
try {
await fs.chmod(tmp, mode);
} catch {
// best-effort; ignore on platforms without chmod
}
await fs.rename(tmp, filePath);
try {
const dirHandle = await fs.open(parentDir, "r");
try {
await dirHandle.sync();
} finally {
await dirHandle.close().catch(() => undefined);
}
} catch {
// best-effort; some platforms/filesystems do not support syncing directories.
}
try {
await fs.chmod(filePath, mode);
} catch {

View File

@@ -77,7 +77,7 @@ export const createMSTeamsTestPluginBase = (): Pick<
meta: {
...base.meta,
selectionLabel: "Microsoft Teams (Bot Framework)",
blurb: "Bot Framework; enterprise support.",
blurb: "Teams SDK; enterprise support.",
aliases: ["teams"],
},
};