Skip to content

Commit

Permalink
Merge branch 'edge' into step-generation_get-timeline-from-commands
Browse files Browse the repository at this point in the history
  • Loading branch information
b-cooper committed Oct 25, 2023
2 parents 7a50537 + 51e5209 commit d2c84e4
Show file tree
Hide file tree
Showing 1,435 changed files with 44,380 additions and 14,849 deletions.
23 changes: 11 additions & 12 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@
/webpack-config @Opentrons/js

# subprojects - those with clear team ownership should have appropriate notifications
/protocol-designer @Opentrons/spddrs
/labware-designer @Opentrons/spddrs
/labware-library @Opentrons/spddrs
/protocol-library-kludge @Opentrons/spddrs
/update-server @Opentrons/cpx
/api/src/opentrons @Opentrons/hmg
/discovery-client @Opentrons/cpx
/shared-data/pipette @Opentrons/hmg
/shared-data/protocol @Opentrons/spddrs
/shared-data/module @Opentrons/hmg
/shared-data/deck @Opentrons/hmg
/shared-data/labware @Opentrons/hmg
/protocol-designer @Opentrons/app-and-uis
/labware-designer @Opentrons/app-and-uis
/labware-library @Opentrons/app-and-uis
/protocol-library-kludge @Opentrons/app-and-uis
/update-server @Opentrons/robot-svcs
/discovery-client @Opentrons/robot-svcs @Opentrons/app-and-uis
/shared-data/pipette @Opentrons/embedded-sw
/shared-data/protocol @Opentrons/robot-svcs @Opentrons/app-and-uis
/shared-data/module @Opentrons/embedded-sw
/shared-data/deck @Opentrons/embedded-sw
/shared-data/labware @Opentrons/embedded-sw

