feat(workflow): publish verified forecast controls and consolidated docs
Tests / test (push) Successful in 1m1s
Tests / test (push) Successful in 1m1s
Approved by Daniel Haefliger for develop and beta. Author dh_Agent, authenticated account dh. Preserve published battery, charging and overall Energy Pie changes. No deployment or plant control authorization.
This commit is contained in:
@@ -8,6 +8,18 @@ import { repositories } from '../config.mjs';
|
||||
const page = { repo:'Enelix-EMS', source:'docs/public/manager.md', output:'manager.html', title:'Manager', group:'Anleitungen', markdown:'# Manager\n\n## Einrichten\n\nInhalt.', commit:'a'.repeat(40) };
|
||||
const targets = [page, { repo:'Enelix-EMS', source:'docs/module/Manager/README.md', output:'ems/Manager.html' }, { repo:'Enelix-Utils', source:'docs/module/Energiediagramm/README.md', output:'utils/Energiediagramm.html' }];
|
||||
test('relative README links remain public', () => assert.equal(resolveLink('../module/Manager/README.md#variablen', page, targets), '/docs/ems/Manager.html#variablen'));
|
||||
test('explicit other-channel links retain their Git target', () => {
|
||||
for (const branch of ['main', 'beta']) {
|
||||
const href = `https://git.belevo.ch/ENELIX/Enelix-EMS/src/branch/${branch}/docs/module/Manager/README.md#variablen`;
|
||||
assert.equal(resolveLink(href, { ...page, branch:'develop' }, targets), href);
|
||||
}
|
||||
});
|
||||
test('same-channel links map locally and respect the manifest branch', () => {
|
||||
const href = 'https://git.belevo.ch/ENELIX/Enelix-EMS/src/branch/beta/docs/module/Manager/README.md';
|
||||
assert.equal(resolveLink(href, { ...page, branch:'beta' }, targets), '/docs/ems/Manager.html');
|
||||
const html = renderPage({ ...page, markdown:`# Channels\n\n[Beta](${href})` }, targets, { branch:'beta', checkedAt:'2026-10-07T00:00:00Z' }, '123456');
|
||||
assert.match(html, /href="\/docs\/ems\/Manager.html"/);
|
||||
});
|
||||
test('cross-repository links remain public', () => assert.equal(resolveLink('../../../Enelix-Utils/docs/module/Energiediagramm/README.md', page, targets), '/docs/utils/Energiediagramm.html'));
|
||||
test('private and unsafe targets are not published', () => {
|
||||
for (const href of ['../NETPLAN_V4_AGENT_HANDOFF.md', '../Offene-Punkte.md', 'javascript:alert(1)', '//evil.example', 'data:text/html,hello', 'https://user:pass@example.com', '/srv/agent/.netrc']) assert.equal(resolveLink(href, page, targets), null);
|
||||
|
||||
Reference in New Issue
Block a user