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)
Changes
@@@ -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 };@@@ -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;
@@ -55,9 +55,12 @@ function createDeployDrift({ services, fetchImpl = globalThis.fetch, token = ()
@@ -55,9 +55,12 @@ function createDeployDrift({ services, fetchImpl = globalThis.fetch, token = ()
const behind = Number(body.behind_by) || 0;
const behind = Number(body.behind_by) || 0;
const commits = Array.isArray(body.commits) ? body.commits : [];
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);
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;
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 {
else {
const first = commits[0] && commits[0].commit && (commits[0].commit.committer || commits[0].commit.author);
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 };
row = { state: 'behind', behind_by: ahead, since: first && first.date ? new Date(first.date).toISOString() : null };
@@ -14,7 +14,7 @@ const answers = {
@@ -14,7 +14,7 @@ const answers = {
{ sha: 'c2', commit: { committer: { date: '2026-09-25T11:00:00Z' } } },
{ sha: 'c2', commit: { committer: { date: '2026-09-25T11:00:00Z' } } },
{ sha: 'c3ffffffffffff', commit: { committer: { date: '2026-09-26T09: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' } },
'OpenVibers/OpenVibe.Tools/compare/ddddddd4...main': { status: 404, body: { message: 'Not Found' } },
};
};
let failing = false;
let failing = false;