From 7ff979e66ee75510679b00e8d0361d7d27845ff7 Mon Sep 17 00:00:00 2001 From: Matt Seddon Date: Thu, 20 Apr 2023 12:39:08 +1000 Subject: [PATCH] Fix experiment id for commits (shown in plots) --- extension/src/experiments/model/collect.ts | 2 +- extension/src/test/fixtures/expShow/survival/rows.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extension/src/experiments/model/collect.ts b/extension/src/experiments/model/collect.ts index 938b8cabdb..4201bfe0ec 100644 --- a/extension/src/experiments/model/collect.ts +++ b/extension/src/experiments/model/collect.ts @@ -171,11 +171,11 @@ const collectExpState = ( commitData: { [sha: string]: CommitData } ): Experiment | undefined => { const { rev, name } = expState - const id = name || rev const label = rev === EXPERIMENT_WORKSPACE_ID ? EXPERIMENT_WORKSPACE_ID : name || shortenForLabel(rev) + const id = name || label const experiment: Experiment = { id, label } diff --git a/extension/src/test/fixtures/expShow/survival/rows.ts b/extension/src/test/fixtures/expShow/survival/rows.ts index 03b5c9e207..a669c93df0 100644 --- a/extension/src/test/fixtures/expShow/survival/rows.ts +++ b/extension/src/test/fixtures/expShow/survival/rows.ts @@ -316,7 +316,7 @@ const data: Commit[] = [ starred: false }, { - id: 'a49e03966a1f9f1299ec222ebc4bed8625d2c54d', + id: 'a49e039', label: 'a49e039', sha: 'a49e03966a1f9f1299ec222ebc4bed8625d2c54d', Created: '2021-07-16T19:50:39', @@ -473,7 +473,7 @@ const data: Commit[] = [ starred: false }, { - id: '4f7b50c3d171a11b6cfcd04416a16fc80b61018d', + id: '4f7b50c', label: '4f7b50c', sha: '4f7b50c3d171a11b6cfcd04416a16fc80b61018d', Created: '2021-07-16T19:48:45',