# subprojects by language - some subprojects are shared by teams but united by a
# language community (including makefiles and config) so mark them appropriately
Expand Down
63 changes: 57 additions & 6 deletions .github/workflows/app-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
make setup-js
- name: 'test frontend packages'
run: |
yarn jest --coverage=true --ci=true --collectCoverageFrom="app/src/**/*.(js|ts|tsx)" app/src components/src shared-data/js
make -C app test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down Expand Up @@ -141,8 +141,7 @@ jobs:
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
make setup-js
- name: 'test native(er) packages'
run: |
yarn jest --coverage=true --ci=true --collectCoverageFrom="(app-shell|app-shell-odd| discovery-client)/src/**/*.(js|ts|tsx)" app-shell/src app-shell-odd/src discovery-client/src
run: make test-js-internal tests="app-shell/src app-shell-odd/src discovery-client/src" cov_opts="--coverage=true --ci=true --collectCoverageFrom='(app-shell|app-shell-odd| discovery-client)/src/**/*.(js|ts|tsx)'"
- name: 'Upload coverage report'
uses: 'codecov/codecov-action@v3'
with:
Expand Down Expand Up @@ -315,7 +314,8 @@ jobs:
deploy-release-app:
name: 'Deploy built app artifacts to S3'
runs-on: 'ubuntu-22.04'
needs: ['js-unit-test', 'backend-unit-test', 'build-app', 'determine-build-type']
needs:
['js-unit-test', 'backend-unit-test', 'build-app', 'determine-build-type']
if: contains(fromJSON(needs.determine-build-type.outputs.variants), 'release') || contains(fromJSON(needs.determine-build-type.outputs.variants), 'internal-release')
steps:
- name: 'download run app builds'
Expand Down Expand Up @@ -348,6 +348,7 @@ jobs:
- name: 'deploy internal-release release builds to s3'
run: |
aws s3 --profile=deploy sync --acl=public-read to_upload_internal-release/ s3:https://${{ env._APP_DEPLOY_BUCKET_OT3 }}/${{ env._APP_DEPLOY_FOLDER_OT3 }}
- name: 'upload windows artifacts to GH release'
uses: 'ncipollo/[email protected]'
if: needs.determine-build-type.outputs.type == 'release'
Expand Down Expand Up @@ -400,15 +401,65 @@ jobs:
uses: slackapi/[email protected]
if: contains(fromJSON(needs.determine-build-type.outputs.variants), 'internal-release')
with:
payload: "{\"branch_or_tag\":\"${{ github.ref_name }}\",\"build_type\":\"${{ needs.determine-build-type.outputs.type }}\", \"gh_linkback\":\"https://github.com/Opentrons/opentrons/tree/${{ github.ref_name }}\", \"windows_build\":\"${{ env._ACCESS_URL }}/${{steps.names.outputs.windows-internal-release}}\", \"mac_build\":\"${{ env._ACCESS_URL }}/${{steps.names.outputs.mac-internal-release}}\", \"linux_build\":\"${{ env._ACCESS_URL }}/${{steps.names.outputs.linux-internal-release}}\"}"
payload: '{"branch_or_tag":"${{ github.ref_name }}","build_type":"${{ needs.determine-build-type.outputs.type }}", "gh_linkback":"https://github.com/Opentrons/opentrons/tree/${{ github.ref_name }}", "windows_build":"${{ env._ACCESS_URL }}/${{steps.names.outputs.windows-internal-release}}", "mac_build":"${{ env._ACCESS_URL }}/${{steps.names.outputs.mac-internal-release}}", "linux_build":"${{ env._ACCESS_URL }}/${{steps.names.outputs.linux-internal-release}}"}'
env:
SLACK_WEBHOOK_URL: ${{ secrets.OT_APP_OT3_SLACK_NOTIFICATION_WEBHOOK_URL }}
_ACCESS_URL: https://${{env._APP_DEPLOY_BUCKET_OT3}}/${{env._APP_DEPLOY_FOLDER_OT3}}
- name: 'slack notify release'
uses: slackapi/[email protected]
if: contains(fromJSON(needs.determine-build-type.outputs.variants), 'release')
with:
payload: "{\"branch_or_tag\":\"${{ github.ref_name }}\",\"build_type\":\"${{ needs.determine-build-type.outputs.type }}\", \"gh_linkback\":\"https://github.com/Opentrons/opentrons/tree/${{ github.ref_name }}\", \"windows_build\":\"${{ env._ACCESS_URL }}/${{steps.names.outputs.windows-release}}\", \"mac_build\":\"${{ env._ACCESS_URL }}/${{steps.names.outputs.mac-release}}\", \"linux_build\":\"${{ env._ACCESS_URL }}/${{steps.names.outputs.linux-release}}\"}"
payload: '{"branch_or_tag":"${{ github.ref_name }}","build_type":"${{ needs.determine-build-type.outputs.type }}", "gh_linkback":"https://github.com/Opentrons/opentrons/tree/${{ github.ref_name }}", "windows_build":"${{ env._ACCESS_URL }}/${{steps.names.outputs.windows-release}}", "mac_build":"${{ env._ACCESS_URL }}/${{steps.names.outputs.mac-release}}", "linux_build":"${{ env._ACCESS_URL }}/${{steps.names.outputs.linux-release}}"}'
env:
SLACK_WEBHOOK_URL: ${{ secrets.OT_APP_ROBOTSTACK_SLACK_NOTIFICATION_WEBHOOK_URL }}
_ACCESS_URL: https://${{env._APP_DEPLOY_BUCKET_ROBOTSTACK}}/${{env._APP_DEPLOY_FOLDER_ROBOTSTACK}}

