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

RTW-321: Deprecate two enum choices #188

Merged
merged 4 commits into from
Jul 16, 2024

Conversation

andrejvelichkovski
Copy link
Contributor

@andrejvelichkovski andrejvelichkovski commented Jul 8, 2024

Description

This change deprecates the two following options from the Test Execution Review Decision:

  • Unstable Physical Infrastructure
  • Faulty Hardware

The deprecation is only done on the frontend. To make sure everything is backwards compatible, we will still show the cases where these are selected, but they will be disabled and their selection wont be modifiable.

Resolved issues

RTW-321

Documentation

No documentation changes involved.

Web service API changes

No API changes involved.

Tests

The testing was performed manually. Firstly, we observe the case where one of the options was already selected:

Screenshot from 2024-07-08 10-42-21

We then observe that the choices are not rendered for new test executions

Screenshot from 2024-07-08 10-42-37

@andrejvelichkovski andrejvelichkovski marked this pull request as ready for review July 8, 2024 08:46
@andrejvelichkovski andrejvelichkovski changed the title Deprecate two enum choices RTW-321: Deprecate two enum choices Jul 8, 2024
Comment on lines +132 to +134
case approvedFaultyHardware:
case approvedUnstablePhysicalInfra:
return true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

sorry if I don't know how dart works, but shouldn't it look like this:

Suggested change
case approvedFaultyHardware:
case approvedUnstablePhysicalInfra:
return true;
case approvedFaultyHardware:
return true;
case approvedUnstablePhysicalInfra:
return true;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to the Dart docs the empty case falls through, so in this case the logic for approvedFaultyHardware continues through and executes the same case as approvedUnstablePhysicalInfra.

frontend/lib/ui/artefact_page/test_execution_pop_over.dart Outdated Show resolved Hide resolved
Comment on lines 40 to 44
((testExecutionReviewDecision == TestExecutionReviewDecision.rejected &&
_canReject) ||
(testExecutionReviewDecision !=
TestExecutionReviewDecision.rejected &&
_canApprove))) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you simplify or make this if statement easier to understand somehow? one suggestion is to just create a variable whose name explains ((testExecutionReviewDecision == TestExecutionReviewDecision.rejected && _canReject) || (testExecutionReviewDecision != TestExecutionReviewDecision.rejected && _canApprove))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved the second part in the new variable as suggested, and added a comment that explains what is happening here.

Copy link
Collaborator

@omar-selo omar-selo left a comment

Choose a reason for hiding this comment

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

LGTM!

@andrejvelichkovski andrejvelichkovski merged commit 76289a1 into main Jul 16, 2024
2 of 3 checks passed
@andrejvelichkovski andrejvelichkovski deleted the rtw-321-deprecate-enum-types branch July 16, 2024 11:57
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.

3 participants