Skip to content

Commit 555f551

Browse files
authored
Merge branch 'edge' into app_quick-transfer-run-complete
2 parents 93ca4d8 + 18dfeac commit 555f551

File tree

888 files changed

+58666
-8008
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

888 files changed

+58666
-8008
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,48 @@
11
<!--
2-
Thanks for taking the time to open a pull request! Please make sure you've read the "Opening Pull Requests" section of our Contributing Guide:
2+
Thanks for taking the time to open a Pull Request (PR)! Please make sure you've read the "Opening Pull Requests" section of our Contributing Guide:
33
44
https://github.com/Opentrons/opentrons/blob/edge/CONTRIBUTING.md#opening-pull-requests
55
6+
GitHub provides robust markdown to format your PR. Links, diagrams, pictures, and videos along with text formatting make it possible to create a rich and informative PR. For more information on GitHub markdown, see:
7+
8+
https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax
9+
610
To ensure your code is reviewed quickly and thoroughly, please fill out the sections below to the best of your ability!
711
-->
812

913
# Overview
1014

1115
<!--
12-
Use this section to describe your pull-request at a high level. If the PR addresses any open issues, please tag the issues here.
16+
Describe your PR at a high level. State acceptance criteria and how this PR fits into other work. Link issues, PRs, and other relevant resources.
1317
-->
1418

15-
# Test Plan
19+
## Test Plan and Hands on Testing
1620

1721
<!--
18-
Use this section to describe the steps that you took to test your Pull Request.
19-
If you did not perform any testing provide justification why.
20-
21-
OT-3 Developers: You should default to testing on actual physical hardware.
22-
Once again, if you did not perform testing against hardware, justify why.
23-
24-
Note: It can be helpful to write a test plan before doing development
25-
26-
Example Test Plan (HTTP API Change)
27-
28-
- Verified that new optional argument `dance-party` causes the robot to flash its lights, move the pipettes,
29-
then home.
30-
- Verified that when you omit the `dance-party` option the robot homes normally
31-
- Added protocol that uses `dance-party` argument to G-Code Testing Suite
32-
- Ran protocol that did not use `dance-party` argument and everything was successful
33-
- Added unit tests to validate that changes to pydantic model are correct
34-
22+
Describe your testing of the PR. Emphasize testing not reflected in the code. Attach protocols, logs, screenshots and any other assets that support your testing.
3523
-->
3624

37-
# Changelog
25+
## Changelog
3826

3927
<!--
40-
List out the changes to the code in this PR. Please try your best to categorize your changes and describe what has changed and why.
41-
42-
Example changelog:
43-
- Fixed app crash when trying to calibrate an illegal pipette
44-
- Added state to API to track pipette usage
45-
- Updated API docs to mention only two pipettes are supported
46-
47-
IMPORTANT: MAKE SURE ANY BREAKING CHANGES ARE PROPERLY COMMUNICATED
28+
List changes introduced by this PR considering future developers and the end user. Give careful thought and clear documentation to breaking changes.
4829
-->
4930

50-
# Review requests
31+
## Review requests
5132

5233
<!--
53-
Describe any requests for your reviewers here.
34+
- What do you need from reviewers to feel confident this PR is ready to merge?
35+
- Ask questions.
5436
-->
5537

56-
# Risk assessment
38+
## Risk assessment
5739

5840
<!--
59-
Carefully go over your pull request and look at the other parts of the codebase it may affect. Look for the possibility, even if you think it's small, that your change may affect some other part of the system - for instance, changing return tip behavior in protocol may also change the behavior of labware calibration.
60-
61-
Identify the other parts of the system your codebase may affect, so that in addition to your own review and testing, other people who may not have the system internalized as much as you can focus their attention and testing there.
41+
- Indicate the level of attention this PR needs.
42+
- Provide context to guide reviewers.
43+
- Discuss trade-offs, coupling, and side effects.
44+
- Look for the possibility, even if you think it's small, that your change may affect some other part of the system.
45+
- For instance, changing return tip behavior may also change the behavior of labware calibration.
46+
- How do your unit tests and on hands on testing mitigate this PR's risks and the risk of future regressions?
47+
- Especially in high risk PRs, explain how you know your testing is enough.
6248
-->

.github/workflows/analyses-snapshot-test.yaml

