Protect task diagnostics and stream incremental run output
Build custom container images / build (map[base_image:php:8-fpm-alpine build_args:PHP_VERSION=8
context:php8-pgsql fingerprint_command:{ apk info -v | LC_ALL=C sort; find /usr/local/lib/php/extensions /usr/local/etc/php/conf.d -type f -exec sha256sum {} + | LC_ALL=C sort; }
name:ph… (push) Successful in 38s
Build custom container images / build (map[base_image:postgres:18 build_args:PG_VERSION=18
POSTGIS_VERSION=3
VCHORD_VERSION=0.5.3
context:postgres fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; find /usr/lib/postgresql -type f -exec sha256su… (push) Successful in 47s
Build custom container images / build (map[base_image:python:3 build_args:PYTHON_VERSION=3
context:python-tools fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; pip freeze | LC_ALL=C sort; }
name:python-tools oci_labels:org.opencontainers.ima… (push) Successful in 1m24s
Build custom container images / build (map[base_image:python:3.12-slim build_args:PYTHON_VERSION=3.12-slim
context:linkki-tiedotus fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; pip freeze | LC_ALL=C sort; }
name:linkki-tiedotus oci_labels:… (push) Successful in 38s
Build custom container images / build (map[base_image:python:3.12-slim build_args:PYTHON_VERSION=3.12-slim
context:timepoll fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; pip freeze | LC_ALL=C sort; }
name:timepoll oci_labels:org.opencontai… (push) Successful in 43s
Build custom container images / build (map[base_image:php:8-fpm-alpine build_args:PHP_VERSION=8
context:php8-pgsql fingerprint_command:{ apk info -v | LC_ALL=C sort; find /usr/local/lib/php/extensions /usr/local/etc/php/conf.d -type f -exec sha256sum {} + | LC_ALL=C sort; }
name:ph… (push) Successful in 38s
Build custom container images / build (map[base_image:postgres:18 build_args:PG_VERSION=18
POSTGIS_VERSION=3
VCHORD_VERSION=0.5.3
context:postgres fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; find /usr/lib/postgresql -type f -exec sha256su… (push) Successful in 47s
Build custom container images / build (map[base_image:python:3 build_args:PYTHON_VERSION=3
context:python-tools fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; pip freeze | LC_ALL=C sort; }
name:python-tools oci_labels:org.opencontainers.ima… (push) Successful in 1m24s
Build custom container images / build (map[base_image:python:3.12-slim build_args:PYTHON_VERSION=3.12-slim
context:linkki-tiedotus fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; pip freeze | LC_ALL=C sort; }
name:linkki-tiedotus oci_labels:… (push) Successful in 38s
Build custom container images / build (map[base_image:python:3.12-slim build_args:PYTHON_VERSION=3.12-slim
context:timepoll fingerprint_command:{ dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort; pip freeze | LC_ALL=C sort; }
name:timepoll oci_labels:org.opencontai… (push) Successful in 43s
This commit is contained in:
1 parent
0aa67439fd
commit
55bbbe2fd7
8 files changed
+319
-51
No files matched your search
+37
-18
@@ -1,25 +1,33 @@
|
||||
const output = document.querySelector("#run-output");
|
||||
|
||||
if (output) {
|
||||
let refreshTimer;
|
||||
let offset = Number(output.dataset.outputOffset || 0);
|
||||
let detailsFinalized = !["queued", "running"].includes(
|
||||
document.querySelector("#run-status")?.textContent.trim(),
|
||||
);
|
||||
const refresh = async () => {
|
||||
const response = await fetch(output.dataset.outputUrl, { cache: "no-store" });
|
||||
if (response.ok) {
|
||||
const nextOutput = (await response.json()).output;
|
||||
if (nextOutput !== output.textContent) {
|
||||
output.textContent = nextOutput;
|
||||
let delay = 2000;
|
||||
try {
|
||||
const url = new URL(output.dataset.outputUrl, window.location.href);
|
||||
url.searchParams.set("offset", String(offset));
|
||||
const response = await fetch(url, { cache: "no-store" });
|
||||
if (!response.ok) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
const status = document.querySelector("#run-status");
|
||||
if (status) {
|
||||
const stateResponse = await fetch(status.dataset.stateUrl, { cache: "no-store" });
|
||||
if (stateResponse.ok) {
|
||||
const state = await stateResponse.json();
|
||||
const state = await response.json();
|
||||
if (state.reset) {
|
||||
output.replaceChildren();
|
||||
}
|
||||
if (state.output) {
|
||||
output.append(document.createTextNode(state.output));
|
||||
}
|
||||
offset = state.offset;
|
||||
const status = document.querySelector("#run-status");
|
||||
if (status) {
|
||||
status.textContent = state.status;
|
||||
if (state.status !== "queued" && state.status !== "running") {
|
||||
if (state.has_more) {
|
||||
delay = 0;
|
||||
} else if (state.status !== "queued" && state.status !== "running") {
|
||||
if (!detailsFinalized) {
|
||||
const pageResponse = await fetch(window.location.href, { cache: "no-store" });
|
||||
if (!pageResponse.ok) {
|
||||
@@ -36,13 +44,22 @@ if (output) {
|
||||
nextDetails.after(...page.querySelectorAll(actions));
|
||||
detailsFinalized = true;
|
||||
}
|
||||
window.clearInterval(refreshTimer);
|
||||
const artifacts = document.querySelector("#run-artifacts");
|
||||
if (artifacts) {
|
||||
await refreshArtifacts(artifacts);
|
||||
}
|
||||
delay = null;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn("Could not refresh run details:", error);
|
||||
} finally {
|
||||
if (delay !== null) {
|
||||
window.setTimeout(refresh, delay);
|
||||
}
|
||||
}
|
||||
};
|
||||
refresh();
|
||||
refreshTimer = window.setInterval(refresh, 2000);
|
||||
}
|
||||
|
||||
const refreshArtifacts = async (container) => {
|
||||
@@ -73,8 +90,9 @@ const refreshArtifacts = async (container) => {
|
||||
};
|
||||
|
||||
for (const container of document.querySelectorAll("#run-artifacts")) {
|
||||
refreshArtifacts(container);
|
||||
window.setInterval(() => refreshArtifacts(container), 2000);
|
||||
if (!output) {
|
||||
refreshArtifacts(container);
|
||||
}
|
||||
}
|
||||
|
||||
for (const choice of document.querySelectorAll("button[data-execution-choice]")) {
|
||||
@@ -154,6 +172,7 @@ for (const form of document.querySelectorAll("form[data-wait-for-result]")) {
|
||||
};
|
||||
|
||||
const waitForRun = async (run) => {
|
||||
const started = Date.now();
|
||||
while (true) {
|
||||
const response = await fetch(run.state_url, { cache: "no-store" });
|
||||
if (!response.ok) {
|
||||
@@ -171,7 +190,7 @@ for (const form of document.querySelectorAll("form[data-wait-for-result]")) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
await new Promise((resolve) => window.setTimeout(resolve, 500));
|
||||
await new Promise((resolve) => window.setTimeout(resolve, Date.now() - started < 10000 ? 500 : 2000));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user