Skip to content

Commit

Permalink
Merge branch 'edge' into api-remove_old_lpc_setup_command_accommodations
Browse files Browse the repository at this point in the history
  • Loading branch information
sanni-t committed Nov 20, 2023
2 parents c31f8ae + d526537 commit 4e8f870
Show file tree
Hide file tree
Showing 717 changed files with 27,311 additions and 36,321 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ update-server/**
robot-server/**
notify-server/**
shared-data/python/**
hardware-testing/**

# app-testing don't format the json protocols
app-testing/files
2 changes: 1 addition & 1 deletion .github/workflows/app-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ jobs:
echo "Configuring project, bucket, and folder for ot3"
echo "project=ot3" >> $GITHUB_OUTPUT
echo "bucket=${{env._APP_DEPLOY_BUCKET_OT3}}" >> $GITHUB_OUTPUT
echo "folder=${{env._APP_DEPLOY_BUCKET_OT3}}" >> $GITHUB_OUTPUT
echo "folder=${{env._APP_DEPLOY_FOLDER_OT3}}" >> $GITHUB_OUTPUT
fi
- uses: 'actions/checkout@v3'
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ll-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ jobs:
build-ll:
name: 'build labware library artifact'
needs: ['js-unit-test']
timeout-minutes: 30
runs-on: 'ubuntu-20.04'
if: github.event_name != 'pull_request'
steps:
Expand Down
73 changes: 0 additions & 73 deletions api-client/src/deck_configuration/__stubs__/index.ts

This file was deleted.

29 changes: 0 additions & 29 deletions api-client/src/deck_configuration/createDeckConfiguration.ts

This file was deleted.

30 changes: 0 additions & 30 deletions api-client/src/deck_configuration/deleteDeckConfiguration.ts

This file was deleted.

23 changes: 10 additions & 13 deletions api-client/src/deck_configuration/getDeckConfiguration.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
// import { GET, request } from '../request'
import { DECK_CONFIG_STUB } from './__stubs__'
import { GET, request } from '../request'

import type { DeckConfiguration } from '@opentrons/shared-data'
// import type { ResponsePromise } from '../request'
import type { ResponsePromise } from '../request'
import type { HostConfig } from '../types'

// TODO(bh, 2023-09-26): uncomment and remove deck config stub when backend api is ready
// export function getDeckConfiguration(
// config: HostConfig
// ): ResponsePromise<DeckConfiguration> {
// return request<DeckConfiguration>(GET, `/deck_configuration`, null, config)
// }
import type { DeckConfigurationResponse } from './types'

export function getDeckConfiguration(
config: HostConfig
): Promise<{ data: DeckConfiguration }> {
return Promise.resolve({ data: Object.values(DECK_CONFIG_STUB) })
): ResponsePromise<DeckConfigurationResponse> {
return request<DeckConfigurationResponse>(
GET,
`/deck_configuration`,
null,
config
)
}
7 changes: 5 additions & 2 deletions api-client/src/deck_configuration/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
export { createDeckConfiguration } from './createDeckConfiguration'
export { deleteDeckConfiguration } from './deleteDeckConfiguration'
export { getDeckConfiguration } from './getDeckConfiguration'
export { updateDeckConfiguration } from './updateDeckConfiguration'

export type {
DeckConfigurationResponse,
UpdateDeckConfigurationRequest,
} from './types'
14 changes: 14 additions & 0 deletions api-client/src/deck_configuration/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { DeckConfiguration } from '@opentrons/shared-data'

export interface UpdateDeckConfigurationRequest {
data: {
cutoutFixtures: DeckConfiguration
}
}

export interface DeckConfigurationResponse {
data: {
cutoutFixtures: DeckConfiguration
lastUpdatedAt: string
}
}
41 changes: 15 additions & 26 deletions api-client/src/deck_configuration/updateDeckConfiguration.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
import { v4 as uuidv4 } from 'uuid'
import { PUT, request } from '../request'

// import { PATCH, request } from '../request'
import { DECK_CONFIG_STUB } from './__stubs__'

import type { Fixture } from '@opentrons/shared-data'
// import type { ResponsePromise } from '../request'
import type { DeckConfiguration } from '@opentrons/shared-data'
import type { ResponsePromise } from '../request'
import type { HostConfig } from '../types'

// TODO(bh, 2023-09-26): uncomment and remove deck config stub when backend api is ready
// export function updateDeckConfiguration(
// config: HostConfig,
// data: Omit<Fixture, 'fixtureId'>
// ): ResponsePromise<Fixture> {
// const { fixtureLocation, ...rest } = data
// return request<Fixture, { data: Omit<Fixture, 'fixtureLocation'> }>(
// PATCH,
// `/deck_configuration/${fixtureLocation}`,
// { data: rest },
// config
// )
// }
import type {
DeckConfigurationResponse,
UpdateDeckConfigurationRequest,
} from './types'

export function updateDeckConfiguration(
config: HostConfig,
data: Omit<Fixture, 'fixtureId'>
): Promise<{ data: Fixture }> {
const { fixtureLocation } = data
const fixtureId = uuidv4()
DECK_CONFIG_STUB[fixtureLocation] = { ...data, fixtureId }
return Promise.resolve({ data: DECK_CONFIG_STUB[fixtureLocation] })
deckConfig: DeckConfiguration
): ResponsePromise<DeckConfigurationResponse> {
return request<DeckConfigurationResponse, UpdateDeckConfigurationRequest>(
PUT,
'/deck_configuration',
{ data: { cutoutFixtures: deckConfig } },
config
)
}
56 changes: 1 addition & 55 deletions api-client/src/protocols/__tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,10 @@ import {
parseLiquidsInLoadOrder,
parseLabwareInfoByLiquidId,
parseInitialLoadedLabwareByAdapter,
parseInitialLoadedFixturesByCutout,
} from '../utils'
import { simpleAnalysisFileFixture } from '../__fixtures__'

import {
LoadFixtureRunTimeCommand,
RunTimeCommand,
STAGING_AREA_LOAD_NAME,
STANDARD_SLOT_LOAD_NAME,
WASTE_CHUTE_LOAD_NAME,
} from '@opentrons/shared-data'
import { RunTimeCommand } from '@opentrons/shared-data'

const mockRunTimeCommands: RunTimeCommand[] = simpleAnalysisFileFixture.commands as any
const mockLoadLiquidRunTimeCommands = [
Expand Down Expand Up @@ -366,53 +359,6 @@ describe('parseInitialLoadedModulesBySlot', () => {
)
})
})
describe('parseInitialLoadedFixturesByCutout', () => {
it('returns fixtures loaded in cutouts', () => {
const loadFixtureCommands: LoadFixtureRunTimeCommand[] = [
{
id: 'fakeId1',
commandType: 'loadFixture',
params: {
loadName: STAGING_AREA_LOAD_NAME,
location: { cutout: 'B3' },
},
createdAt: 'fake_timestamp',
startedAt: 'fake_timestamp',
completedAt: 'fake_timestamp',
status: 'succeeded',
},
{
id: 'fakeId2',
commandType: 'loadFixture',
params: { loadName: WASTE_CHUTE_LOAD_NAME, location: { cutout: 'D3' } },
createdAt: 'fake_timestamp',
startedAt: 'fake_timestamp',
completedAt: 'fake_timestamp',
status: 'succeeded',
},
{
id: 'fakeId3',
commandType: 'loadFixture',
params: {
loadName: STANDARD_SLOT_LOAD_NAME,
location: { cutout: 'C3' },
},
createdAt: 'fake_timestamp',
startedAt: 'fake_timestamp',
completedAt: 'fake_timestamp',
status: 'succeeded',
},
]
const expected = {
B3: loadFixtureCommands[0],
D3: loadFixtureCommands[1],
C3: loadFixtureCommands[2],
}
expect(parseInitialLoadedFixturesByCutout(loadFixtureCommands)).toEqual(
expected
)
})
})
describe('parseLiquidsInLoadOrder', () => {
it('returns liquids in loaded order', () => {
const expected = [
Expand Down
Loading

0 comments on commit 4e8f870

Please sign in to comment.