Skip to content

Commit

Permalink
Merge branch 'edge' into fix_app-firmwareupdate-in-progress-modal
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhuff committed Mar 14, 2024
2 parents 129388a + b882d61 commit 34d9284
Show file tree
Hide file tree
Showing 2,638 changed files with 147,116 additions and 39,914 deletions.
3 changes: 1 addition & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
**/venv/**
.opentrons_config
**/tsconfig*.json

**/vite.config.ts
# prettier
**/package.json
**/CHANGELOG.md
lerna.json
!api/release-notes.md
!app-shell/build/release-notes.md

Expand Down
28 changes: 12 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ module.exports = {
'plugin:react/recommended',
'prettier',
'plugin:json/recommended',
'plugin:storybook/recommended',
],

plugins: ['react', 'react-hooks', 'json', 'jest', 'testing-library'],
plugins: ['react', 'react-hooks', 'json', 'testing-library'],

rules: {
camelcase: 'off',
Expand Down Expand Up @@ -89,6 +90,11 @@ module.exports = {
'@typescript-eslint/unbound-method': 'warn',
'@typescript-eslint/consistent-generic-constructors': 'warn',
'@typescript-eslint/no-misused-promises': 'warn',
// need this to be able to pass in css prop into raw elements (babel adds this at build time for styled-components)
'react/no-unknown-property': [
'error',
{ ignore: ['css', 'indeterminate'] },
],
},
},
{
Expand All @@ -98,35 +104,22 @@ module.exports = {
'**/__mocks__/**.@(js|ts|tsx)',
'**/__utils__/**.@(js|ts|tsx)',
'**/__fixtures__/**.@(js|ts|tsx)',
'**/fixtures/**.@(js|ts|tsx)',
'scripts/*.@(js|ts|tsx)',
],
env: {
jest: true,
},
extends: ['plugin:jest/recommended'],
rules: {
'jest/expect-expect': 'off',
'jest/no-standalone-expect': 'off',
'jest/no-disabled-tests': 'error',
'jest/consistent-test-it': 'error',
'@typescript-eslint/consistent-type-assertions': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-confusing-void-expression': 'warn',
'node/handle-callback-err': 'off',
// TODO(mc, 2021-01-29): fix these and remove warning overrides
'jest/no-deprecated-functions': 'warn',
'jest/valid-title': 'warn',
'jest/no-conditional-expect': 'warn',
'jest/no-alias-methods': 'warn',
'jest/valid-describe-callback': 'warn',
},
},
{
files: ['**/__tests__/**test.tsx'],
env: { jest: true },
extends: ['plugin:testing-library/react'],
rules: {
'testing-library/no-manual-cleanup': 'off',
'testing-library/prefer-screen-queries': 'warn',
},
},
Expand All @@ -140,6 +133,9 @@ module.exports = {
{
files: ['**/cypress/**'],
extends: ['plugin:cypress/recommended'],
rules: {
'cypress/unsafe-to-chain-command': 'warn',
},
},
],
}
11 changes: 6 additions & 5 deletions .github/actions/python/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ runs:
if: ${{ inputs.python-version != 'false' }}
run: echo "OT_VIRTUALENV_VERSION=${{ inputs.python-version }}" >> $GITHUB_ENV
- shell: bash
run: |
npm install --global [email protected]
$OT_PYTHON -m pip install --upgrade pip
$OT_PYTHON -m pip install pipenv==2023.12.1
run: npm install --global [email protected]
- shell: bash
run: $OT_PYTHON -m pip install --upgrade pip
- shell: bash
run: $OT_PYTHON -m pip install --user pipenv==2023.12.1
- shell: bash
run: 'make -C ${{ inputs.project }} setup'
run: 'make -C ${{ inputs.project }} setup || make -C ${{ inputs.project }} setup'
7 changes: 2 additions & 5 deletions .github/workflows/app-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
- 'app-shell-odd/**/*'
- 'components/**/*'
- 'shared-data/**/*'
- 'webpack-config/**/*'
- 'discovery-client/**/*'
- '*.js'
- 'scripts/**/*'
Expand All @@ -32,7 +31,6 @@ on:
- 'app-shell-odd/**/*'
- 'components/**/*'
- 'shared-data/**/*'
- 'webpack-config/**/*'
- 'discovery-client/**/*'
- '*.js'
- '*.json'
Expand Down Expand Up @@ -141,7 +139,7 @@ jobs:
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
make setup-js
- name: 'test native(er) packages'
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)'"
run: make test-js-internal tests="app-shell/src app-shell-odd/src discovery-client/src" cov_opts="--coverage=true"
- name: 'Upload coverage report'
uses: 'codecov/codecov-action@v3'
with:
Expand Down Expand Up @@ -293,7 +291,7 @@ jobs:
OT_APP_DEPLOY_FOLDER: ${{ steps.project.outputs.folder }}