Lines changed: 95 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,30 @@ on:
1111
description: 'Branch or tag that provides the snapshot and test code at test runtime'
1212
required: true
1313
default: 'edge'
14+
OPEN_PR_ON_FAILURE:
15+
description: 'If the test fails, open a PR to update the snapshots'
16+
type: boolean
17+
required: true
18+
default: false
1419
schedule:
15-
- cron: '26 7 * * *' # 7:26 AM UTC
20+
- cron: '26 7 * * *' # 7:26 AM UTC
1621
pull_request:
1722
paths:
1823
- 'api/**'
1924
- '!api/tests/**'
2025
- '!api/docs/**'
26+
- '!api/release-notes-internal.md'
27+
- '!api/release-notes.md'
2128
- 'shared-data/**/*'
2229
- '!shared-data/js/**'
30+
- '.github/workflows/analyses-snapshot-test.yaml'
31+
- 'analyses-snapshot-testing/**'
32+
33+
types:
34+
- opened #default
35+
- synchronize #default
36+
- reopened #default
37+
- labeled
2338

2439
concurrency:
2540
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -32,66 +47,93 @@ jobs:
3247
env:
3348
ANALYSIS_REF: ${{ github.event.inputs.ANALYSIS_REF || github.head_ref || 'edge' }}
3449
SNAPSHOT_REF: ${{ github.event.inputs.SNAPSHOT_REF || github.head_ref || 'edge' }}
35-
50+
# If we're running because of workflow_dispatch, use the user input to decide
51+
# whether to open a PR on failure. Otherwise, there is no user input, so always
52+
# open a PR on failure.
53+
OPEN_PR_ON_FAILURE: ${{ (github.event_name == 'workflow_dispatch' && github.events.inputs.OPEN_PR_ON_FAILURE) || ((github.event_name != 'workflow_dispatch') && (contains(github.event.pull_request.labels.*.name, 'gen-analyses-snapshot-pr'))) }}
54+
PR_TARGET_BRANCH: ${{ github.event.pull_request.base.ref || 'not a pr'}}
3655
steps:
37-
- name: Checkout Repository
38-
uses: actions/checkout@v4
39-
with:
40-
ref: ${{ env.SNAPSHOT_REF }}
56+
- name: Checkout Repository
57+
uses: actions/checkout@v4
58+
with:
59+
ref: ${{ env.SNAPSHOT_REF }}
60+
61+
- name: Are the analyses snapshots in my PR branch in sync with the target branch?
62+
if: github.event_name == 'pull_request'
63+
run: |
64+
git fetch origin ${{ env.PR_TARGET_BRANCH }}
65+
DIFF_OUTPUT=$(git diff HEAD origin/${{ env.PR_TARGET_BRANCH }} -- analyses-snapshot-testing/tests/__snapshots__/analyses_snapshot_test)
66+
if [ -n "$DIFF_OUTPUT" ]; then
67+
echo "Analyses snapshots do NOT match ${{ env.PR_TARGET_BRANCH }} snapshots."
68+
echo "Is this becasue you have not pulled and merged ${{ env.PR_TARGET_BRANCH }}?"
69+
echo "Or is this because you have already updated your snapshots and are all good 😊?"
70+
else
71+
echo "Analyses snapshots match ${{ env.PR_TARGET_BRANCH }} snapshots."
72+
fi
4173
42-
- name: Docker Build
43-
working-directory: analyses-snapshot-testing
44-
run: make build-opentrons-analysis
74+
- name: Docker Build
75+
working-directory: analyses-snapshot-testing
76+
run: make build-opentrons-analysis
4577

46-
- name: Set up Python 3.12
47-
uses: actions/setup-python@v5
48-
with:
49-
python-version: '3.12'
50-
cache: 'pipenv'
51-
cache-dependency-path: analyses-snapshot-testing/Pipfile.lock
78+
- name: Set up Python 3.12
79+
uses: actions/setup-python@v5
80+
with:
81+
python-version: '3.12'
82+
cache: 'pipenv'
83+
cache-dependency-path: analyses-snapshot-testing/Pipfile.lock
5284

53-
- name: Setup Python Dependencies
54-
working-directory: analyses-snapshot-testing
55-
run: make setup
85+
- name: Setup Python Dependencies
86+
working-directory: analyses-snapshot-testing
87+
run: make setup
5688

57-
- name: Run Test
58-
id: run_test
59-
working-directory: analyses-snapshot-testing
60-
run: make snapshot-test
89+
- name: Run Test
90+
id: run_test
91+
working-directory: analyses-snapshot-testing
92+
run: make snapshot-test
6193

62-
- name: Upload Report
63-
if: '!cancelled()'
64-
uses: actions/upload-artifact@v4
65-
with:
66-
name: test-report
67-
path: analyses-snapshot-testing/results/
94+
- name: Upload Report
95+
if: '!cancelled()'
96+
uses: actions/upload-artifact@v4
97+
with:
98+
name: test-report
99+
path: analyses-snapshot-testing/results/
68100

69-
- name: Handle Test Failure
70-
id: handle_failure
71-
if: always() && steps.run_test.outcome == 'failure'
72-
working-directory: analyses-snapshot-testing
73-
run: make snapshot-test-update
101+
- name: Handle Test Failure
102+
id: handle_failure
103+
if: always() && steps.run_test.outcome == 'failure' && (env.OPEN_PR_ON_FAILURE == 'true' || github.event_name == 'schedule')
104+
working-directory: analyses-snapshot-testing
105+
run: make snapshot-test-update
74106

75-
- name: Create Snapshot update Request
76-
id: create_pull_request
77-
if: always() && steps.handle_failure.outcome == 'success'
78-
uses: peter-evans/create-pull-request@v6
79-
with:
80-
commit-message: 'fix(analyses-snapshot-testing): snapshot failure capture'
81-
title: 'fix(analyses-snapshot-testing): ${{ env.ANALYSIS_REF }} snapshot failure capture'
82-
body: 'This PR is an automated snapshot update request. Please review the changes and merge if they are acceptable or find your bug and fix it.'
107+
- name: Create Snapshot update Request
108+
id: create_pull_request
109+
if: always() && steps.handle_failure.outcome == 'success' && env.OPEN_PR_ON_FAILURE == 'true' && github.event_name == 'pull_request'
110+
uses: peter-evans/create-pull-request@v6
111+
with:
112+
commit-message: 'fix(analyses-snapshot-testing): heal analyses snapshots'
113+
title: 'fix(analyses-snapshot-testing): heal ${{ env.ANALYSIS_REF }} snapshots'
114+
body: 'This PR was requested on the PR https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
83115
branch: 'analyses-snapshot-testing/${{ env.ANALYSIS_REF }}-from-${{ env.SNAPSHOT_REF}}'
84116
base: ${{ env.SNAPSHOT_REF}}
85117

86-
- name: Comment on PR
87-
if: always() && steps.create_pull_request.outcome == 'success' && github.event_name == 'pull_request'
88-
uses: actions/github-script@v7
89-
with:
90-
script: |
91-
const message = 'A PR has been opened to address analyses snapshot changes. Please review the changes here: https://github.com/${{ github.repository }}/pull/${{ steps.create-pull-request.outputs.pull-request-number }}';
92-
github.rest.issues.createComment({
93-
owner: context.repo.owner,
94-
repo: context.repo.repo,
95-
issue_number: context.issue.number,
96-
body: message
97-
});
118+
- name: Comment on feature PR
119+
if: always() && steps.create_pull_request.outcome == 'success' && github.event_name == 'pull_request'
120+
uses: actions/github-script@v7
121+
with:
122+
script: |
123+
const message = 'A PR has been opened to address analyses snapshot changes. Please review the changes here: https://github.com/${{ github.repository }}/pull/${{ steps.create_pull_request.outputs.pull-request-number }}';
124+
github.rest.issues.createComment({
125+
owner: context.repo.owner,
126+
repo: context.repo.repo,
127+
issue_number: context.issue.number,
128+
body: message
129+
});
130+
131+
- name: Create Snapshot update Request on edge overnight failure
132+
if: always() && steps.handle_failure.outcome == 'success' && github.event_name == 'schedule'
133+
uses: peter-evans/create-pull-request@v6
134+
with: # scheduled run uses the default values for ANALYSIS_REF and SNAPSHOT_REF which are edge
135+
commit-message: 'fix(analyses-snapshot-testing): heal ${{ env.ANALYSIS_REF }} snapshots'
136+
title: 'fix(analyses-snapshot-testing): heal ${{ env.ANALYSIS_REF }} snapshots'
137+
body: 'The ${{ env.ANALYSIS_REF }} overnight analyses snapshot test is failing. This PR was opened to alert us to the failure.'
138+
branch: 'analyses-snapshot-testing/${{ env.ANALYSIS_REF }}-from-${{ env.SNAPSHOT_REF}}'
139+
base: ${{ env.SNAPSHOT_REF}}

