Harden upload finalization and release verification
CI / verify (push) Failing after 21m12s

Preserve uncertain remote commits and destructive source-cleanup requirements across cancellation, persistence failures, retries, and restart recovery. Revalidate account availability after admission waits and prevent late upload results from bypassing cancellation state. Strengthen release argument, CI tag, source allowlist, and secret scanning gates. Run the Electron smoke suite in a fully hidden offscreen harness that cannot reveal, focus, or elevate native windows.
This commit is contained in:
Sucukdeluxe
2026-08-15 04:06:53 +02:00
parent 692d994037
commit b286574902
20 changed files with 1739 additions and 170 deletions
+79
View File
@@ -0,0 +1,79 @@
const test = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const { installHiddenElectronWindowHarness } = require('./support/hidden-electron-window');
test('every Electron UI smoke window stays offscreen without native reveal or focus paths', () => {
const nativeCalls = [];
class TestBrowserWindow {
constructor(options) {
this.options = options;
}
show() { nativeCalls.push('show'); }
showInactive() { nativeCalls.push('showInactive'); }
focus() { nativeCalls.push('focus'); }
restore() { nativeCalls.push('restore'); }
moveTop() { nativeCalls.push('moveTop'); }
setAlwaysOnTop(value) { nativeCalls.push(`setAlwaysOnTop:${value}`); }
setIgnoreMouseEvents(value) { this.ignoresMouse = value; }
isVisible() { return false; }
isFocused() { return false; }
}
const targetGlobal = {};
const harness = installHiddenElectronWindowHarness({
BrowserWindow: TestBrowserWindow,
targetGlobal
});
const windows = [
new targetGlobal.__mhuBrowserWindowConstructor({
show: true,
focusable: true,
skipTaskbar: false,
alwaysOnTop: true,
webPreferences: { contextIsolation: true }
}),
new targetGlobal.__mhuBrowserWindowConstructor({ alwaysOnTop: true }),
new targetGlobal.__mhuBrowserWindowConstructor({ show: true })
];
windows[0].show();
windows[1].showInactive();
windows[2].focus();
windows[0].restore();
windows[1].moveTop();
windows[2].setAlwaysOnTop(true);
assert.deepEqual(windows[0].options, {
show: false,
focusable: false,
skipTaskbar: true,
alwaysOnTop: false,
paintWhenInitiallyHidden: true,
webPreferences: {
contextIsolation: true,
offscreen: true,
backgroundThrottling: false
}
});
assert.equal(windows.every(window => window.options.show === false && window.options.alwaysOnTop === false && window.ignoresMouse === true), true);
assert.deepEqual(nativeCalls, []);
assert.equal(harness.isAlwaysOnTopRequested(windows[2]), true);
assert.equal(harness.isNativeSurfaceSuppressed({ isVisible: () => false, isFocused: () => false }), true);
assert.equal(harness.areNativeSurfacesSuppressed(windows), true);
assert.deepEqual(harness.getWindows(), windows);
});
test('Main routes every BrowserWindow construction through the hidden test constructor', () => {
const source = fs.readFileSync(path.join(__dirname, '..', 'main.js'), 'utf8');
assert.doesNotMatch(source, /new BrowserWindow\s*\(/u);
assert.equal((source.match(/RuntimeBrowserWindow/g) || []).length >= 4, true);
});
test('UI smoke never constructs an original BrowserWindow', () => {
const source = fs.readFileSync(path.join(__dirname, 'ui-smoke.js'), 'utf8');
assert.doesNotMatch(source, /new BrowserWindow\s*\(/u);
assert.doesNotMatch(source, /BrowserWindow\.getAllWindows\(\)/u);
assert.equal((source.match(/areNativeSurfacesSuppressed/g) || []).length >= 2, true);
});