- name: 'pull repo for scripts'
uses: 'actions/checkout@v3'
with:
path: ./monorepo
# https://github.com/actions/checkout/issues/290
- name: 'Fix actions/checkout odd handling of tags'
if: startsWith(github.ref, 'refs/tags')
run: |
cd ./monorepo
git fetch -f origin ${{ github.ref }}:${{ github.ref }}
git checkout ${{ github.ref }}
- uses: 'actions/setup-node@v3'
with:
node-version: '16'
- name: 'install udev'
run: sudo apt-get update && sudo apt-get install libudev-dev
- name: 'set complex environment variables'
id: 'set-vars'
uses: actions/github-script@v6
with:
script: |
const { buildComplexEnvVars } = require(`${process.env.GITHUB_WORKSPACE}/monorepo/.github/workflows/utils.js`)
buildComplexEnvVars(core, context)
- name: 'cache yarn cache'
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.npm-cache/_prebuild
${{ github.workspace }}/.yarn-cache
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- name: 'setup-js'
run: |
npm config set cache ${{ github.workspace }}/.npm-cache
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
cd monorepo
make setup-js
- name: 'update internal-releases releases.json'
if: needs.determine-build-type.outputs.type == 'release' && contains(fromJSON(needs.determine-build-type.outputs.variants), 'internal-release')
run: |
aws --profile=deploy s3 cp s3:https://${{ env._APP_DEPLOY_BUCKET_OT3 }}/${{ env._APP_DEPLOY_FOLDER_OT3 }}/releases.json ./to_upload_internal-release/releases.json
node ./monorepo/scripts/update-releases-json ./to_upload_internal-release/releases.json ot3 ./to_upload_internal-release https://ot3-development.builds.opentrons.com/app/
aws --profile=deploy s3 cp ./to_upload_internal-release/releases.json s3:https://${{ env._APP_DEPLOY_BUCKET_OT3 }}/${{ env._APP_DEPLOY_FOLDER_OT3 }}/releases.json
- name: 'update release releases.json'
if: needs.determine-build-type.outputs.type == 'release' && contains(fromJSON(needs.determine-build-type.outputs.variants), 'release')
run: |
aws --profile=deploy s3 cp s3:https://${{ env._APP_DEPLOY_BUCKET_ROBOTSTACK }}/${{ env._APP_DEPLOY_FOLDER_ROBOTSTACK }}/releases.json ./to_upload_release/releases.json
node ./monorepo/scripts/update-releases-json ./to_upload_release/releases.json robot-stack ./to_upload_release https://builds.opentrons.com/app/
aws --profile=deploy s3 cp ./to_upload_release/releases.json s3:https://${{ env._APP_DEPLOY_BUCKET_ROBOTSTACK }}/${{ env._APP_DEPLOY_FOLDER_ROBOTSTACK }}/releases.json
3 changes: 1 addition & 2 deletions .github/workflows/components-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ jobs:
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'run components unit tests'
run: |
yarn jest --coverage=true --ci=true --collectCoverageFrom="components/src/**/*.(js|ts|tsx)" components/src
run: make -C components test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ll-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ jobs:
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'run labware library unit tests'
run: |
yarn jest --coverage=true --ci=true --collectCoverageFrom="labware-library/src/**/*.(js|ts|tsx)" labware-library/src
run: make -C labware-library test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pd-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ jobs:
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'run PD unit tests'
run: |
yarn jest --coverage=true --ci=true --collectCoverageFrom="protocol-designer/src/**/*.(js|ts|tsx)" protocol-designer/src
run: make -C protocol-designer test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/react-api-client-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ jobs:
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'run react-api-client unit tests'
run: |
yarn jest --coverage=true --ci=true --collectCoverageFrom="react-api-client/src/**/*.(js|ts|tsx)" react-api-client/src
run: make -C react-api-client test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/shared-data-test-lint-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ jobs:
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'run shared-data JS unit tests'
run: |
yarn jest --coverage=true --ci=true --collectCoverageFrom="shared-data/js/**/*.(js|ts|tsx)" shared-data/js
run: make -C shared-data test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/step-generation-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ jobs:
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'run step generation unit tests'
run: |
yarn jest --coverage=true --ci=true --collectCoverageFrom="step-generation/src/**/*.(js|ts|tsx)" step-generation/src
run: make -C step-generation test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
with:
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,9 @@ opentrons-robot-app.tar.gz

# local VERSION.json file when pushing to Flex
*new_version_file.json

# ignore linux swap files
*.swp

# asdf versions file
.tool-versions
6 changes: 6 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ export const customViewports = {
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
viewport: { viewports: customViewports },
options: {
storySort: {
method: 'alphabetical',
order: ['Design Tokens', 'Library', 'App', 'ODD'],
},
},
}

