Skip to content

Commit

Permalink
Merge branch 'main' into react-virtualized
Browse files Browse the repository at this point in the history
  • Loading branch information
sroy3 authored May 19, 2022
2 parents 1e64d87 + 8c2e4fd commit 7ce71ae
Show file tree
Hide file tree
Showing 10 changed files with 374 additions and 307 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

All notable changes to this project will be documented in this file.

## [0.2.16] - 2022-05-18

### 🚀 New Features and Enhancements

- Add plots selection quick pick [#1701](https://github.com/iterative/vscode-dvc/pull/1701) by [@mattseddon](https://github.com/mattseddon)
- Add get started component to plots webview [#1718](https://github.com/iterative/vscode-dvc/pull/1718) by [@mattseddon](https://github.com/mattseddon)
- Add codicons to welcome view buttons [#1717](https://github.com/iterative/vscode-dvc/pull/1717) by [@mattseddon](https://github.com/mattseddon)
- Improve plots welcome view when there are no plots [#1722](https://github.com/iterative/vscode-dvc/pull/1722) by [@mattseddon](https://github.com/mattseddon)
- Update view container welcome views [#1728](https://github.com/iterative/vscode-dvc/pull/1728) by [@mattseddon](https://github.com/mattseddon)
- Add experiment run reset to menus [#1719](https://github.com/iterative/vscode-dvc/pull/1719) by [@mattseddon](https://github.com/mattseddon)
- Bypass filters on missing values (for queued experiments) [#1732](https://github.com/iterative/vscode-dvc/pull/1732) by [@mattseddon](https://github.com/mattseddon)

### 🐛 Bug Fixes

- Prevent infinite loop when trying to open plots [#1727](https://github.com/iterative/vscode-dvc/pull/1727) by [@mattseddon](https://github.com/mattseddon)
- Fix experiment stop button [#1731](https://github.com/iterative/vscode-dvc/pull/1731) by [@mattseddon](https://github.com/mattseddon)

### 🔨 Maintenance

- Rearrange internals of base workspace webviews [#1706](https://github.com/iterative/vscode-dvc/pull/1706) by [@mattseddon](https://github.com/mattseddon)

## [0.2.15] - 2022-05-13

### 🚀 New Features and Enhancements
Expand Down
2 changes: 1 addition & 1 deletion extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"extensionDependencies": [
"vscode.git"
],
"version": "0.2.15",
"version": "0.2.16",
"license": "Apache-2.0",
"readme": "./README.md",
"repository": {
Expand Down
4 changes: 3 additions & 1 deletion extension/src/experiments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ export class Experiments extends BaseRepository<TableData> {
this.experiments.setSelectionMode(useFilters)

if (useFilters) {
const filteredExperiments = this.experiments.getFilteredExperiments()
const filteredExperiments = this.experiments
.getFilteredExperiments()
.filter(exp => !exp.queued)
if (tooManySelected(filteredExperiments)) {
await this.warnAndDoNotAutoApply(filteredExperiments)
} else {
Expand Down
29 changes: 28 additions & 1 deletion extension/src/experiments/model/filterBy/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,40 @@ describe('filterExperiments', () => {
id: 3,
params: {
'params.yaml': {
bool: null,
filter: 3,
sort: 1
sort: 1,
text: 'not missing'
}
}
}
] as unknown as Experiment[]

it('should not filter experiments if they do not have the provided value (for queued experiments)', () => {
const unfilteredQueuedExperiments = filterExperiments(
[
{
operator: Operator.IS_FALSE,
path: joinColumnPath(ColumnType.METRICS, 'metrics.json', 'acc'),
value: undefined
}
],
experiments
)

expect(
experiments
.map(
experiment => experiment[ColumnType.METRICS]?.['metrics.json']?.acc
)
.filter(Boolean)
).toHaveLength(0)

expect(
unfilteredQueuedExperiments.map(experiment => experiment.id)
).toStrictEqual([1, 2, 3])
})

it('should return the original experiments if no filters are provided', () => {
const unFilteredExperiments = filterExperiments([], experiments)
expect(unFilteredExperiments).toStrictEqual(experiments)
Expand Down
3 changes: 3 additions & 0 deletions extension/src/experiments/model/filterBy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ const evaluate = <T>(
operator: Operator,
filterValue: T
): boolean => {
if (valueToEvaluate === undefined) {
return true
}
switch (operator) {
case Operator.GREATER_THAN:
return valueToEvaluate > filterValue
Expand Down
74 changes: 37 additions & 37 deletions extension/src/test/suite/experiments/data/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,54 +175,54 @@ suite('Experiments Data Test Suite', () => {

expect(managedUpdateSpy).to.be.called
})
})

it('should not use exp show to fetch git refs external to the workspace if the path is not from a temp workspace', async () => {
const mockNow = getMockNow()
const { data, mockExperimentShow } = buildExperimentsData(disposable)
it('should not use exp show to fetch git refs external to the workspace if the path is not from a temp workspace', async () => {
const mockNow = getMockNow()
const { data, mockExperimentShow } = buildExperimentsData(disposable)

await data.isReady()
bypassProcessManagerDebounce(mockNow)
const mockIsOngoingOrQueued = stub(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(data as any).processManager,
'isOngoingOrQueued'
).returns(false)
await data.isReady()
bypassProcessManagerDebounce(mockNow)
const mockIsOngoingOrQueued = stub(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(data as any).processManager,
'isOngoingOrQueued'
).returns(false)

mockExperimentShow.resetHistory()
mockExperimentShow.resetHistory()

await data.managedUpdate()
await data.managedUpdate()

expect(mockIsOngoingOrQueued).to.be.calledWith('fullUpdate')
expect(mockExperimentShow).to.be.calledOnce
expect(mockExperimentShow).to.be.calledWithExactly(
dvcDemoPath,
ExperimentFlag.NO_FETCH
)
expect(mockIsOngoingOrQueued).to.be.calledWith('fullUpdate')
expect(mockExperimentShow).to.be.calledOnce
expect(mockExperimentShow).to.be.calledWithExactly(
dvcDemoPath,
ExperimentFlag.NO_FETCH
)

bypassProcessManagerDebounce(mockNow, 2)
mockExperimentShow.resetHistory()
bypassProcessManagerDebounce(mockNow, 2)
mockExperimentShow.resetHistory()

await data.managedUpdate(EXPERIMENTS_GIT_LOGS_REFS)
await data.managedUpdate(EXPERIMENTS_GIT_LOGS_REFS)

expect(mockExperimentShow).to.be.calledOnce
expect(mockExperimentShow).to.be.calledWithExactly(
dvcDemoPath,
ExperimentFlag.NO_FETCH
)
})
expect(mockExperimentShow).to.be.calledOnce
expect(mockExperimentShow).to.be.calledWithExactly(
dvcDemoPath,
ExperimentFlag.NO_FETCH
)
})

it('should use exp show to fetch external git refs if the path to a temporary workspace (queued experiment) is provided', async () => {
const mockNow = getMockNow()
const { data, mockExperimentShow } = buildExperimentsData(disposable)
it('should use exp show to fetch external git refs if the path to a temporary workspace (queued experiment) is provided', async () => {
const mockNow = getMockNow()
const { data, mockExperimentShow } = buildExperimentsData(disposable)

await data.isReady()
bypassProcessManagerDebounce(mockNow)
mockExperimentShow.resetHistory()
await data.isReady()
bypassProcessManagerDebounce(mockNow)
mockExperimentShow.resetHistory()

await data.managedUpdate(QUEUED_EXPERIMENT_PATH)
await data.managedUpdate(QUEUED_EXPERIMENT_PATH)

expect(mockExperimentShow).to.be.calledOnce
expect(mockExperimentShow).to.be.calledWithExactly(dvcDemoPath)
expect(mockExperimentShow).to.be.calledOnce
expect(mockExperimentShow).to.be.calledWithExactly(dvcDemoPath)
})
})
})
Loading

0 comments on commit 7ce71ae

Please sign in to comment.