Skip to content

Commit

Permalink
Merge branch 'main' into add-move-to-start
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon committed Jul 19, 2023
2 parents 46bdaa8 + 5526a13 commit a7ed31f
Show file tree
Hide file tree
Showing 6 changed files with 426 additions and 417 deletions.
3 changes: 2 additions & 1 deletion extension/src/cli/dvc/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export const DVCLIVE_ONLY_RUNNING_SIGNAL_FILE = join(
)
export const EXP_RWLOCK_FILE = join(TEMP_EXP_DIR, 'rwlock.lock')

export const DEFAULT_NUM_OF_COMMITS_TO_SHOW = 3
export const DEFAULT_CURRENT_BRANCH_COMMITS_TO_SHOW = 3
export const DEFAULT_OTHER_BRANCH_COMMITS_TO_SHOW = 1
export const NUM_OF_COMMITS_TO_INCREASE = 2

export enum Command {
Expand Down
12 changes: 10 additions & 2 deletions extension/src/experiments/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ import { flattenMapValues } from '../../util/map'
import { ModelWithPersistence } from '../../persistence/model'
import { PersistenceKey } from '../../persistence/constants'
import { sum } from '../../util/math'
import { DEFAULT_NUM_OF_COMMITS_TO_SHOW } from '../../cli/dvc/constants'
import {
DEFAULT_CURRENT_BRANCH_COMMITS_TO_SHOW,
DEFAULT_OTHER_BRANCH_COMMITS_TO_SHOW
} from '../../cli/dvc/constants'

type StarredExperiments = Record<string, boolean | undefined>

Expand Down Expand Up @@ -456,7 +459,12 @@ export class ExperimentsModel extends ModelWithPersistence {
}

public getNbOfCommitsToShow(branch: string) {
return this.numberOfCommitsToShow[branch] || DEFAULT_NUM_OF_COMMITS_TO_SHOW
return (
this.numberOfCommitsToShow[branch] ||
(branch === this.currentBranch
? DEFAULT_CURRENT_BRANCH_COMMITS_TO_SHOW
: DEFAULT_OTHER_BRANCH_COMMITS_TO_SHOW)
)
}

public getAllNbOfCommitsToShow() {
Expand Down
6 changes: 3 additions & 3 deletions extension/src/test/suite/experiments/data/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
} from '../../../../commands/internal'
import { buildExperimentsData } from '../util'
import {
DEFAULT_NUM_OF_COMMITS_TO_SHOW,
DEFAULT_CURRENT_BRANCH_COMMITS_TO_SHOW,
ExperimentFlag
} from '../../../../cli/dvc/constants'
import { EXPERIMENTS_GIT_LOGS_REFS } from '../../../../experiments/data/constants'
Expand Down Expand Up @@ -103,7 +103,7 @@ suite('Experiments Data Test Suite', () => {
{
getBranchesToShow: () => ['main'],
getNbOfCommitsToShow: () => ({
main: DEFAULT_NUM_OF_COMMITS_TO_SHOW
main: DEFAULT_CURRENT_BRANCH_COMMITS_TO_SHOW
}),
setBranches: stub()
} as unknown as ExperimentsModel,
Expand Down Expand Up @@ -165,7 +165,7 @@ suite('Experiments Data Test Suite', () => {
{
getBranchesToShow: () => ['main'],
getNbOfCommitsToShow: () => ({
main: DEFAULT_NUM_OF_COMMITS_TO_SHOW
main: DEFAULT_CURRENT_BRANCH_COMMITS_TO_SHOW
}),
setBranches: stub()
} as unknown as ExperimentsModel,
Expand Down
4 changes: 2 additions & 2 deletions extension/src/test/suite/experiments/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { ExperimentsData } from '../../../experiments/data'
import * as Watcher from '../../../fileSystem/watcher'
import { ExperimentsModel } from '../../../experiments/model'
import { ColumnsModel } from '../../../experiments/columns/model'
import { DEFAULT_NUM_OF_COMMITS_TO_SHOW } from '../../../cli/dvc/constants'
import { DEFAULT_CURRENT_BRANCH_COMMITS_TO_SHOW } from '../../../cli/dvc/constants'
import { PersistenceKey } from '../../../persistence/constants'
import { ExpShowOutput } from '../../../cli/dvc/contract'
import { buildExperimentsPipeline } from '../pipeline/util'
Expand Down Expand Up @@ -235,7 +235,7 @@ export const buildExperimentsData = (
internalCommands,
{
getBranchesToShow: mockGetBranchesToShow,
getNbOfCommitsToShow: () => DEFAULT_NUM_OF_COMMITS_TO_SHOW,
getNbOfCommitsToShow: () => DEFAULT_CURRENT_BRANCH_COMMITS_TO_SHOW,
setBranches: mockSetBranches
} as unknown as ExperimentsModel,
[]
Expand Down
16 changes: 8 additions & 8 deletions webview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
"vega-util": "1.17.2"
},
"devDependencies": {
"@storybook/addon-essentials": "7.0.26",
"@storybook/addon-interactions": "7.0.26",
"@storybook/addons": "7.0.26",
"@storybook/builder-webpack5": "7.0.26",
"@storybook/addon-essentials": "7.0.27",
"@storybook/addon-interactions": "7.0.27",
"@storybook/addons": "7.0.27",
"@storybook/builder-webpack5": "7.0.27",
"@storybook/manager-webpack5": "6.5.16",
"@storybook/preset-scss": "1.0.3",
"@storybook/react": "7.0.26",
"@storybook/react-webpack5": "7.0.26",
"@storybook/react": "7.0.27",
"@storybook/react-webpack5": "7.0.27",
"@storybook/testing-library": "0.2.0",
"@svgr/core": "^8.0.0",
"@svgr/plugin-jsx": "^8.0.1",
Expand All @@ -59,7 +59,7 @@
"@types/jsdom": "21.1.1",
"@types/node": "16.x",
"@types/react": "18.2.14",
"@types/react-dom": "18.2.6",
"@types/react-dom": "18.2.7",
"@types/react-measure": "2.0.8",
"@types/react-virtualized": "9.21.22",
"@types/webpack": "5.28.1",
Expand All @@ -76,7 +76,7 @@
"raw-loader": "4.0.2",
"sass": "1.63.6",
"sass-loader": "13.3.2",
"storybook": "7.0.26",
"storybook": "7.0.27",
"storybook-addon-themes": "6.1.0",
"style-loader": "3.3.3",
"ts-loader": "9.4.4",
Expand Down
Loading

0 comments on commit a7ed31f

Please sign in to comment.