Skip to content
Merged
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
15 changes: 10 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- "v*"

env:
TAG: ${{ github.ref_name }}

permissions:
contents: write
id-token: write
Expand All @@ -21,7 +24,7 @@ jobs:
- name: Verify tag matches package version
run: |
VERSION="$(node -p 'require("./package.json").version')"
test "$GITHUB_REF_NAME" = "v$VERSION"
test "$TAG" = "v$VERSION"

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
Expand Down Expand Up @@ -50,6 +53,12 @@ jobs:
# Without GH_TOKEN: bun install runs the omp packages' scripts.
- name: Pin the runner to it
run: npx bun runner/scripts/use-omp-build.ts "$OMP_TAG" && (cd runner && npx bun x tsc -p .)
# Match Verify PR: allow isolated fixtures, never control of the runner's service.
- name: Allow isolated native fixture scopes
run: |
rule="polkit.addRule(function(action, subject) { if (action.id === 'org.freedesktop.systemd1.manage-units' && subject.user === '$(id -un)' && /\\.scope$/.test(action.lookup('unit') || '')) { return polkit.Result.YES; } });"
printf '%s\n' "$rule" | sudo tee /etc/polkit-1/rules.d/49-ompweb-fixture-scopes.rules >/dev/null
systemd-run --scope --quiet --collect --no-ask-password true
- run: npm test
- run: npm run build
# Builds the omp runners too, which the source smoke spawns from runner/release/. The archives leave them out:
Expand All @@ -63,7 +72,6 @@ jobs:
- name: Create draft GitHub Release
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
run: |
if ! gh release view "$TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
node bin/generate-release-notes.js --tag "$TAG" --output release-notes.md
Expand All @@ -76,7 +84,6 @@ jobs:
- name: Attach the binaries and the omp runners to the draft release
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
run: |
set -euo pipefail
runners=(ompweb-omp-linux-x64 ompweb-omp-linux-arm64 ompweb-omp-darwin-x64 ompweb-omp-darwin-arm64 ompweb-omp-windows-x64.exe)
Expand All @@ -87,7 +94,6 @@ jobs:
- name: Publish GitHub Release
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
run: gh release edit "$TAG" --repo "$GITHUB_REPOSITORY" --draft=false

- name: Publish to npm
Expand All @@ -108,7 +114,6 @@ jobs:
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_RELEASES_WEBHOOK }}
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
run: |
DISCORD_WEBHOOK_URL="$(printf '%s' "$DISCORD_WEBHOOK_URL" | tr -d '\r\n')"
case "$DISCORD_WEBHOOK_URL" in
Expand Down
2 changes: 1 addition & 1 deletion graphify-out/graph.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/hosts/maintenance-transport.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ test("a revoked host's daemon keeps retrying and is not let back in", async (t)
test("freezing the server closes links and refuses dials until it restarts, without ending the daemon", async (t) => {
t.after(() => { globalThis.__ompMaintenanceHub = undefined; });
const { id, states } = linkedHost(t);
await until(() => hub.getMaintenanceHost(id), "the link");
await until(() => hub.getMaintenanceHost(id) && states.at(-1) === true, "the welcomed link");
hub.freezeMaintenance();
await until(() => states.join() === "true,false", "the close");
const upgrades = seen.upgrades;
Expand All @@ -271,6 +271,6 @@ test("freezing the server closes links and refuses dials until it restarts, with
assert.equal(hub.getMaintenanceHost(id), null);
// The next server process starts with fresh state.
globalThis.__ompMaintenanceHub = undefined;
await until(() => hub.getMaintenanceHost(id), "the link on the restarted server");
await until(() => hub.getMaintenanceHost(id) && states.at(-1) === true, "the welcomed link on the restarted server");
assert.deepEqual(states, [true, false, true]);
});
3 changes: 2 additions & 1 deletion lib/omp/archive.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ for (const crash of [false, true]) {
mock.module("fs", () => ({ ...real, renameSync(from, to) {
const result = real.renameSync(from, to);
if (to.endsWith(".restore-consume")) {
real.writeFileSync(READY, to);
real.writeFileSync(READY + ".tmp", to);
real.renameSync(READY + ".tmp", READY);
const deadline = Date.now() + 20000;
while (!real.existsSync(PROCEED)) {
if (Date.now() > deadline) throw new Error("capture barrier timeout");
Expand Down
Loading