.github/workflows/app-test-build-deploy.yaml

Lines changed: 67 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -185,28 +185,50 @@ jobs:
185185
echo "both develop builds for edge"
186186
echo 'variants=["release", "internal-release"]' >> $GITHUB_OUTPUT
187187
echo 'type=develop' >> $GITHUB_OUTPUT
188-
elif [ "${{ format('{0}', endsWith(github.ref, 'app-build-internal')) }}" = "true" ] ; then
189-
echo "internal-release builds for app-build-internal suffixes"
188+
elif [ "${{ format('{0}', contains(github.ref, 'app-build-internal')) }}" = "true" ] ; then
189+
190190
echo 'variants=["internal-release"]' >> $GITHUB_OUTPUT
191-
echo 'type=develop' >> $GITHUB_OUTPUT
192-
elif [ "${{ format('{0}', endsWith(github.ref, 'app-build')) }}" = "true" ] ; then
193-
echo "release develop builds for app-build suffixes"
191+
if [ "${{ format('{0}', contains(github.ref, 'as-release')) }}" = "true" ] ; then
192+
echo "internal-release as-release builds for app-build-internal + as-release suffixes"
193+
echo 'type=as-release' >> $GITHUB_OUTPUT
194+
else
195+
echo "internal-release develop builds for app-build-internal suffixes"
196+
echo 'type=develop' >> $GITHUB_OUTPUT
197+
fi
198+
elif [ "${{ format('{0}', contains(github.ref, 'app-build')) }}" = "true" ] ; then
194199
echo 'variants=["release"]' >> $GITHUB_OUTPUT
195-
echo 'type=develop' >> $GITHUB_OUTPUT
196-
elif [ "${{ format('{0}', endsWith(github.ref, 'app-build-both')) }}" = "true" ] ; then
197-
echo "Both develop builds for app-build-both suffixes"
200+
if [ "${{ format('{0}', contains(github.ref, 'as-release')) }}" = "true" ] ; then
201+
echo "release as-release builds for app-build + as-release suffixes"
202+
echo 'type=as-release' >> $GITHUB_OUTPUT
203+
else
204+
echo "release develop builds for app-build suffixes"
205+
echo 'type=develop' >> $GITHUB_OUTPUT
206+
fi
207+
elif [ "${{ format('{0}', contains(github.ref, 'app-build-both')) }}" = "true" ] ; then
208+
198209
echo 'variants=["release", "internal-release"]' >> $GITHUB_OUTPUT
199-
echo 'type=develop' >> $GITHUB_OUTPUT
210+
if [ "${{ format('{0}', contains(github.ref, 'as-release')) }}" = "true" ] ; then
211+
echo "Both as-release builds for app-build-both + as-release suffixes"
212+
echo 'type=as-release' >> $GITHUB_OUTPUT
213+
else
214+
echo "Both develop builds for app-build-both + as-release suffixes"
215+
echo 'type=develop' >> $GITHUB_OUTPUT
216+
fi
200217
else
201218
echo "No build for ref ${{github.ref}} and event ${{github.event_type}}"
202219
echo 'variants=[]' >> $GITHUB_OUTPUT
203220
echo 'type=develop' >> $GITHUB_OUTPUT
204221
fi
205222
223+
- name: set summary
224+
run: |
225+
echo 'Type: ${{steps.determine-build-type.outputs.type}} Variants: ${{steps.determine-build-type.outputs.variants}}' >> $GITHUB_STEP_SUMMARY
226+
206227
build-app:
207228
needs: [determine-build-type]
208229
if: needs.determine-build-type.outputs.variants != '[]'
209230
strategy:
231+
fail-fast: false
210232
matrix:
211233
os: ['windows-2022', 'ubuntu-22.04', 'macos-latest']
212234
variant: ${{fromJSON(needs.determine-build-type.outputs.variants)}}
@@ -277,15 +299,49 @@ jobs:
277299
npm config set cache ${{ github.workspace }}/.npm-cache
278300
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
279301
make setup-js
302+
303+
- name: 'Configure Windows code signing environment'
304+
if: startsWith(matrix.os, 'windows') && contains(needs.determine-build-type.outputs.type, 'release')
305+
shell: bash
306+
run: |
307+
echo "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
308+
echo "${{ secrets.WINDOWS_CSC_B64}}" | base64 --decode > /d/opentrons_labworks_inc.crt
309+
echo "C:\Program Files (x86)\Windows Kits\10\App Certification Kit" >> $GITHUB_PATH
310+
echo "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools" >> $GITHUB_PATH
311+
echo "C:\Program Files\DigiCert\DigiCert Keylocker Tools" >> $GITHUB_PATH
312+
313+
- name: 'Setup Windows code signing helpers'
314+
if: startsWith(matrix.os, 'windows') && contains(needs.determine-build-type.outputs.type, 'release')
315+
shell: cmd
316+
env:
317+
SM_HOST: ${{ secrets.SM_HOST }}
318+
SM_CLIENT_CERT_FILE: "D:\\Certificate_pkcs12.p12"
319+
SM_CLIENT_CERT_PASSWORD: ${{secrets.SM_CLIENT_CERT_PASSWORD}}
320+
SM_API_KEY: ${{secrets.SM_API_KEY}}
321+
run: |
322+
curl -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/Keylockertools-windows-x64.msi/download -H "x-api-key:${{secrets.SM_API_KEY}}" -o Keylockertools-windows-x64.msi
323+
msiexec /i Keylockertools-windows-x64.msi /quiet /qn
324+
smksp_registrar.exe list
325+
smctl.exe keypair ls
326+
C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
327+
smksp_cert_sync.exe
328+
smctl.exe healthcheck --all
329+
280330
# build the desktop app and deploy it
281331
- name: 'build ${{matrix.variant}} app for ${{ matrix.os }}'
282332
if: matrix.target == 'desktop'
283333
timeout-minutes: 60
284334
env:
285335
OT_APP_MIXPANEL_ID: ${{ secrets.OT_APP_MIXPANEL_ID }}
286336
OT_APP_INTERCOM_ID: ${{ secrets.OT_APP_INTERCOM_ID }}
287-
WIN_CSC_LINK: ${{ secrets.OT_APP_CSC_WINDOWS }}
288-
WIN_CSC_KEY_PASSWORD: ${{ secrets.OT_APP_CSC_KEY_WINDOWS }}
337+
WINDOWS_SIGN: ${{ format('{0}', contains(needs.determine-build-type.outputs.type, 'release')) }}
338+
SM_HOST: ${{secrets.SM_HOST}}
339+
SM_CLIENT_CERT_FILE: "D:\\Certificate_pkcs12.p12"
340+
SM_CLIENT_CERT_PASSWORD: ${{secrets.SM_CLIENT_CERT_PASSWORD}}
341+
SM_API_KEY: ${{secrets.SM_API_KEY}}
342+
SM_CODE_SIGNING_CERT_SHA1_HASH: ${{secrets.SM_CODE_SIGNING_CERT_SHA1_HASH}}
343+
SM_KEYPAIR_ALIAS: ${{secrets.SM_KEYPAIR_ALIAS}}
344+
WINDOWS_CSC_FILEPATH: "D:\\opentrons_labworks_inc.crt"
289345
CSC_LINK: ${{ secrets.OT_APP_CSC_MACOS }}
290346
CSC_KEY_PASSWORD: ${{ secrets.OT_APP_CSC_KEY_MACOS }}
291347
APPLE_ID: ${{ secrets.OT_APP_APPLE_ID }}

abr-testing/abr_testing/automation/google_sheets_tool.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ def column_letter_to_index(column_letter: str) -> int:
136136

137137
for col_offset, col_values in enumerate(data):
138138
column_index = start_column_index + col_offset
139-
# column_letter = index_to_column_letter(column_index)
140139
for row_offset, value in enumerate(col_values):
141140
row_index = start_row + row_offset
142141
try:
@@ -163,7 +162,10 @@ def column_letter_to_index(column_letter: str) -> int:
163162
)
164163

165164
body = {"requests": requests}
166-
self.spread_sheet.batch_update(body=body)
165+
try:
166+
self.spread_sheet.batch_update(body=body)
167+
except gspread.exceptions.APIError as e:
168+
print(f"ERROR MESSAGE: {e}")
167169

168170
def update_cell(
169171
self, sheet_title: str, row: int, column: int, single_data: Any

0 commit comments

Comments
 (0)