run: |
make -C app-shell dist-${{ matrix.os }}
make -C app-shell dist-${{ matrix.os }} USE_HARD_LINKS=false
- name: 'upload github artifact'
if: matrix.target == 'desktop'
Expand Down Expand Up @@ -443,7 +441,6 @@ jobs:
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
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/components-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ on:
- 'Makefile'
- 'components/**'
- 'app/**/*.stories.@(js|jsx|ts|tsx)'
- 'webpack-config/**'
- 'package.json'
- '.github/workflows/components-test-build-deploy.yaml'
push:
paths:
- 'components/**'
- 'app/**/*.stories.@(js|jsx|ts|tsx)'
- 'webpack-config/**'
- 'package.json'
- '.github/workflows/components-test-build-deploy.yaml'
branches:
Expand Down Expand Up @@ -59,7 +57,6 @@ jobs:
- name: 'setup-js'
run: |
npm config set cache ./.npm-cache
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'run components unit tests'
run: make -C components test-cov
Expand Down Expand Up @@ -177,21 +174,10 @@ jobs:
with:
node-version: '18.19.0'
registry-url: 'https://registry.npmjs.org'
- name: 'cache yarn cache'
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.yarn-cache
${{ github.workspace }}/.npm-cache
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-
- name: 'setup-js'
run: |
npm config set cache ./.npm-cache
yarn config set cache-folder ./.yarn-cache
yarn config set network-timeout 60000
yarn
- name: 'build typescript'
run: make build-ts
- name: 'build library'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/js-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ jobs:
if: always() && steps.setup-js.outcome == 'success'
run: make lint-css
- name: 'test scripts'
run: yarn jest scripts
run: yarn vitest scripts
2 changes: 0 additions & 2 deletions .github/workflows/ll-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
- 'labware-library/**'
- 'shared-data/labware/**'
- 'components/**'
- 'webpack-config/**'
- 'package.json'
- '.github/workflows/ll-test-build-deploy.yaml'
- '.github/actions/webstack/deploy-to-sandbox/**'
Expand All @@ -18,7 +17,6 @@ on:
- 'labware-library/**'
- 'shared-data/labware/**'
- 'components/**'
- 'webpack-config/**'
- 'package.json'
- '.github/workflows/ll-test-build-deploy.yaml'
branches:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/pd-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
- 'step-generation/**'
- 'shared-data/**'
- 'components/**'
- 'webpack-config/**'
- 'package.json'
- '.github/workflows/pd-test-build-deploy.yaml'
push:
Expand All @@ -18,7 +17,6 @@ on:
- 'step-generation/**'
- 'shared-data/**'
- 'components/**'
- 'webpack-config/**'
- 'package.json'
- '.github/workflows/pd-test-build-deploy.yaml'
branches:
Expand Down Expand Up @@ -145,8 +143,6 @@ jobs:
${{ github.workspace }}/.yarn-cache
${{ github.workspace }}/.npm-cache
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-
- name: 'setup-js'
run: |
npm config set cache ./.npm-cache
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/shared-data-test-lint-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,7 @@ jobs:
- name: 'js deps'
run: |
npm config set cache ./.npm-cache
yarn config set cache-folder ./.yarn-cache
yarn config set network-timeout 60000
yarn
yarn config set cache-folder ./.yarn-cache
- name: 'build typescript'
run: make build-ts
- name: 'build library'
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/step-generation-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ on:
paths:
- 'step-generation/**'
- 'shared-data/**'
- 'webpack-config/**'
- 'package.json'
- '.github/workflows/step-generation-test.yaml'
push:
paths:
- 'step-generation/**'
- 'shared-data/**'
- 'webpack-config/**'
- 'package.json'
- '.github/workflows/step-generation-test.yaml'
branches:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tag-releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
npm config set cache ${{ github.workspace }}/.npm-cache
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
yarn install
- name: 'create release'
run: |
node ./scripts/deploy/create-release.js ${{ github.token }} ${{ github.ref_name }} --deploy
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,4 @@ opentrons-robot-app.tar.gz

