openvibers/openvibe.network Commits

Production drift: a deployed build with commits main lacks is diverged whatever main has (GitHub's compare status first, the counts as a fallback)

OP OpenVibers committed 25 Sept 2026 · bca5d3fea5 · 2 files, +6 −3


Changes

ddiff --git a/server/registry/deploy-drift.js b/server/registry/deploy-drift.js
iindex f571fece..c853dd39 100644
---- a/server/registry/deploy-drift.js
++++ b/server/registry/deploy-drift.js
@@@ -55,9 +55,12 @@ function createDeployDrift({ services, fetchImpl = globalThis.fetch, token = ()
const behind = Number(body.behind_by) || 0;
const commits = Array.isArray(body.commits) ? body.commits : [];
const main = commits.length ? String(commits[commits.length - 1].sha || '').slice(0, 12) : String(release).slice(0, 12);
++ // GitHub's status (base = deployed, head = main): identical | ahead (main has more) | behind |
++ // diverged (the deployed build has commits main lacks); the counts when it is missing.
++ const st = body.status || (behind > 0 ? 'diverged' : ahead > 0 ? 'ahead' : 'identical');
let row;
-- if (behind > 0 && ahead === 0) row = { state: 'diverged', behind_by: 0 };
-- else if (ahead === 0) row = { state: 'current', behind_by: 0 };
++ if (st === 'behind' || st === 'diverged') row = { state: 'diverged', behind_by: ahead };
++ else if (st === 'identical' || ahead === 0) row = { state: 'current', behind_by: 0 };
else {
const first = commits[0] && commits[0].commit && (commits[0].commit.committer || commits[0].commit.author);
row = { state: 'behind', behind_by: ahead, since: first && first.date ? new Date(first.date).toISOString() : null };
ddiff --git a/test/deploy-drift.test.js b/test/deploy-drift.test.js
iindex d2dd26ff..293d5bcc 100644
---- a/test/deploy-drift.test.js
++++ b/test/deploy-drift.test.js
@@@ -14,7 +14,7 @@ const answers = {
{ sha: 'c2', commit: { committer: { date: '2026-09-25T11:00:00Z' } } },
{ sha: 'c3ffffffffffff', commit: { committer: { date: '2026-09-26T09:00:00Z' } } },
] } },
-- 'OpenVibers/OpenVibe.Media/compare/ccccccc3...main': { status: 200, body: { ahead_by: 0, behind_by: 2, commits: [] } },
++ 'OpenVibers/OpenVibe.Media/compare/ccccccc3...main': { status: 200, body: { status: 'diverged', ahead_by: 1, behind_by: 2, commits: [] } },
'OpenVibers/OpenVibe.Tools/compare/ddddddd4...main': { status: 404, body: { message: 'Not Found' } },
};
let failing = false;