You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2022/06/25 23:01:33 UTC

[GitHub] [helix] micahstubbs opened a new pull request, #2168: Add Types for Ideal State, fix Payload Format

micahstubbs opened a new pull request, #2168:
URL: https://github.com/apache/helix/pull/2168

   ### Issues
   
   - [x] My PR addresses the following Helix issues and references them in the PR description:
   
   #2128
   
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI changes:
   
   This PR adds Types for the Ideal State payload and some parsing logic to ensure that the format matches what the helix-rest API expects.
   
   Before:
   
   ```js
   {
     simpleFields: [
       {
         name: "NUM_PARTITIONS",
         value: 2,
       },
     ];
   }
   ```
   
   After:
   
   ```js
   {
     simpleFields: {
       NUM_PARTITIONS: 2;
     }
   }
   ```
   
   
   ### Tests
   
   - [x] The following tests are written for this issue:
   
   No new features.
   
   ### Commits
   
   - [x] My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
   ### Code Quality
   
   - [x] My diff has been formatted using helix-style.xml 
   (helix-style-intellij.xml if IntelliJ IDE is used)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] micahstubbs commented on pull request #2168: Add Types for Ideal State, fix Payload Format

Posted by GitBox <gi...@apache.org>.
micahstubbs commented on PR #2168:
URL: https://github.com/apache/helix/pull/2168#issuecomment-1167850972

   @somecodemonkey this PR is ready for your review. Thanks for sharing your frontend expertise!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] micahstubbs commented on a diff in pull request #2168: Add Types for Ideal State, fix Payload Format

Posted by GitBox <gi...@apache.org>.
micahstubbs commented on code in PR #2168:
URL: https://github.com/apache/helix/pull/2168#discussion_r907767827


##########
helix-front/client/app/core/helix.service.ts:
##########
@@ -29,7 +29,7 @@ export class HelixService {
       .pipe(catchError(this.errorHandler));
   }
 
-  protected post(path: string, data: string): Observable<any> {
+  protected post(path: string, data: any): Observable<any> {

Review Comment:
   Necessary because of this weird behavior that Angular has where it silently ignores stringified JSON. 🤦‍♀️ 
   
   https://stackoverflow.com/a/35874339/1732222



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] micahstubbs commented on a diff in pull request #2168: Add Types for Ideal State, fix Payload Format

Posted by GitBox <gi...@apache.org>.
micahstubbs commented on code in PR #2168:
URL: https://github.com/apache/helix/pull/2168#discussion_r907790586


##########
helix-front/client/app/resource/shared/resource.service.ts:
##########
@@ -114,12 +113,11 @@ export class ResourceService extends HelixService {
   public setIdealState(
     clusterName: string,
     resourceName: string,
-    idealState: Node
+    idealState: IdealState
   ) {
     return this.post(
       `/clusters/${clusterName}/resources/${resourceName}/idealState?command=update`,
-      JSON.stringify(idealState)
+      idealState

Review Comment:
   Necessary because of this weird behavior that Angular has where it silently ignores stringified JSON. 🤦‍♀️
   
   https://stackoverflow.com/a/35874339/1732222



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] micahstubbs commented on pull request #2168: Add Types for Ideal State, fix Payload Format

Posted by GitBox <gi...@apache.org>.
micahstubbs commented on PR #2168:
URL: https://github.com/apache/helix/pull/2168#issuecomment-1168076398

   This PR is ready to be merged, approved by @somecodemonkey       
   Final commit message:
   ## Add Types for Ideal State, fix Payload Format (#2128 )
   This PR adds types for IdealState in helix-front, as well as fixing an associated JSON serialization bug.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] micahstubbs commented on a diff in pull request #2168: Add Types for Ideal State, fix Payload Format

Posted by GitBox <gi...@apache.org>.
micahstubbs commented on code in PR #2168:
URL: https://github.com/apache/helix/pull/2168#discussion_r906733063


##########
helix-front/client/app/resource/shared/resource.service.ts:
##########
@@ -5,8 +5,7 @@ import * as _ from 'lodash';
 
 import { HelixService } from '../../core/helix.service';
 import { Resource } from './resource.model';
-import { Cluster } from '../../cluster/shared/cluster.model';

Review Comment:
   This import was previously unused.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] micahstubbs commented on a diff in pull request #2168: Add Types for Ideal State, fix Payload Format

Posted by GitBox <gi...@apache.org>.
micahstubbs commented on code in PR #2168:
URL: https://github.com/apache/helix/pull/2168#discussion_r907789887


##########
helix-front/client/app/resource/shared/resource.service.ts:
##########
@@ -114,12 +113,11 @@ export class ResourceService extends HelixService {
   public setIdealState(
     clusterName: string,
     resourceName: string,
-    idealState: Node
+    idealState: IdealState
   ) {
     return this.post(
       `/clusters/${clusterName}/resources/${resourceName}/idealState?command=update`,
-      JSON.stringify(idealState)

Review Comment:
   Necessary because of this weird behavior that Angular has where it silently ignores stringified JSON. 🤦‍♀️
   
   https://stackoverflow.com/a/35874339/1732222



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] NealSun96 merged pull request #2168: Add Types for Ideal State, fix Payload Format

Posted by GitBox <gi...@apache.org>.
NealSun96 merged PR #2168:
URL: https://github.com/apache/helix/pull/2168


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] micahstubbs commented on a diff in pull request #2168: Add Types for Ideal State, fix Payload Format

Posted by GitBox <gi...@apache.org>.
micahstubbs commented on code in PR #2168:
URL: https://github.com/apache/helix/pull/2168#discussion_r907769439


##########
helix-front/server/controllers/helix.ts:
##########
@@ -51,6 +51,8 @@ export class HelixCtrl {
       request[method](options, (error, response, body) => {
         if (error) {
           res.status(500).send(error);
+        } else if (body?.error) {
+          res.status(500).send(body?.error);

Review Comment:
   Handle the case where previously this error message would have been silently ignored:
   
   ![Screen Shot 2022-06-27 at 1 25 51 PM](https://user-images.githubusercontent.com/2119400/176029517-baf499e3-1daa-40ca-b819-d5cb2c6b1332.png)
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] micahstubbs commented on pull request #2168: Add Types for Ideal State, fix Payload Format

Posted by GitBox <gi...@apache.org>.
micahstubbs commented on PR #2168:
URL: https://github.com/apache/helix/pull/2168#issuecomment-1167972946

   CI Failure appears to be  a helix-rest issue unrelated to `helix-front`: 
   
   ```
   Error:  Test failed: testAddResources(org.apache.helix.rest.server.TestResourceAccessor)  Time elapsed: 0.166 s  <<< FAILURE!
   ```
   
   https://github.com/apache/helix/runs/7080744905?check_suite_focus=true


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org