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.

Repair combined validation while preserving sparse disk History

pulse-triage[bot]3d45bc5750e9
diff --git a/docs/release-control/v6/internal/subsystems/monitoring.md b/docs/release-control/v6/internal/subsystems/monitoring.md
index 99d5d56fee..f1523e8686 100644
--- a/docs/release-control/v6/internal/subsystems/monitoring.md
+++ b/docs/release-control/v6/internal/subsystems/monitoring.md
@@ -5787,3 +5787,20 @@ saved-identity/manual-token contract. `pve_backup_warning_test.go` exercises
as well as unknown evidence and hostile endpoint text. The HTTP status helper
has wrapped-error/body-injection controls in `api_error_status_test.go`. These
are local source controls, not a native permission diagnosis or availability.
+
+### Physical-disk chart metadata without invented History
+
+`GetPhysicalDiskTemperatureCharts` preserves a currently collected physical
+disk's identity, display name, node and instance even when its stored
+temperature series is empty. A retained-only disk with no observed samples
+does not introduce an empty chart entry. Neither current nor retained readings
+create historical timestamps, duplicate a single stored point or pad a flat
+series: stored sample values and times remain unchanged. This composes current
+disk metadata with the sparse-history and retained-observation boundaries;
+collection policy and native health claims are unchanged.
+
+`TestDiskTemperatureChartsRetainOnlyObservedSamples` in
+`internal/monitoring/monitor_metrics_slo_test.go` binds live-without-history
+metadata, retained-without-history exclusion and original single-point
+observations to the production chart path. These source controls do not
+establish native temperature collection or installed History acceptance.
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index bc9fc7867e..a8674e15ed 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -532,7 +532,8 @@ function usesSharedChangePresentation(consumer: string, adapter: string): boolea
!ts.isStringLiteral(node.moduleSpecifier) ||
node.moduleSpecifier.text !== '@/utils/resourceChangePresentation' ||
node.importClause?.isTypeOnly
- ) continue;
+ )
+ continue;
const imports = node.importClause?.namedBindings;
if (!imports || !ts.isNamedImports(imports)) continue;
for (const item of imports.elements) {
@@ -549,9 +550,13 @@ function usesSharedChangePresentation(consumer: string, adapter: string): boolea
bindings.has(node.expression.text) &&
node.arguments.length > 0 &&
// The metadata-aware adapter needs the change, not just its kind.
- !(metadataAware && ts.isPropertyAccessExpression(node.arguments[0]) &&
- node.arguments[0].name.text === 'kind')
- ) called = true;
+ !(
+ metadataAware &&
+ ts.isPropertyAccessExpression(node.arguments[0]) &&
+ node.arguments[0].name.text === 'kind'
+ )
+ )
+ called = true;
ts.forEachChild(node, visit);
};
visit(tree);
@@ -2185,10 +2190,17 @@ describe('frontend resource type boundaries', () => {
expect(resourceDetailDrawerSource).toContain('RESOURCE_CHANGE_KIND_ORDER');
expect(resourceDetailDrawerSource).toContain('RESOURCE_CHANGE_SOURCE_TYPE_ORDER');
expect(resourceDetailDrawerSource).toContain('RESOURCE_CHANGE_SOURCE_ADAPTER_ORDER');
- expect(usesSharedChangePresentation(resourceDetailDrawerOverviewSource, resourceChangePresentationSource)).toBe(true);
+ expect(
+ usesSharedChangePresentation(
+ resourceDetailDrawerOverviewSource,
+ resourceChangePresentationSource,
+ ),
+ ).toBe(true);
expect(resourceDetailDrawerSource).toContain('getResourceChangeSourceTypePresentation');
expect(resourceDetailDrawerSource).toContain('getResourceChangeSourceAdapterPresentation');
- expect(usesSharedChangePresentation(resourceChangeSummarySource, resourceChangePresentationSource)).toBe(true);
+ expect(
+ usesSharedChangePresentation(resourceChangeSummarySource, resourceChangePresentationSource),
+ ).toBe(true);
expect(resourceChangeSummarySource).toContain('getResourceChangeSourceTypePresentation');
expect(resourceChangeSummarySource).toContain('getResourceChangeSourceAdapterPresentation');
expect(resourceDetailDrawerSource).not.toContain('healthToneClass(');
@@ -4354,7 +4366,6 @@ describe('frontend resource type boundaries', () => {
});
});
-
describe('shared resource change presentation boundary controls', () => {
const kindAdapter = 'export function getResourceChangeKindPresentation(kind) {}';
const metadataAdapter = `${kindAdapter}\nexport function getResourceChangePresentation(change) {}`;
@@ -4362,25 +4373,80 @@ describe('shared resource change presentation boundary controls', () => {
`import { ${name} } from '@/utils/resourceChangePresentation'; ${name}(${argument});`;
it('accepts the kind adapter before the metadata-aware API exists', () => {
- expect(usesSharedChangePresentation(consumer('getResourceChangeKindPresentation', 'change.kind'), kindAdapter)).toBe(true);
+ expect(
+ usesSharedChangePresentation(
+ consumer('getResourceChangeKindPresentation', 'change.kind'),
+ kindAdapter,
+ ),
+ ).toBe(true);
});
it('requires the whole-change adapter once available, even if the old helper still exists', () => {
- expect(usesSharedChangePresentation(consumer('getResourceChangePresentation'), metadataAdapter)).toBe(true);
- expect(usesSharedChangePresentation(consumer('getResourceChangeKindPresentation', 'change.kind'), metadataAdapter)).toBe(false);
- expect(usesSharedChangePresentation(consumer('getResourceChangePresentation', 'change.kind'), metadataAdapter)).toBe(false);
+ expect(
+ usesSharedChangePresentation(consumer('getResourceChangePresentation'), metadataAdapter),
+ ).toBe(true);
+ expect(
+ usesSharedChangePresentation(
+ consumer('getResourceChangeKindPresentation', 'change.kind'),
+ metadataAdapter,
+ ),
+ ).toBe(false);
+ expect(
+ usesSharedChangePresentation(
+ consumer('getResourceChangePresentation', 'change.kind'),
+ metadataAdapter,
+ ),
+ ).toBe(false);
});
it('resolves named import aliases without accepting an inline lookalike', () => {
- expect(usesSharedChangePresentation("import { getResourceChangePresentation as present } from '@/utils/resourceChangePresentation'; present(change);", metadataAdapter)).toBe(true);
- expect(usesSharedChangePresentation('function getResourceChangePresentation(change) {} getResourceChangePresentation(change);', metadataAdapter)).toBe(false);
- expect(usesSharedChangePresentation(consumer('getResourceChangePresentation').replace("@/utils/resourceChangePresentation", '@/utils/localCopy'), metadataAdapter)).toBe(false);
+ expect(
+ usesSharedChangePresentation(
+ "import { getResourceChangePresentation as present } from '@/utils/resourceChangePresentation'; present(change);",
+ metadataAdapter,
+ ),
+ ).toBe(true);
+ expect(
+ usesSharedChangePresentation(
+ 'function getResourceChangePresentation(change) {} getResourceChangePresentation(change);',
+ metadataAdapter,
+ ),
+ ).toBe(false);
+ expect(
+ usesSharedChangePresentation(
+ consumer('getResourceChangePresentation').replace(
+ '@/utils/resourceChangePresentation',
+ '@/utils/localCopy',
+ ),
+ metadataAdapter,
+ ),
+ ).toBe(false);
});
it('rejects comment-only, unused and type-only imports', () => {
- expect(usesSharedChangePresentation('// ' + consumer('getResourceChangePresentation'), metadataAdapter)).toBe(false);
- expect(usesSharedChangePresentation("import { getResourceChangePresentation } from '@/utils/resourceChangePresentation';", metadataAdapter)).toBe(false);
- expect(usesSharedChangePresentation(consumer('getResourceChangePresentation').replace('import {', 'import type {'), metadataAdapter)).toBe(false);
- expect(usesSharedChangePresentation(consumer('getResourceChangePresentation').replace('{ getResource', '{ type getResource'), metadataAdapter)).toBe(false);
+ expect(
+ usesSharedChangePresentation(
+ '// ' + consumer('getResourceChangePresentation'),
+ metadataAdapter,
+ ),
+ ).toBe(false);
+ expect(
+ usesSharedChangePresentation(
+ "import { getResourceChangePresentation } from '@/utils/resourceChangePresentation';",
+ metadataAdapter,
+ ),
+ ).toBe(false);
+ expect(
+ usesSharedChangePresentation(
+ consumer('getResourceChangePresentation').replace('import {', 'import type {'),
+ metadataAdapter,
+ ),
+ ).toBe(false);
+ expect(
+ usesSharedChangePresentation(
+ consumer('getResourceChangePresentation').replace('{ getResource', '{ type getResource'),
+ metadataAdapter,
+ ),
+ ).toBe(false);
});
});
diff --git a/frontend-modern/src/utils/__tests__/pbsProtectionHelp.test.ts b/frontend-modern/src/utils/__tests__/pbsProtectionHelp.test.ts
index 51cedf74f6..b51ac25a9f 100644
--- a/frontend-modern/src/utils/__tests__/pbsProtectionHelp.test.ts
+++ b/frontend-modern/src/utils/__tests__/pbsProtectionHelp.test.ts
@@ -7,7 +7,8 @@ import { renderDocMarkdown } from '@/features/docs/docMarkdown';
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../..');
const read = (file: string) => readFileSync(path.join(root, file), 'utf8');
const guide = read('docs/PBS.md');
-const section = guide.split('### Backups are visible but Coverage says Unprotected')[1]?.split('\n### ')[0] ?? '';
+const section =
+ guide.split('### Backups are visible but Coverage says Unprotected')[1]?.split('\n### ')[0] ?? '';
const render = (markdown: string, name: string) => {
const article = document.createElement('article');
article.innerHTML = renderDocMarkdown(markdown, name);
@@ -19,7 +20,9 @@ const text = () => article().textContent?.replace(/\s+/g, ' ');
describe('PBS protection disagreement help', () => {
it('ships the section and distinguishes matching, verification and assessment from recovery proof', () => {
expect(read('frontend-modern/public/docs/PBS.md')).toBe(guide);
- expect(render(guide, 'PBS').querySelector('#backups-are-visible-but-coverage-says-unprotected')).not.toBeNull();
+ expect(
+ render(guide, 'PBS').querySelector('#backups-are-visible-but-coverage-says-unprotected'),
+ ).not.toBeNull();
const rows = [...article().querySelectorAll('tbody tr')].map((row) => row.textContent);
expect(rows).toHaveLength(3);
expect(rows[0]).toContain('subject-linked backup evidence');
@@ -32,13 +35,17 @@ describe('PBS protection disagreement help', () => {
});
it('uses existing Coverage evidence and source identity without an induced request', () => {
- const steps = [...article().querySelectorAll('ol > li')].map((step) => step.textContent?.replace(/\s+/g, ' '));
+ const steps = [...article().querySelectorAll('ol > li')].map((step) =>
+ step.textContent?.replace(/\s+/g, ' '),
+ );
expect(steps).toHaveLength(3);
expect(steps[0]).toContain('Proxmox → Backups → Coverage');
expect(steps[0]).toContain('Job, History and Access');
expect(steps[0]).toContain('provider evidence is absent');
expect(steps[0]).toContain('not the PBS host');
- expect(steps[1]).toContain('server, datastore, namespace (including root), guest type/ID and backup time');
+ expect(steps[1]).toContain(
+ 'server, datastore, namespace (including root), guest type/ID and backup time',
+ );
expect(steps[1]).toContain('confirm the owning installation');
expect(steps[1]).toContain('guest snapshot is not a PBS backup');
expect(steps[2]).toContain('protection explanation');
@@ -50,7 +57,9 @@ describe('PBS protection disagreement help', () => {
});
it('prevents destructive diagnostics and an assumed freshness-policy cause', () => {
- expect(text()).toContain('Do not delete backups, clear History, change retention or freshness settings');
+ expect(text()).toContain(
+ 'Do not delete backups, clear History, change retention or freshness settings',
+ );
expect(text()).toContain('recreate tokens/connections, restart or downgrade Pulse');
expect(text()).toContain('run a new backup, verification or restore just to clear the strip');
expect(text()).toContain('not a destructive diagnostic or an assumed freshness-policy cause');
@@ -60,18 +69,30 @@ describe('PBS protection disagreement help', () => {
it('links the frozen-guest boundary and preserves every restoration prerequisite', () => {
const link = article().querySelector('a[href="/docs/VM_DISK_MONITORING#backup-safety"]');
expect(link?.textContent).toBe('Backup safety');
- expect(render(read('docs/VM_DISK_MONITORING.md'), 'VM_DISK_MONITORING').querySelector('#backup-safety')).not.toBeNull();
- expect(text()).toContain('An OK backup task or a Verified label does not prove the guest thawed');
+ expect(
+ render(read('docs/VM_DISK_MONITORING.md'), 'VM_DISK_MONITORING').querySelector(
+ '#backup-safety',
+ ),
+ ).not.toBeNull();
+ expect(text()).toContain(
+ 'An OK backup task or a Verified label does not prove the guest thawed',
+ );
expect(text()).toContain('not this display check');
expect(text()).toContain('independent post-backup checks confirm thaw');
- expect(text()).toContain('fresh successful writes to every filesystem covered by the backup and workload liveness');
+ expect(text()).toContain(
+ 'fresh successful writes to every filesystem covered by the backup and workload liveness',
+ );
expect(text()).toContain('restore only services and timers active before the pause');
expect(text()).toContain('Monitoring and alerts are unavailable while Pulse is stopped');
});
it('limits public diagnostics to the selected evidence without credentials or broad exports', () => {
- expect(text()).toContain('Use consistent placeholders for private server, datastore, namespace and guest identities');
- expect(text()).toContain('Do not share tokens, full API responses, HAR exports, or screenshots with secrets');
+ expect(text()).toContain(
+ 'Use consistent placeholders for private server, datastore, namespace and guest identities',
+ );
+ expect(text()).toContain(
+ 'Do not share tokens, full API responses, HAR exports, or screenshots with secrets',
+ );
expect(text()).toContain("one guest's protection explanation, PBS Job/History/Access values");
});
});
diff --git a/scripts/installtests/build_release_assets_test.go b/scripts/installtests/build_release_assets_test.go
index 4ffc3de0fd..accbdab06b 100644
--- a/scripts/installtests/build_release_assets_test.go
+++ b/scripts/installtests/build_release_assets_test.go
@@ -5072,11 +5072,12 @@ func TestFrontendChangeClassificationPreservesStrictAudit(t *testing.T) {
missingBase bool
diffStatus int
code, dependencies string
+ goCompile bool
audit bool
auditStatus int
}{
{name: "docs_only", files: "docs/FAQ.md\nREADME.md\n", code: "false", dependencies: "false"},
- {name: "unrelated_code", files: "internal/config/config.go\n", code: "true", dependencies: "false"},
+ {name: "unrelated_code", goCompile: true, files: "internal/config/config.go\n", code: "true", dependencies: "false"},
{name: "manifest", files: "frontend-modern/package.json\n", code: "true", dependencies: "true"},
{name: "lock", files: "frontend-modern/package-lock.json\n", code: "true", dependencies: "true"},
{name: "audit_runner", files: "scripts/npm-audit-retry.sh\n", code: "true", dependencies: "true"},
@@ -5085,15 +5086,15 @@ func TestFrontendChangeClassificationPreservesStrictAudit(t *testing.T) {
{name: "large_runner_first", files: "scripts/npm-audit-retry.sh\n" + docs, code: "true", dependencies: "true"},
{name: "large_lock_last", files: docs + "frontend-modern/package-lock.json\n", code: "true", dependencies: "true"},
{name: "large_docs_only", files: docs, code: "false", dependencies: "false"},
- {name: "large_unrelated_code", files: docs + "internal/config/config.go\n", code: "true", dependencies: "false"},
+ {name: "large_unrelated_code", goCompile: true, files: docs + "internal/config/config.go\n", code: "true", dependencies: "false"},
{name: "exact_path_lookalikes", files: "frontend-modern/package.json.extra\nother/frontend-modern/package-lock.json\nscripts/npm-audit-retry.sh.extra\n", code: "true", dependencies: "false"},
{name: "pull_request_docs", files: "docs/FAQ.md\n", event: "pull_request", code: "false", dependencies: "false"},
- {name: "zero_push_base", base: strings.Repeat("0", 40), code: "true", dependencies: "true"},
- {name: "missing_base", missingBase: true, code: "true", dependencies: "true"},
- {name: "manual_dispatch", event: "workflow_dispatch", base: "empty", code: "true", dependencies: "true"},
+ {name: "zero_push_base", goCompile: true, base: strings.Repeat("0", 40), code: "true", dependencies: "true"},
+ {name: "missing_base", goCompile: true, missingBase: true, code: "true", dependencies: "true"},
+ {name: "manual_dispatch", goCompile: true, event: "workflow_dispatch", base: "empty", code: "true", dependencies: "true"},
{name: "failed_diff", diffStatus: 42},
{name: "large_changed_graph_critical_blocks", files: "frontend-modern/package-lock.json\n" + docs, code: "true", dependencies: "true", audit: true, auditStatus: 1},
- {name: "unchanged_graph_critical_warns", files: "internal/config/config.go\n", code: "true", dependencies: "false", audit: true, auditStatus: 0},
+ {name: "unchanged_graph_critical_warns", goCompile: true, files: "internal/config/config.go\n", code: "true", dependencies: "false", audit: true, auditStatus: 0},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
@@ -5137,6 +5138,9 @@ func TestFrontendChangeClassificationPreservesStrictAudit(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
cmd := exec.CommandContext(ctx, "bash", "-c", run)
+ // Actions runs this shell from the checkout root, including its
+ // repo-relative compilation helper. Keep that real execution context.
+ cmd.Dir = repoFile()
cmd.Env = env
result, commandErr := cmd.CombinedOutput()
if tc.diffStatus != 0 {
@@ -5166,8 +5170,8 @@ func TestFrontendChangeClassificationPreservesStrictAudit(t *testing.T) {
}
values[key] = value
}
- if values["code"] != tc.code || values["frontend_deps"] != tc.dependencies {
- t.Errorf("actual classification = %v; want code=%s frontend_deps=%s (%d changed bytes)", values, tc.code, tc.dependencies, len(tc.files))
+ if values["code"] != tc.code || values["frontend_deps"] != tc.dependencies || values["go_compile"] != strconv.FormatBool(tc.goCompile) {
+ t.Errorf("actual classification = %v; want code=%s frontend_deps=%s go_compile=%t (%d changed bytes)", values, tc.code, tc.dependencies, tc.goCompile, len(tc.files))
}
if !tc.audit {
return