User/ujsrivastava/block unblock device test spec#672
Merged
Conversation
added 3 commits
February 18, 2025 16:58
… methods in DeviceAgentManagementService to handle blocking and unblocking a device and releasing any frozen blocked devices
…ame test task. Added block device by specific device Identifier
…eIdentifier is a group. Also changed the name of output variable unblockDeviceSecretKey to UnblockDeviceSecretKey
Collaborator
Author
|
@microsoft-github-policy-service agree company="Microsoft"
@microsoft-github-policy-service agree company="Microsoft" |
zhou9584
reviewed
Feb 24, 2025
center/src/main/java/com/microsoft/hydralab/center/service/TestTaskService.java
Show resolved
Hide resolved
center/src/main/java/com/microsoft/hydralab/center/service/DeviceAgentManagementService.java
Outdated
Show resolved
Hide resolved
|
Please unsubscribe me from your mailing list
…On Mon, Feb 24, 2025 at 1:59 AM Le Zhou ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
center/src/main/java/com/microsoft/hydralab/center/service/TestTaskService.java
<#672 (comment)>:
> relatedIdentifiers.addAll(deviceAgentManagementService.queryDeviceByGroup(deviceIdentifier));
} else {
+ if (deviceAgentManagementService.isDeviceBlocked(deviceIdentifier)) {
+ logger.warn("Device " + deviceIdentifier + " is blocked currently.");
+ return false;
+ }
Here would always return false if pass the blocked device serial, you may
need to add another condition here. Such as check blockDevice
image.png (view on web)
<https://github.com/user-attachments/assets/57ec5840-f708-429c-a891-073684d1f491>
------------------------------
In
center/src/main/java/com/microsoft/hydralab/center/service/DeviceAgentManagementService.java
<#672 (comment)>:
> @@ -957,23 +978,34 @@ private JSONObject runTestTaskByGroup(TestTaskSpec testTaskSpec) {
}
private JSONObject runTestTaskByDevice(TestTaskSpec testTaskSpec) {
+ if (testTaskSpec.unblockDevice) {
If the user wants to block the device and then run 3 tasks, an error
will occur. Secret detection and unlocking the device should be separated.
—
Reply to this email directly, view it on GitHub
<#672 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADU3GOU7A7DZ5ZOPM47MRZD2RLGPHAVCNFSM6AAAAABXNXDAPCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMMZWGE4TMOJTGI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
|
same here - please unsubscribe me from your mailing list.
…On Mon, Feb 24, 2025 at 5:07 PM Srikar ***@***.***> wrote:
Please unsubscribe me from your mailing list <br> <br> On Mon, Feb 24,
2025 at 1:59 AM Le Zhou ***@***.***> wrote: <br> <br> > ***@***.****
commented on this pull request. <br> > ------------------------------
<br> > <br> > In <br> >
center/src/main/java/com/microsoft/hydralab/center/service/TestTaskService.java
<br> > <
#672 (comment)>:
<br> > <br> > >
relatedIdentifiers.addAll(deviceAgentManagementService.queryDeviceByGroup(deviceIdentifier));
<br> > } else { <br> > + if
(deviceAgentManagementService.isDeviceBlocked(deviceIdentifier)) { <br>
> + logger.warn("Device " + deviceIdentifier + " is
blocked currently."); <br> > + return false; <br> > + } <br>
> <br> > Here would always return false if pass the blocked device
serial, you may <br> > need to add another condition here. Such as check
blockDevice <br> > image.png (view on web) <br> > <
https://github.com/user-attachments/assets/57ec5840-f708-429c-a891-073684d1f491>
<br> > ------------------------------ <br> > <br> > In <br> >
center/src/main/java/com/microsoft/hydralab/center/service/DeviceAgentManagementService.java
<br> > <
#672 (comment)>:
<br> > <br> > > @@ -957,23 +978,34 @@ private JSONObject
runTestTaskByGroup(TestTaskSpec testTaskSpec) { <br> > } <br> > <br>
> private JSONObject runTestTaskByDevice(TestTaskSpec testTaskSpec) {
<br> > + if (testTaskSpec.unblockDevice) { <br> > <br> > If the
user wants to block the device and then run 3 tasks, an error <br> >
will occur. Secret detection and unlocking the device should be separated.
<br> > <br> > — <br> > Reply to this email directly, view it on
GitHub <br> > <
#672 (review)>,
<br> > or unsubscribe <br> > <
https://github.com/notifications/unsubscribe-auth/ADU3GOU7A7DZ5ZOPM47MRZD2RLGPHAVCNFSM6AAAAABXNXDAPCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMMZWGE4TMOJTGI>
<br> > . <br> > You are receiving this because you are subscribed to
this thread.Message <br> > ID: ***@***.***> <br> > <br>
—
Reply to this email directly, view it on GitHub
<#672 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACLJZCAZYTYHKY36STBLCKT2RMRSJAVCNFSM6AAAAABXNXDAPCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZYGQ4TQMBRHE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
[image: rakirs2]*rakirs2* left a comment (microsoft/HydraLab#672)
<#672 (comment)>
Please unsubscribe me from your mailing list <br> <br> On Mon, Feb 24,
2025 at 1:59 AM Le Zhou ***@***.***> wrote: <br> <br> > ***@***.****
commented on this pull request. <br> > ------------------------------
<br> > <br> > In <br> >
center/src/main/java/com/microsoft/hydralab/center/service/TestTaskService.java
<br> > <
#672 (comment)>:
<br> > <br> > >
relatedIdentifiers.addAll(deviceAgentManagementService.queryDeviceByGroup(deviceIdentifier));
<br> > } else { <br> > + if
(deviceAgentManagementService.isDeviceBlocked(deviceIdentifier)) { <br>
> + logger.warn("Device " + deviceIdentifier + " is
blocked currently."); <br> > + return false; <br> > + } <br>
> <br> > Here would always return false if pass the blocked device
serial, you may <br> > need to add another condition here. Such as check
blockDevice <br> > image.png (view on web) <br> > <
https://github.com/user-attachments/assets/57ec5840-f708-429c-a891-073684d1f491>
<br> > ------------------------------ <br> > <br> > In <br> >
center/src/main/java/com/microsoft/hydralab/center/service/DeviceAgentManagementService.java
<br> > <
#672 (comment)>:
<br> > <br> > > @@ -957,23 +978,34 @@ private JSONObject
runTestTaskByGroup(TestTaskSpec testTaskSpec) { <br> > } <br> > <br>
> private JSONObject runTestTaskByDevice(TestTaskSpec testTaskSpec) {
<br> > + if (testTaskSpec.unblockDevice) { <br> > <br> > If the
user wants to block the device and then run 3 tasks, an error <br> >
will occur. Secret detection and unlocking the device should be separated.
<br> > <br> > — <br> > Reply to this email directly, view it on
GitHub <br> > <
#672 (review)>,
<br> > or unsubscribe <br> > <
https://github.com/notifications/unsubscribe-auth/ADU3GOU7A7DZ5ZOPM47MRZD2RLGPHAVCNFSM6AAAAABXNXDAPCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMMZWGE4TMOJTGI>
<br> > . <br> > You are receiving this because you are subscribed to
this thread.Message <br> > ID: ***@***.***> <br> > <br>
—
Reply to this email directly, view it on GitHub
<#672 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACLJZCAZYTYHKY36STBLCKT2RMRSJAVCNFSM6AAAAABXNXDAPCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZYGQ4TQMBRHE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
|
Repo owners: Please figure out how to set up notifications properly and stop sending notifications. |
|
Same for me
…On Mon, 24 Feb 2025 at 15:14, girmaw ***@***.***> wrote:
same here - please unsubscribe me from your mailing list. <br> <br> On
Mon, Feb 24, 2025 at 5:07 PM Srikar ***@***.***> wrote: <br> <br> >
Please unsubscribe me from your mailing list <br> <br> On Mon,
Feb 24, <br> > 2025 at 1:59 AM Le Zhou ***@***.***&gt; wrote:
<br> <br> &gt; ***@***.**** <br> > commented on this
pull request. <br> &gt; ------------------------------ <br> >
<br> &gt; <br> &gt; In <br> &gt; <br> >
center/src/main/java/com/microsoft/hydralab/center/service/TestTaskService.java
<br> > <br> &gt; &lt; <br> >
#672 (comment)&gt;:
<br> > <br> &gt; <br> &gt; &gt; <br> >
relatedIdentifiers.addAll(deviceAgentManagementService.queryDeviceByGroup(deviceIdentifier));
<br> > <br> &gt; } else { <br> &gt; + if <br> >
(deviceAgentManagementService.isDeviceBlocked(deviceIdentifier)) {
<br> <br> > &gt; + logger.warn(&quot;Device &quot; +
deviceIdentifier + &quot; is <br> > blocked currently.&quot;);
<br> &gt; + return false; <br> &gt; + } <br> <br>
> &gt; <br> &gt; Here would always return false if pass
the blocked device <br> > serial, you may <br> &gt; need to
add another condition here. Such as check <br> > blockDevice <br>
&gt; image.png (view on web) <br> &gt; &lt; <br> >
https://github.com/user-attachments/assets/57ec5840-f708-429c-a891-073684d1f491&gt;
<br> > <br> &gt; ------------------------------ <br>
&gt; <br> &gt; In <br> &gt; <br> >
center/src/main/java/com/microsoft/hydralab/center/service/DeviceAgentManagementService.java
<br> > <br> &gt; &lt; <br> >
#672 (comment)&gt;:
<br> > <br> &gt; <br> &gt; &gt; @@ -957,23
+978,34 @@ private JSONObject <br> > runTestTaskByGroup(TestTaskSpec
testTaskSpec) { <br> &gt; } <br> &gt; <br> <br>
> &gt; private JSONObject runTestTaskByDevice(TestTaskSpec
testTaskSpec) { <br> > <br> &gt; + if
(testTaskSpec.unblockDevice) { <br> &gt; <br> &gt; If
the <br> > user wants to block the device and then run 3 tasks, an
error <br> &gt; <br> > will occur. Secret detection and
unlocking the device should be separated. <br> > <br> &gt;
<br> &gt; — <br> &gt; Reply to this email directly,
view it on <br> > GitHub <br> &gt; &lt; <br> >
#672 (review)&gt;,
<br> > <br> &gt; or unsubscribe <br> &gt; &lt;
<br> >
https://github.com/notifications/unsubscribe-auth/ADU3GOU7A7DZ5ZOPM47MRZD2RLGPHAVCNFSM6AAAAABXNXDAPCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMMZWGE4TMOJTGI&gt;
<br> > <br> &gt; . <br> &gt; You are receiving this
because you are subscribed to <br> > this thread.Message <br>
&gt; ID: ***@***.***&gt; <br> &gt; <br> <br> >
<br> > — <br> > Reply to this email directly, view it on GitHub <br>
> <
#672 (comment)>,
<br> > or unsubscribe <br> > <
https://github.com/notifications/unsubscribe-auth/ACLJZCAZYTYHKY36STBLCKT2RMRSJAVCNFSM6AAAAABXNXDAPCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZYGQ4TQMBRHE>
<br> > . <br> > You are receiving this because you are subscribed to
this thread.Message <br> > ID: ***@***.***> <br> > [image:
rakirs2]*rakirs2* left a comment (microsoft/HydraLab#672) <br> > <
#672 (comment)>
<br> > Please unsubscribe me from your mailing list <br>
<br> On Mon, Feb 24, <br> > 2025 at 1:59 AM Le Zhou
***@***.***&gt; wrote: <br> <br> &gt; ***@***.**** <br>
> commented on this pull request. <br> &gt;
------------------------------ <br> > <br> &gt; <br>
&gt; In <br> &gt; <br> >
center/src/main/java/com/microsoft/hydralab/center/service/TestTaskService.java
<br> > <br> &gt; &lt; <br> >
#672 (comment)&gt;:
<br> > <br> &gt; <br> &gt; &gt; <br> >
relatedIdentifiers.addAll(deviceAgentManagementService.queryDeviceByGroup(deviceIdentifier));
<br> > <br> &gt; } else { <br> &gt; + if <br> >
(deviceAgentManagementService.isDeviceBlocked(deviceIdentifier)) {
<br> <br> > &gt; + logger.warn(&quot;Device &quot; +
deviceIdentifier + &quot; is <br> > blocked currently.&quot;);
<br> &gt; + return false; <br> &gt; + } <br> <br>
> &gt; <br> &gt; Here would always return false if pass
the blocked device <br> > serial, you may <br> &gt; need to
add another condition here. Such as check <br> > blockDevice <br>
&gt; image.png (view on web) <br> &gt; &lt; <br> >
https://github.com/user-attachments/assets/57ec5840-f708-429c-a891-073684d1f491&gt;
<br> > <br> &gt; ------------------------------ <br>
&gt; <br> &gt; In <br> &gt; <br> >
center/src/main/java/com/microsoft/hydralab/center/service/DeviceAgentManagementService.java
<br> > <br> &gt; &lt; <br> >
#672 (comment)&gt;:
<br> > <br> &gt; <br> &gt; &gt; @@ -957,23
+978,34 @@ private JSONObject <br> > runTestTaskByGroup(TestTaskSpec
testTaskSpec) { <br> &gt; } <br> &gt; <br> <br>
> &gt; private JSONObject runTestTaskByDevice(TestTaskSpec
testTaskSpec) { <br> > <br> &gt; + if
(testTaskSpec.unblockDevice) { <br> &gt; <br> &gt; If
the <br> > user wants to block the device and then run 3 tasks, an
error <br> &gt; <br> > will occur. Secret detection and
unlocking the device should be separated. <br> > <br> &gt;
<br> &gt; — <br> &gt; Reply to this email directly,
view it on <br> > GitHub <br> &gt; &lt; <br> >
#672 (review)&gt;,
<br> > <br> &gt; or unsubscribe <br> &gt; &lt;
<br> >
https://github.com/notifications/unsubscribe-auth/ADU3GOU7A7DZ5ZOPM47MRZD2RLGPHAVCNFSM6AAAAABXNXDAPCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMMZWGE4TMOJTGI&gt;
<br> > <br> &gt; . <br> &gt; You are receiving this
because you are subscribed to <br> > this thread.Message <br>
&gt; ID: ***@***.***&gt; <br> &gt; <br> <br> >
<br> > — <br> > Reply to this email directly, view it on GitHub <br>
> <
#672 (comment)>,
<br> > or unsubscribe <br> > <
https://github.com/notifications/unsubscribe-auth/ACLJZCAZYTYHKY36STBLCKT2RMRSJAVCNFSM6AAAAABXNXDAPCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZYGQ4TQMBRHE>
<br> > . <br> > You are receiving this because you are subscribed to
this thread.Message <br> > ID: ***@***.***> <br> > <br>
—
Reply to this email directly, view it on GitHub
<#672 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJIQGE2B27ID4TNSWJRWMT2RMSNJAVCNFSM6AAAAABXNXDAPCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZYGUZDQMRUGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
[image: girmaw]*girmaw* left a comment (microsoft/HydraLab#672)
<#672 (comment)>
same here - please unsubscribe me from your mailing list. <br> <br> On
Mon, Feb 24, 2025 at 5:07 PM Srikar ***@***.***> wrote: <br> <br> >
Please unsubscribe me from your mailing list <br> <br> On Mon,
Feb 24, <br> > 2025 at 1:59 AM Le Zhou ***@***.***&gt; wrote:
<br> <br> &gt; ***@***.**** <br> > commented on this
pull request. <br> &gt; ------------------------------ <br> >
<br> &gt; <br> &gt; In <br> &gt; <br> >
center/src/main/java/com/microsoft/hydralab/center/service/TestTaskService.java
<br> > <br> &gt; &lt; <br> >
#672 (comment)&gt;:
<br> > <br> &gt; <br> &gt; &gt; <br> >
relatedIdentifiers.addAll(deviceAgentManagementService.queryDeviceByGroup(deviceIdentifier));
<br> > <br> &gt; } else { <br> &gt; + if <br> >
(deviceAgentManagementService.isDeviceBlocked(deviceIdentifier)) {
<br> <br> > &gt; + logger.warn(&quot;Device &quot; +
deviceIdentifier + &quot; is <br> > blocked currently.&quot;);
<br> &gt; + return false; <br> &gt; + } <br> <br>
> &gt; <br> &gt; Here would always return false if pass
the blocked device <br> > serial, you may <br> &gt; need to
add another condition here. Such as check <br> > blockDevice <br>
&gt; image.png (view on web) <br> &gt; &lt; <br> >
https://github.com/user-attachments/assets/57ec5840-f708-429c-a891-073684d1f491&gt;
<br> > <br> &gt; ------------------------------ <br>
&gt; <br> &gt; In <br> &gt; <br> >
center/src/main/java/com/microsoft/hydralab/center/service/DeviceAgentManagementService.java
<br> > <br> &gt; &lt; <br> >
#672 (comment)&gt;:
<br> > <br> &gt; <br> &gt; &gt; @@ -957,23
+978,34 @@ private JSONObject <br> > runTestTaskByGroup(TestTaskSpec
testTaskSpec) { <br> &gt; } <br> &gt; <br> <br>
> &gt; private JSONObject runTestTaskByDevice(TestTaskSpec
testTaskSpec) { <br> > <br> &gt; + if
(testTaskSpec.unblockDevice) { <br> &gt; <br> &gt; If
the <br> > user wants to block the device and then run 3 tasks, an
error <br> &gt; <br> > will occur. Secret detection and
unlocking the device should be separated. <br> > <br> &gt;
<br> &gt; — <br> &gt; Reply to this email directly,
view it on <br> > GitHub <br> &gt; &lt; <br> >
#672 (review)&gt;,
<br> > <br> &gt; or unsubscribe <br> &gt; &lt;
<br> >
https://github.com/notifications/unsubscribe-auth/ADU3GOU7A7DZ5ZOPM47MRZD2RLGPHAVCNFSM6AAAAABXNXDAPCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMMZWGE4TMOJTGI&gt;
<br> > <br> &gt; . <br> &gt; You are receiving this
because you are subscribed to <br> > this thread.Message <br>
&gt; ID: ***@***.***&gt; <br> &gt; <br> <br> >
<br> > — <br> > Reply to this email directly, view it on GitHub <br>
> <
#672 (comment)>,
<br> > or unsubscribe <br> > <
https://github.com/notifications/unsubscribe-auth/ACLJZCAZYTYHKY36STBLCKT2RMRSJAVCNFSM6AAAAABXNXDAPCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZYGQ4TQMBRHE>
<br> > . <br> > You are receiving this because you are subscribed to
this thread.Message <br> > ID: ***@***.***> <br> > [image:
rakirs2]*rakirs2* left a comment (microsoft/HydraLab#672) <br> > <
#672 (comment)>
<br> > Please unsubscribe me from your mailing list <br>
<br> On Mon, Feb 24, <br> > 2025 at 1:59 AM Le Zhou
***@***.***&gt; wrote: <br> <br> &gt; ***@***.**** <br>
> commented on this pull request. <br> &gt;
------------------------------ <br> > <br> &gt; <br>
&gt; In <br> &gt; <br> >
center/src/main/java/com/microsoft/hydralab/center/service/TestTaskService.java
<br> > <br> &gt; &lt; <br> >
#672 (comment)&gt;:
<br> > <br> &gt; <br> &gt; &gt; <br> >
relatedIdentifiers.addAll(deviceAgentManagementService.queryDeviceByGroup(deviceIdentifier));
<br> > <br> &gt; } else { <br> &gt; + if <br> >
(deviceAgentManagementService.isDeviceBlocked(deviceIdentifier)) {
<br> <br> > &gt; + logger.warn(&quot;Device &quot; +
deviceIdentifier + &quot; is <br> > blocked currently.&quot;);
<br> &gt; + return false; <br> &gt; + } <br> <br>
> &gt; <br> &gt; Here would always return false if pass
the blocked device <br> > serial, you may <br> &gt; need to
add another condition here. Such as check <br> > blockDevice <br>
&gt; image.png (view on web) <br> &gt; &lt; <br> >
https://github.com/user-attachments/assets/57ec5840-f708-429c-a891-073684d1f491&gt;
<br> > <br> &gt; ------------------------------ <br>
&gt; <br> &gt; In <br> &gt; <br> >
center/src/main/java/com/microsoft/hydralab/center/service/DeviceAgentManagementService.java
<br> > <br> &gt; &lt; <br> >
#672 (comment)&gt;:
<br> > <br> &gt; <br> &gt; &gt; @@ -957,23
+978,34 @@ private JSONObject <br> > runTestTaskByGroup(TestTaskSpec
testTaskSpec) { <br> &gt; } <br> &gt; <br> <br>
> &gt; private JSONObject runTestTaskByDevice(TestTaskSpec
testTaskSpec) { <br> > <br> &gt; + if
(testTaskSpec.unblockDevice) { <br> &gt; <br> &gt; If
the <br> > user wants to block the device and then run 3 tasks, an
error <br> &gt; <br> > will occur. Secret detection and
unlocking the device should be separated. <br> > <br> &gt;
<br> &gt; — <br> &gt; Reply to this email directly,
view it on <br> > GitHub <br> &gt; &lt; <br> >
#672 (review)&gt;,
<br> > <br> &gt; or unsubscribe <br> &gt; &lt;
<br> >
https://github.com/notifications/unsubscribe-auth/ADU3GOU7A7DZ5ZOPM47MRZD2RLGPHAVCNFSM6AAAAABXNXDAPCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMMZWGE4TMOJTGI&gt;
<br> > <br> &gt; . <br> &gt; You are receiving this
because you are subscribed to <br> > this thread.Message <br>
&gt; ID: ***@***.***&gt; <br> &gt; <br> <br> >
<br> > — <br> > Reply to this email directly, view it on GitHub <br>
> <
#672 (comment)>,
<br> > or unsubscribe <br> > <
https://github.com/notifications/unsubscribe-auth/ACLJZCAZYTYHKY36STBLCKT2RMRSJAVCNFSM6AAAAABXNXDAPCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZYGQ4TQMBRHE>
<br> > . <br> > You are receiving this because you are subscribed to
this thread.Message <br> > ID: ***@***.***> <br> > <br>
—
Reply to this email directly, view it on GitHub
<#672 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJIQGE2B27ID4TNSWJRWMT2RMSNJAVCNFSM6AAAAABXNXDAPCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZYGUZDQMRUGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
…de the unblockDeviceSecretKey along with the device serial number to run a task on the blocked device with the specific device serial number.
…e blocked device itself if that task blocks that device earlier.
zhou9584
reviewed
Feb 27, 2025
center/src/main/java/com/microsoft/hydralab/center/service/DeviceAgentManagementService.java
Show resolved
Hide resolved
olivershen-wow
previously approved these changes
Feb 27, 2025
Contributor
olivershen-wow
left a comment
There was a problem hiding this comment.
LGTM for the plugin part.
zhou9584
approved these changes
Mar 3, 2025
olivershen-wow
approved these changes
Mar 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
This Pull Request adds two properties to the requestHydraLabTest test configuation for blocking and unblocking a device on which the test runs.
Blocking a device by a task
Input:
A boolean property blockDevice needs to be provided in the requestHydraLabTest Gradle task input. When it is passed as true, the deviceIdentifier passed in the task is blocked as follows:
Output:
Unblocking a device by a task
Input:
A boolean property unblockDevice and unblockDeviceSecretKey needs to be provided in the requestHydraLabTest Gradle task input. When the unblockDevice is passed as true and unblockDeviceSecretKey is not empty , then the deviceIdentifier passed in the task is unblocked as follows:
Unblocking frozen blocked devices
Automatically unblocking of the devices which have been blocked for more than 4 hours. The default time for unblocking a device is taken as 4 hours for now.
Usecase
This is useful in cases when you want to run multiple tasks on the same device one after the other.
typeSpecificParamCheck
Added the following type specific param check for runningType INSTRUMENTATION:
Linked GitHub issue ID: #673
Pull Request Checklist
Does this introduce a breaking change?
If this introduces a breaking change for Hydra Lab users, please describe the impact and migration path.
How you tested it
Tested it on the center side by sending a POST api
api/test/task/runwith required parameters. It successfully blocks and unblocks the device successfully. This can be validated from the test task id as well. Here are the screenshots of the same.Blocking:

Unblocking:

Run task on a blocked device again:

Blocking unblocking in the same test task should throw Exception:

Unblocking a device but no/empty secret key passed to unblock the device should throw exception:

Unblocking a device but deviceIdentifier of a group is passed should throw exception:

Please check the type of change your PR introduces:
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...