Skip to content

Commit

Permalink
Bugfix: Handle deprecated fields to adapt to history versions of plug…
Browse files Browse the repository at this point in the history
…ins (#648)

<!-- Please provide brief information about the PR, what it contains &
its purpose, new behaviors after the change. And let us know here if you
need any help: https://github.com/microsoft/HydraLab/issues/new -->

## Description

<!-- A few words to explain your changes -->

### Linked GitHub issue ID: #  

## Pull Request Checklist
<!-- Put an x in the boxes that apply. This is simply a reminder of what
we are going to look for before merging your code. -->

- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Code compiles correctly with all tests are passed.
- [x] I've read the [contributing
guide](https://github.com/microsoft/HydraLab/blob/main/CONTRIBUTING.md#making-changes-to-the-code)
and followed the recommended practices.
- [ ] [Wikis](https://github.com/microsoft/HydraLab/wiki) or
[README](https://github.com/microsoft/HydraLab/blob/main/README.md) have
been reviewed and added / updated if needed (for bug fixes / features)

### Does this introduce a breaking change?
*If this introduces a breaking change for Hydra Lab users, please
describe the impact and migration path.*

- [x] Yes
- [ ] No

## How you tested it
*Please make sure the change is tested, you can test it by adding UTs,
do local test and share the screenshots, etc.*


Please check the type of change your PR introduces:
- [x] Bugfix
- [ ] Feature
- [ ] Technical design
- [ ] Build related changes
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Code style update (formatting, renaming) or Documentation content
changes
- [ ] Other (please describe): 

### Feature UI screenshots or Technical design diagrams
*If this is a relatively large or complex change, kick it off by drawing
the tech design with PlantUML and explaining why you chose the solution
you did and what alternatives you considered, etc...*
  • Loading branch information
zhou9584 authored Jan 25, 2024
1 parent 33817c5 commit 770432a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,6 @@ public Task getTaskDetail(String id) {
deviceTestResult.setAttachments(attachmentService.getAttachments(deviceTestResult.getId(), EntityType.TEST_RESULT));
deviceTestResult.setTaskResult(taskResultRepository.findByTaskRunId(deviceTestResult.getId()).orElse(null));
}

// for deprecated field
task.getDeviceTestResults().addAll(byTestTaskId);
task.setTestDevicesCount(task.getDeviceCount());
task.setTestErrorMsg(task.getErrorMsg());
return task;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,6 @@ public class Task implements Serializable {
@Transient
private boolean disableRecording = false;

//@Deprecated
@Transient
private List<TestRun> deviceTestResults = new ArrayList<>();

//@Deprecated
@Transient
private int testDevicesCount;

//@Deprecated
@Transient
private String testErrorMsg;

public synchronized void addTestedDeviceResult(TestRun deviceTestResult) {
taskRunList.add(deviceTestResult);
}
Expand Down Expand Up @@ -225,4 +213,18 @@ public interface TriggerType {
String Schedule = "Schedule";
}

@Deprecated
public List<TestRun> getDeviceTestResults() {
return taskRunList;
}

@Deprecated
public int getTestDevicesCount() {
return deviceCount;
}

@Deprecated
public String getTestErrorMsg() {
return errorMsg;
}
}

0 comments on commit 770432a

Please sign in to comment.