openvibers/openvibe.blog Commits

changelog: Network's /api/v1/registry/releases lists services under 'services' (the test stub now answers in that shape)

OP OpenVibers committed 24 Sept 2026 · 58d2e456ae · 2 files, +4 −3


Changes

ddiff --git a/server/changelog.js b/server/changelog.js
iindex 1a23355..6f29e27 100644
---- a/server/changelog.js
++++ b/server/changelog.js
@@@ -110,9 +110,10 @@ function createChangelog({ config, store, blogs, posts, aiDrafts = null, fetchIm
async function registry() {
const base = String(c.networkUrl).replace(/\/+$/, '');
const [svc, rel] = await Promise.all([getJson(`${base}/api/v1/registry/services`), getJson(`${base}/api/v1/registry/releases`)]);
-- const services = new Map((svc.services || svc || []).map((s) => [s.id, s]));
++ const list = (x, key) => (Array.isArray(x) ? x : (x && (x[key] || x.services)) || []);
++ const services = new Map(list(svc, 'services').map((s) => [s.id, s]));
const out = [];
-- for (const r of rel.releases || rel || []) {
++ for (const r of list(rel, 'releases')) {
const s = services.get(r.id);
if (!s || !s.repository || !/^[0-9a-f]{7,40}$/.test(String(r.release || ''))) continue;
if (!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(s.repository)) continue;
ddiff --git a/test/changelog.test.js b/test/changelog.test.js
iindex ec675f5..84291ac 100644
---- a/test/changelog.test.js
++++ b/test/changelog.test.js
@@@ -22,7 +22,7 @@ const H = (n) => n.toString(16).padStart(40, 'a');
{ id: 'tools', name: 'OpenVibe.Tools', repository: 'OpenVibers/OpenVibe.Tools', publicOrigin: 'https://openvibe.tools' },
{ id: 'norepo', name: 'X' },
] });
-- if (u.pathname === '/api/v1/registry/releases') return json({ releases: Object.entries(releases).map(([id, r]) => ({ id, release: r, released_at: new Date(t.clock.now()).toISOString() })) });
++ if (u.pathname === '/api/v1/registry/releases') return json({ checked_at: null, libraries: [], behind: [], services: Object.entries(releases).map(([id, r]) => ({ id, release: r, released_at: new Date(t.clock.now()).toISOString() })) });
if (u.hostname === 'api.github.com') {
ghCalls.push(u.pathname);
const m = u.pathname.match(/^\/repos\/(.+)\/compare\/(.+)\.\.\.(.+)$/);