Exclude restart operations from activity log

This commit is contained in:
2026-10-07 23:23:11 -04:00
parent 58375e6db0
commit c0c34d8735
4 changed files with 9 additions and 4 deletions
+5 -1
View File
@@ -66,6 +66,9 @@ describe('unified retained Activity', () => {
}
}
api.remote('check', { kind: 'instance.inspect', routine: 1 });
api.remote('standalone-restart', { kind: 'instance.restart' });
api.maintenance(3);
api.handle.prepare("UPDATE maintenance_jobs SET kind='schedule' WHERE id=3").run();
api.incident('finding');
api.maintenance(2);
const query = { excludeProvisioning: true, limit: 2 };
@@ -77,8 +80,9 @@ describe('unified retained Activity', () => {
expect(last.rows).toHaveLength(1);
expect([...first.rows, ...last.rows].map(row => row.id).sort()).toEqual(['host:check', 'maintenance:2', 'recovery:finding']);
expect(api.activityHistory({ ...query, type: 'create' }).total).toBe(0);
expect(api.activityHistory({ ...query, type: 'restart' }).total).toBe(0);
expect(api.activityHistory({ ...query, source: 'autoscaling' }).total).toBe(0);
expect(api.activityHistory({ server }).total).toBe(39);
expect(api.activityHistory({ server }).total).toBe(41);
});
it('paginates the full union with exact totals, stable ties and removed-server history', async () => {
+1
View File
@@ -60,6 +60,7 @@ it('renders one page heading with provisioning management and filters removed',
const body = render(ActivityPage, { props: { data: { activity: report(), user: { role: 'admin' }, setupRequired: false } as any } }).body;
expect(body.match(/<h1[ >]/g)).toHaveLength(1); expect(body).not.toContain('Manage servers'); expect(body).not.toContain('href="/provisioning"');
expect(body).not.toContain('<option value="create"'); expect(body).not.toContain('<option value="provisioning"');
expect(body).not.toContain('<option value="restart"');
const viewer = render(ActivityPage, { props: { data: { activity: report(), user: { role: 'viewer' }, setupRequired: false } as any } }).body;
expect(viewer).not.toContain('Manage servers');
});