Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): skip command key hash generation only if command intent is SETUP #15020

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

sanni-t
Copy link
Member

@sanni-t sanni-t commented Apr 26, 2024

Fixes RQA-2640

Overview

In a previous PR we made a change from skipping hash generation if CommandCreate.intent == CommandIntent.SETUP to if CommandCreate.intent != CommandIntent.PROTOCOL. But a command can have a null intent when it is a protocol command; we only expect setup commands to have an explicit SETUP intent. So we were accidentally skipping key hash generation for python protocols, which was resulting in the app not being able to match run commands with their analysis counterparts.

This PR fixes that and also adds an integration test so we don't accidentally break this functionality again.

Review requests

  • want to make sure that there wasn't an important reason for making the original change that I'm missing. But since all tests are still passing I'm guessing there wasn't any functional change that required a change in the original if statement.

Risk assessment

Low. Bug fix.

@sanni-t sanni-t requested review from a team as code owners April 26, 2024 05:04
@y3rsh y3rsh changed the base branch from edge to [email protected] April 26, 2024 10:41
@y3rsh y3rsh requested a review from a team as a code owner April 26, 2024 10:41
@y3rsh y3rsh requested review from b-cooper and removed request for a team April 26, 2024 10:41
@y3rsh y3rsh changed the base branch from [email protected] to edge April 26, 2024 10:41
Copy link
Member

@y3rsh y3rsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good test.
I verified this works on the robot.
ODD and app steps now displaying commands as expected.
image

I made a copy of this to cut an alpha
#15022

y3rsh added a commit that referenced this pull request Apr 26, 2024
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, great. in a followup we should make this always be present I think

@@ -28,7 +28,7 @@ def hash_protocol_command_params(
The command hash, if the command is a protocol command.
`None` if the command is a setup command.
"""
if create.intent != CommandIntent.PROTOCOL:
if create.intent == CommandIntent.SETUP:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sfoster1 this should check for FIXIT commands as well

@@ -28,7 +28,7 @@ def hash_protocol_command_params(
The command hash, if the command is a protocol command.
`None` if the command is a setup command.
"""
if create.intent != CommandIntent.PROTOCOL:
if create.intent == CommandIntent.SETUP:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if create.intent == CommandIntent.SETUP:
if create.intent in [CommandIntent.SETUP, CommandIntent.FIXIT]:

@y3rsh y3rsh merged commit dcd2666 into edge Apr 26, 2024
27 checks passed
@y3rsh y3rsh deleted the RQA-2640-fix-live-run-preview branch April 26, 2024 13:48
Carlos-fernandez pushed a commit that referenced this pull request May 20, 2024
…SETUP (#15020)

Fixes RQA-2640

# Overview

In a previous PR we made a change from skipping hash generation if
`CommandCreate.intent == CommandIntent.SETUP` to if
`CommandCreate.intent != CommandIntent.PROTOCOL`. But a command can have
a null intent when it is a protocol command; we only expect setup
commands to have an explicit SETUP intent. So we were accidentally
skipping key hash generation for python protocols, which was resulting
in the app not being able to match run commands with their analysis
counterparts.

This PR fixes that and also adds an integration test so we don't
accidentally break this functionality again.

# Review requests

- want to make sure that there wasn't an important reason for making the
original change that I'm missing. But since all tests are still passing
I'm guessing there wasn't any functional change that required a change
in the original `if` statement.

# Risk assessment

Low. Bug fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants