feat(pipeline): report deployed tool versions from the tools themselves

"What is running where" was answerable only by asking someone. Each tool
now reports its own version on startup into a ToolVersion registry, shown
on Pipeline → Machines.

The worker's version moves out of config.json and into the assembly:
a hand-maintained string on each machine is exactly the thing that goes
stale, and a machine reporting a version it is not running is worse than
no version at all. publish.ps1 stamps the git SHA via SourceRevisionId,
so a deployed exe traces back to a commit (1.1.0+feb1c7b).

The panel gains PANEL_VERSION, shown in its title and every diagnostics
report, and pings on load.

Staleness is derived rather than declared: the newest version seen for a
tool is the benchmark, so updating one machine is what flags the rest.
There is no expected-version list to keep in sync — which would have been
one more thing to forget.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
twotalesanimation
2026-08-13 15:13:44 +02:00
parent feb1c7b3e9
commit a4f8226f3f
15 changed files with 416 additions and 4 deletions
+51 -1
View File
@@ -18,6 +18,11 @@ var CONFIG = {
var SETTINGS_GROUP = "VFXReviewConnector";
var SETTINGS_KEY = "cfg";
// Bump on every change deployed to a workstation. The panel reports this to
// the server on load, so Pipeline → Machines shows which version each machine
// is actually running and flags the ones left behind.
var PANEL_VERSION = "2.1.0";
(function VFXReviewConnector(thisObj) {
var uiState = {
projectDropdown: null,
@@ -103,6 +108,48 @@ var SETTINGS_KEY = "cfg";
return Folder.userData.fsName + "/VFXReviewConnector/connector.log";
}
// ExtendScript exposes no hostname directly; $.getenv reaches the shell's.
function getHostName() {
var name = "";
try {
name = $.getenv("COMPUTERNAME") || $.getenv("HOSTNAME") || "";
} catch (envError) {
name = "";
}
return trimText(name) || "unknown-machine";
}
/**
* Reports this panel's version to the server so Pipeline → Machines shows
* what is deployed where. Fire-and-forget: a failure here must never stop
* the panel loading, so it is logged and dropped.
*/
function reportPanelVersion() {
var response;
if (!trimText(CONFIG.baseUrl) || !trimText(CONFIG.token)) {
return;
}
try {
response = postJSON(CONFIG.baseUrl + "/api/ext/tools/ping", {
tool: "AE_PANEL",
machineName: getHostName(),
version: PANEL_VERSION,
hostUser: CONFIG.artistEmail || "",
hostApp: "After Effects " + app.version,
details: {
os: String($.os).substring(0, 120),
project: CONFIG.lastProjectCode || ""
}
});
diagLog("version ping: HTTP " + response.status);
} catch (pingError) {
diagLog("version ping failed: " + describeError(pingError));
}
}
function padTwo(value) {
return ("0" + value).slice(-2);
}
@@ -181,6 +228,7 @@ var SETTINGS_KEY = "cfg";
DIAG.lastFailure = null;
diagWriteToFile("");
diagLog("=== " + action + " ===");
diagLog("panel v" + PANEL_VERSION + " | " + getHostName());
diagLog("AE " + app.version + " | " + $.os + " | project " +
(app.project && app.project.file ? app.project.file.fsName : "(unsaved)"));
diagLog("config: " + describeConfig());
@@ -4052,7 +4100,7 @@ var SETTINGS_KEY = "cfg";
}
}
title = scrollContent.add("statictext", undefined, "VFXReview Connector");
title = scrollContent.add("statictext", undefined, "VFXReview Connector v" + PANEL_VERSION);
title.alignment = ["fill", "top"];
shotBuilderPanel = scrollContent.add("panel", undefined, "Shot Builder");
@@ -4359,6 +4407,8 @@ var SETTINGS_KEY = "cfg";
var panel = buildUI(thisObj);
refreshSelection();
populateProjectDropdown();
diagLog("panel v" + PANEL_VERSION + " loaded on " + getHostName());
reportPanelVersion();
if (panel instanceof Window) {
panel.center();