// Global decorator to apply the styles to all stories
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,10 @@ ssh-keygen # note the path you save the key to
make -C robot-server install-key br_ssh_pubkey=/path/to/pubkey host=${some_other_ip_address}
```

and subsequently, when you do `make term`, add the `br_ssh_key=/path/to/key` option:
and subsequently, when you do `make term`, add the `ssh_key=/path/to/key` option:

```shell
make term br_ssh_key=/path/to/privkey
make term ssh_key=/path/to/privkey
```

If you create the key as `~/.ssh/robot_key` and `~/.ssh/robot_key.pub` then `make term` and `make install-key` will work without arguments.
Expand Down
3 changes: 2 additions & 1 deletion Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ source "$BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH/robot-server/Config.in"
source "$BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH/shared-data/python/Config.in"
source "$BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH/notify-server/Config.in"
source "$BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH/system-server/Config.in"
source "$BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH/server-utils/Config.in"
source "$BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH/server-utils/Config.in"
source "$BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH/hardware/Config.in"
19 changes: 13 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
include ./scripts/python.mk

API_DIR := api
API_CLIENT_DIR := api-client
APP_DIR := app
APP_SHELL_DIR := app-shell
APP_SHELL_ODD_DIR := app-shell-odd
COMPONENTS_DIR := components
Expand All @@ -15,8 +17,10 @@ NOTIFY_SERVER_DIR := notify-server
PROTOCOL_DESIGNER_DIR := protocol-designer
SHARED_DATA_DIR := shared-data
UPDATE_SERVER_DIR := update-server
REACT_API_CLIENT_DIR := react-api-client
ROBOT_SERVER_DIR := robot-server
SERVER_UTILS_DIR := server-utils
STEP_GENERATION_DIR := step-generation
SYSTEM_SERVER_DIR := system-server
HARDWARE_DIR := hardware
USB_BRIDGE_DIR := usb-bridge
Expand Down Expand Up @@ -195,12 +199,7 @@ test-py: test-py-windows
$(MAKE) -C $(USB_BRIDGE_DIR) test

.PHONY: test-js
test-js:
yarn jest \
--coverage=$(cover) \
--watch=$(watch) \
--updateSnapshot=$(updateSnapshot) \
--ci=$(if $(CI),true,false)
test-js: test-js-internal

# lints and typechecks
.PHONY: lint
Expand Down Expand Up @@ -261,3 +260,11 @@ circular-dependencies-js:
yarn madge $(and $(CI),--no-spinner --no-color) --circular labware-library/src/index.tsx
yarn madge $(and $(CI),--no-spinner --no-color) --circular app/src/index.tsx
yarn madge $(and $(CI),--no-spinner --no-color) --circular components/src/index.ts

.PHONY: test-js-internal
test-js-internal:
yarn jest $(tests) $(test_opts) $(cov_opts)

.PHONY: test-js-%
test-js-%:
$(MAKE) test-js-internal tests="$(if $(tests),$(foreach test,$(tests),$*/$(test)),$*)" test_opts="$(test_opts)" cov_opts="$(cov_opts)"
4 changes: 4 additions & 0 deletions api-client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ clean:
.PHONY: build
build:
rollup --config rollup.config.js

.PHONY: test
test:
$(MAKE) -C .. test-js-api-client
53 changes: 53 additions & 0 deletions api-client/src/deck_configuration/__stubs__/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { v4 as uuidv4 } from 'uuid'

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

import type { Fixture } from '@opentrons/shared-data'

export const DECK_CONFIG_STUB: { [fixtureLocation: string]: Fixture } = {
A1: {
fixtureLocation: 'A1',
loadName: STANDARD_SLOT_LOAD_NAME,
fixtureId: uuidv4(),
},
B1: {
fixtureLocation: 'B1',
loadName: STANDARD_SLOT_LOAD_NAME,
fixtureId: uuidv4(),
},
C1: {
fixtureLocation: 'C1',
loadName: STANDARD_SLOT_LOAD_NAME,
fixtureId: uuidv4(),
},
D1: {
fixtureLocation: 'D1',
loadName: STANDARD_SLOT_LOAD_NAME,
fixtureId: uuidv4(),
},
A3: {
fixtureLocation: 'A3',
loadName: TRASH_BIN_LOAD_NAME,
fixtureId: uuidv4(),
},
B3: {
fixtureLocation: 'B3',
loadName: STANDARD_SLOT_LOAD_NAME,
fixtureId: uuidv4(),
},
C3: {
fixtureLocation: 'C3',
loadName: STAGING_AREA_LOAD_NAME,
fixtureId: uuidv4(),
},
D3: {
fixtureLocation: 'D3',
loadName: WASTE_CHUTE_LOAD_NAME,
fixtureId: uuidv4(),
},
}
29 changes: 29 additions & 0 deletions api-client/src/deck_configuration/createDeckConfiguration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// import { POST, request } from '../request'
import { DECK_CONFIG_STUB } from './__stubs__'

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 createDeckConfiguration(
// config: HostConfig,
// data: DeckConfiguration
// ): ResponsePromise<DeckConfiguration> {
// return request<DeckConfiguration, { data: DeckConfiguration }>(
// POST,
// `/deck_configuration`,
// { data },
// config
// )
// }

export function createDeckConfiguration(
config: HostConfig,
data: DeckConfiguration
): Promise<{ data: DeckConfiguration }> {
data.forEach(fixture => {
DECK_CONFIG_STUB[fixture.fixtureLocation] = fixture
})
return Promise.resolve({ data: Object.values(DECK_CONFIG_STUB) })
}
Loading

0 comments on commit d2c84e4

Please sign in to comment.