Skip to content

Commit

Permalink
Merge branch 'edge' into HEPAUV-AUTO-24.06.06
Browse files Browse the repository at this point in the history
  • Loading branch information
wweiye committed Jun 6, 2024
2 parents 62a1a04 + a8fc68c commit 7947d11
Show file tree
Hide file tree
Showing 5,436 changed files with 2,077,153 additions and 180,363 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 0 additions & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
ignore:
- '**/node_modules'
- 'protocol-library-kludge'
- 'webpack-config'
- 'hardware-testing'
- '**/*.md'
Expand Down
9 changes: 6 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
**/build/**
**/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 All @@ -25,9 +25,12 @@ storybook-static
api/**
update-server/**
robot-server/**
notify-server/**
shared-data/python/**
hardware-testing/**

# app-testing don't format the json protocols
app-testing/files
# app testing don't format the snapshots
app-testing/tests/__snapshots__
opentrons-ai-server/package
opentrons-ai-server/api/storage/index/
84 changes: 69 additions & 15 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ module.exports = {
project: require('path').join(__dirname, 'tsconfig-eslint.json'),
},

extends: ['standard-with-typescript', 'plugin:react/recommended', 'prettier'],
extends: [
'standard-with-typescript',
'plugin:react/recommended',
'prettier',
'plugin:json/recommended',
'plugin:storybook/recommended',
],

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

rules: {
camelcase: 'off',
Expand All @@ -32,6 +38,28 @@ module.exports = {
'no-case-declarations': 'warn',
'prefer-regex-literals': 'warn',
'react/prop-types': 'warn',

// Enforce notification hooks
'no-restricted-imports': [
'error',
{
paths: [
{
name: '@opentrons/react-api-client',
importNames: [
'useAllRunsQuery',
'useRunQuery',
'useAllCommandsQuery',
'useCurrentMaintenanceRun',
'useDeckConfigurationQuery',
'useAllCommandsAsPreSerializedList',
],
message:
'HTTP hook deprecated. Use the equivalent notification wrapper (useNotifyXYZ).',
},
],
},
],
},

globals: {},
Expand All @@ -50,7 +78,15 @@ module.exports = {
overrides: [
{
files: ['**/*.js'],
parser: '@babel/eslint-parser',
extends: ['plugin:@typescript-eslint/disable-type-checked'],
parserOptions: {
project: require('path').join(__dirname, 'tsconfig-eslint.json'),
},
rules: {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-function-return-type': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
},
},
{
// TODO(mc, 2021-03-18): remove to default these rules back to errors
Expand All @@ -65,6 +101,20 @@ module.exports = {
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/consistent-indexed-object-style': 'warn',
'@typescript-eslint/ban-types': 'warn',
'@typescript-eslint/non-nullable-type-assertion-style': 'warn',
'@typescript-eslint/await-thenable': 'warn',
'@typescript-eslint/ban-ts-comment': 'warn',
'@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 @@ -74,27 +124,21 @@ 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',
},
},
{
files: ['**/__tests__/**test.tsx'],
extends: ['plugin:testing-library/react'],
},
{
files: ['**/*.stories.tsx'],
rules: {
Expand All @@ -105,6 +149,16 @@ module.exports = {
{
files: ['**/cypress/**'],
extends: ['plugin:cypress/recommended'],
rules: {
'cypress/unsafe-to-chain-command': 'warn',
},
},
// Allow HTTP hooks in notification wrappers and tests
{
files: ['app/src/resources/**', '**/__tests__/**test**'],
rules: {
'no-restricted-imports': 'off',
},
},
],
}
15 changes: 2 additions & 13 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,11 @@
*.d.ts @Opentrons/js
/webpack-config @Opentrons/js

# subprojects - those with clear team ownership should have appropriate notifications
/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
/app @Opentrons/js
/api-client @Opentrons/js
/react-api-client @Opentrons/js
/app-shell @Opentrons/js
/components @Opentrons/js
/api @Opentrons/py
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/python/pypi-deploy/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ runs:
fi
fi
status=0
QUIET=1 BUILD_NUMBER=${OT_BUILD} make -C ${{ inputs.project }} clean deploy twine_repository_url=${{ inputs.repository_url }} pypi_username=opentrons pypi_password=${{ inputs.password }} || status=$?
CI=1 QUIET=1 BUILD_NUMBER=${OT_BUILD} make -C ${{ inputs.project }} clean deploy twine_repository_url=${{ inputs.repository_url }} pypi_username=__token__ pypi_password=${{ inputs.password }} || status=$?
if [[ ${status} != 0 ]] && [[ ${{ inputs.repository_url }} =~ "test.pypi.org" ]]; then
echo "upload failures allowed to test pypi"
exit 0
Expand Down
12 changes: 8 additions & 4 deletions .github/actions/python/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ runs:
- shell: bash
run: |
if [[ "${OSTYPE}" =~ "linux" ]]; then
# WORKAROUND: Remove microsoft debian repo due to https://github.com/microsoft/linux-package-repositories/issues/130. Remove line below after it is resolved
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update
sudo apt-get install -y --no-install-recommends libsystemd-dev
fi
Expand All @@ -25,8 +27,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 pipenv==2021.5.29
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'
2 changes: 1 addition & 1 deletion .github/actions/webstack/deploy-to-sandbox/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ runs:
steps:
- shell: bash
run: |
aws s3 sync ${{ inputs.distPath }} s3://sandbox.${{ inputs.domain }}/${{ inputs.destPrefix }} --acl=public-read
aws s3 sync ${{ inputs.distPath }} s3://sandbox.${{ inputs.domain }}/${{ inputs.destPrefix }}
59 changes: 59 additions & 0 deletions .github/workflows/abr-testing-lint-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This workflow runs test and lint on branch pushes that touch the abr-testing
# project or its dependencies.

name: 'abr-testing lint/test'
on:
push:
paths:
- 'Makefile'
- 'abr-testing/**'
- 'scripts/**/*.mk'
- 'scripts/**/*.py'
- '.github/workflows/abr-testing-lint-test.yaml'
- '.github/actions/python/**'
branches:
- 'edge'
tags-ignore:
- '*'
pull_request:
paths:
- 'abr-testing/**'
- 'scripts/**/*.mk'
- 'scripts/**/*.py'
- '.github/workflows/abr-testing-lint-test.yaml'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.ref_name != 'edge' || github.run_id}}-${{ github.ref_type != 'tag' || github.run_id }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
lint-test:
runs-on: 'windows-latest'
steps:
- name: Checkout opentrons repo
uses: 'actions/checkout@v3'
with:
fetch-depth: 0
- name: Setup Node
uses: 'actions/setup-node@v3'
with:
node-version: '12'
- name: Setup Python
uses: 'actions/setup-python@v4'
with:
python-version: '3.10'
- name: Set up abr-testing project
uses: './.github/actions/python/setup'
with:
project: 'abr-testing'
- name: lint
run:
make -C abr-testing lint
- name: test
run:
make -C abr-testing test
72 changes: 72 additions & 0 deletions .github/workflows/analyses-snapshot-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Analyses Snapshot Test

on:
workflow_dispatch:
inputs:
TARGET:
description: 'Target branch or tag'
required: true
default: 'edge'
TEST_SOURCE:
description: 'Target for the test code'
required: true
default: 'edge'
schedule:
- cron: '26 7 * * *' # 7:26 AM UTC

jobs:
build-and-test:
timeout-minutes: 15
runs-on: ubuntu-latest
env:
TARGET: ${{ github.event.inputs.TARGET || 'edge' }}
TEST_SOURCE: ${{ github.event.inputs.TEST_SOURCE || 'edge' }}

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ env.TEST_SOURCE }}

- name: Docker Build
working-directory: app-testing
run: make build-opentrons-analysis

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pipenv'
cache-dependency-path: app-testing/Pipfile.lock

- name: Setup Python Dependencies
working-directory: app-testing
run: make setup

- name: Run Test
id: run_test
working-directory: app-testing
run: make snapshot-test

- name: Upload Report
if: '!cancelled()'
uses: actions/upload-artifact@v4
with:
name: test-report
path: app-testing/results/

- name: Handle Test Failure
if: failure()
working-directory: app-testing
run: make snapshot-test-update

- name: Create Snapshot update Request
if: failure()
uses: peter-evans/create-pull-request@v5
with:
commit-message: 'fix(app-testing): snapshot failure capture'
title: 'fix(app-testing): snapshot failure capture'
body: 'This PR is an automated snapshot update request. Please review the changes and merge if they are acceptable or find you bug and fix it.'
branch: 'app-testing/${{ env.TARGET }}-from-${{ env.TEST_SOURCE}}'
base: ${{ env.TEST_SOURCE}}

Loading

0 comments on commit 7947d11

Please sign in to comment.