Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Keep platform and agent versions out of title triage

pulse-triage[bot]46fadbeb800b
diff --git a/.github/scripts/issue-version-triage.cjs b/.github/scripts/issue-version-triage.cjs
index 472e2cf8ce..3a8e6fa8d7 100644
--- a/.github/scripts/issue-version-triage.cjs
+++ b/.github/scripts/issue-version-triage.cjs
@@ -204,6 +204,26 @@ function normalizeLegacyVersionValue(value) {
? normalizeVersion(visible) : null;
}
+function extractTitlePulseVersion(title) {
+ const text = String(title || "").trim();
+ // A starting version in an upgrade title is not a running declaration.
+ if (/\b(?:upgrad(?:e|ed|ing)|migrat(?:e|ed|ing))\b[^\n]*\bfrom\b/i.test(text)) return null;
+
+ const version = String.raw`v?\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?\b`;
+ // A title can also name the agent, OS or monitored platform. Prefer a
+ // server-qualified value, rather than taking its first arbitrary number.
+ const declared = text.match(new RegExp(
+ String.raw`\bpulse(?:[ \t]+pro)?[ \t]+(?:version[ \t]*[:=]?[ \t]*)?(${version})`, "i"
+ )) || text.match(new RegExp(String.raw`\bpulse(?:-pro)?:(${version})`, "i"));
+ if (declared) return normalizeVersion(declared[1]);
+
+ // Retain legacy version-first titles and the neutral "Bug on v..." form.
+ // Do not search through another product's name to reach its version.
+ const neutral = text.replace(/^\[(?:bug|v6 pre-release)\][ \t]*:?[ \t]*/i, "");
+ const leading = neutral.match(new RegExp(String.raw`^(?:bug[ \t]+on[ \t]+)?(${version})`, "i"));
+ return leading ? normalizeVersion(leading[1]) : null;
+}
+
function extractPulseVersion(title, body) {
if (body) {
const lines = declarationLines(body);
@@ -241,10 +261,7 @@ function extractPulseVersion(title, body) {
}
}
- // A starting version named in an upgrade title is not a running-version
- // declaration. Copied examples may leave no usable body field at all.
- if (/\b(?:upgrad(?:e|ed|ing)|migrat(?:e|ed|ing))\b[^\n]*\bfrom\b/i.test(String(title || ""))) return null;
- return normalizeVersion(title);
+ return extractTitlePulseVersion(title);
}
function classifyV6FeedbackType(body) {
diff --git a/.github/scripts/issue-version-triage.test.cjs b/.github/scripts/issue-version-triage.test.cjs
index 98e7033ab9..f706b7e679 100644
--- a/.github/scripts/issue-version-triage.test.cjs
+++ b/.github/scripts/issue-version-triage.test.cjs
@@ -2057,3 +2057,59 @@ test("the label consumer accepts a linked version without fetching links or cont
assert.equal(calls.getIssue.length, 2);
}
});
+
+
+test("title fallback cannot borrow a platform or agent release as the Pulse server version", () => {
+ const { extractPulseVersion } = triage.internals;
+ for (const title of [
+ "[Bug]: vSphere 8.0.3 enrichment fails",
+ "[Bug]: TrueNAS SCALE 25.10.3 reconnects",
+ "[Bug]: Debian 13.0.0 install failure",
+ "[Bug]: pulse-agent 6.5.0 loses disk data",
+ "[v6 pre-release]: Pulse agent v6.6.0-rc.6 loses disk data",
+ "Pulse unknown; agent 6.5.0 remains connected",
+ ]) {
+ assert.equal(extractPulseVersion(title, "Legacy report without a declared server version."), null, title);
+ }
+});
+
+test("title fallback retains explicit Pulse and neutral version-leading declarations", () => {
+ const { extractPulseVersion } = triage.internals;
+ for (const [title, expected] of [
+ ["[Bug]: Pulse 6.5.0 loses readings", "6.5.0"],
+ ["vSphere 8.0.3 enrichment fails in Pulse v6.5.0", "6.5.0"],
+ ["[Bug]: TrueNAS 25.10.3 in Pulse Pro version: V6.6.0-rc.6", "6.6.0-rc.6"],
+ ["[Bug]: rcourtman/pulse:6.5.0 loses readings", "6.5.0"],
+ ["[Bug]: license.pulserelay.pro/pulse-pro:6.6.0-rc.6 loses readings", "6.6.0-rc.6"],
+ ["v6.4.3-rc.1 (LXC): Pulse degrades", "6.4.3-rc.1"],
+ ["[Bug]: v6.6.0-rc.6 loses readings", "6.6.0-rc.6"],
+ ["Bug on v6.5.0", "6.5.0"],
+ ]) {
+ assert.equal(extractPulseVersion(title, "Legacy report."), expected, title);
+ assert.equal(extractPulseVersion(title, "### Pulse version\nunknown"), null, title);
+ assert.equal(extractPulseVersion(title, "### Pulse version\n6.4.5"), "6.4.5", title);
+ }
+ assert.equal(extractPulseVersion("Upgrade from Pulse 6.4.5 to Pulse 6.5.0", "Legacy report."), null);
+});
+
+test("title-version label consumer corrects only its own metadata without contact or release inference", async () => {
+ for (const [title, body, version] of [
+ ["[Bug]: vSphere 8.0.3 enrichment fails", "Legacy report.", null],
+ ["vSphere 8.0.3 enrichment fails in Pulse 6.5.0", "Legacy report.", "6.5.0"],
+ ["[Bug]: TrueNAS SCALE 25.10.3 reconnects", "### Pulse version\n6.5.0", "6.5.0"],
+ ]) {
+ const { github, calls } = createGithub();
+ const issue = { number: 2925, title, body,
+ labels: ["bug", "affects-8.0.3", "needs-human", "release-blocker", "needs-decomposition",
+ "needs-retest-on-latest", "operator-reviewed"].map(name => ({ name })) };
+ await syncLabels({ github, context: createContext({ issue }), core: createCore() });
+ const expectedLabel = version ? `affects-${version}` : "needs-version-info";
+ assert.deepEqual(calls.addLabels.map(call => call.labels), [[expectedLabel]]);
+ assert.deepEqual(calls.removeLabel.map(call => call.name), ["affects-8.0.3"]);
+ assert.deepEqual(calls.createLabel.map(call => call.name), [expectedLabel]);
+ assert.deepEqual(calls.createComment, []);
+ assert.deepEqual(calls.getLatestRelease, []);
+ assert.deepEqual(calls.paginate, []);
+ assert.equal(calls.getIssue.length, 2);
+ }
+});