# asdf versions file
.tool-versions
mock_dir
File renamed without changes.
19 changes: 10 additions & 9 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
'use strict'

const { baseConfig } = require('@opentrons/webpack-config')

module.exports = {
webpackFinal: config => ({
...config,
module: { ...config.module, rules: baseConfig.module.rules },
plugins: [...config.plugins, ...baseConfig.plugins],
}),
stories: [
'../components/**/*.stories.@(js|jsx|ts|tsx)',
'../app/**/*.stories.@(js|jsx|ts|tsx)',
],

addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'storybook-addon-pseudo-states',
],

framework: {
name: '@storybook/react-vite',
options: {},
},

docs: {
autodocs: true,
},
}
File renamed without changes.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ See [DEV_SETUP.md](./DEV_SETUP.md) for our recommended development setup guides
We use:

- [pytest][] to test Python
- [Jest][jest] to test JavaScript
- [Vitest][vitest] to test JavaScript
- To run tests in watch mode, you should also install [watchman][]
- [Cypress.io][cypress] for end to end UI testing

Expand Down Expand Up @@ -199,7 +199,7 @@ make test-js watch=true
make test-js cover=false

# update snapshot tests
# https://jestjs.io/docs/en/snapshot-testing
# https://vitest.dev/guide/snapshot.html
make test-js updateSnapshot=true
```

Expand All @@ -217,7 +217,7 @@ make check-js
```

[pytest]: https://docs.pytest.org/en/latest/
[jest]: https://jestjs.io/
[vitest]: https://vitest.dev/
[watchman]: https://facebook.github.io/watchman/
[cypress]: https://www.cypress.io/

Expand Down Expand Up @@ -291,7 +291,7 @@ JavaScript dependencies are installed by [yarn][]. When calling yarn, you should
A development dependency is any dependency that is used only to help manage the project. Examples of development dependencies would be:

- Build tools (webpack, babel)
- Testing/linting/checking tools (jest, typescript, eslint)
- Testing/linting/checking tools (vitest, typescript, eslint)
- Libraries used only in support scripts (aws, express)

To add a development dependency:
Expand Down
4 changes: 2 additions & 2 deletions DEV_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Close and re-open your terminal to confirm `nvs` is installed.
nvs --version
```

Now we can use nvs to install Node.js v18 and switch on `auto` mode, which will make sure Node.js v18 is used any time we're in the `opentrons` project directory.
Now we can use `nvs` to install the currently required Node.js version set in `.nvmrc`. The `auto` command selects the correct version of Node.js any time we're in the `opentrons` project directory. Without `auto`, we would have to manually run `use` or `install` each time we work on the project.

```shell
nvs add 18
Expand Down Expand Up @@ -148,7 +148,7 @@ eval "$(pyenv init -)"
# ...
```

#### 3. Install `jpeg` if on ARM Mac (M1)
#### 3. Install `jpeg` if on ARM Mac (M1/M2/M3)

`/hardware` depends on the Python library Pillow. On ARM Macs, `pip` will build Pillow from source, which requires [jpeg](https://formulae.brew.sh/formula/jpeg) to be installed.

Expand Down
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
FROM ubuntu as base
ENV TZ=Etc/UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && apt-get install --yes python3 pip pkg-config libsystemd-dev
RUN apt-get update && apt-get install --yes python3 pip pkg-config libsystemd-dev git

FROM base as builder
COPY scripts scripts
COPY LICENSE LICENSE

COPY shared-data shared-data

COPY server-utils/setup.py server-utils/setup.py
COPY server-utils/server_utils server-utils/server_utils

COPY api/MANIFEST.in api/MANIFEST.in
COPY api/setup.py api/setup.py
COPY api/pypi-readme.rst api/pypi-readme.rst
Expand All @@ -18,6 +21,7 @@ COPY robot-server/setup.py robot-server/setup.py
COPY robot-server/robot_server robot-server/robot_server

RUN cd shared-data/python && python3 setup.py bdist_wheel -d /dist/
RUN cd server-utils && python3 setup.py bdist_wheel -d /dist/
RUN cd api && python3 setup.py bdist_wheel -d /dist/
RUN cd robot-server && python3 setup.py bdist_wheel -d /dist/

Expand Down
Loading

0 comments on commit 34d9284

Please sign in to comment.