Skip to content

Conversation

@GabrielBrascher
Copy link
Member

@GabrielBrascher GabrielBrascher commented Dec 10, 2018

Description

This PR addresses reviewers from PR #1597. If approved we can then close PR #1597.

Fixes: #1597

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Screenshots (if appropriate):

How Has This Been Tested?

@GabrielBrascher GabrielBrascher force-pushed the address-abandoned-pr-1597 branch 4 times, most recently from 8de4362 to 58a7a6a Compare December 11, 2018 16:12
@GabrielBrascher GabrielBrascher force-pushed the address-abandoned-pr-1597 branch from 58a7a6a to fd3945b Compare December 11, 2018 18:39
@rafaelweingartner
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

@rafaelweingartner a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2487

private static final String TOKEN = "token";

public static Map<String, String> getQueryMap(String query) {
String[] params = query.split("&");
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way to parse URL (possibly a get request) to get the key/value map of params?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, there is, thanks for pointing that!
I will ping you when update it (also extracting some lines to methods, bringing some test cases, and documenting).

@rohityadavcloud
Copy link
Member

@GabrielBrascher you can now package and kick tests yourself to help you with your 4.12 RM work
@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2512

@rohityadavcloud
Copy link
Member

@blueorangutan test

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@GabrielBrascher
Copy link
Member Author

Thanks, @rhtyd! I am going to update this PR soon, addressing your review, just missing a few test cases.

@blueorangutan
Copy link

Trillian test result (tid-3296)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 23742 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3091-t3296-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_multipleips_per_nic.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Smoke tests completed. 68 look OK, 2 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_nic_secondaryip_add_remove Error 32.91 test_multipleips_per_nic.py
test_04_rvpc_network_garbage_collector_nics Failure 500.25 test_vpc_redundant.py

for (String param : params) {
String[] paramTokens = param.split("=");
String[] paramTokens = param.split(EQUALS);
if (paramTokens != null && paramTokens.length == 2) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@GabrielBrascher can you change this line to this "If (ArrayUtils.isNotEmpty(paramTokens) && paramTokens.length == 2)"?

public static Map<String, String> getQueryMap(String query) {
String[] params = query.split("&");
String[] params = query.split(AND);
Map<String, String> map = new HashMap<String, String>();
Copy link
Contributor

Choose a reason for hiding this comment

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

This variable should be named "tokenMap" or something similar to show that it should only store a token key-value item.

This will save computation by getting rid of the guardUserInput(map) call in Line #59

String value = param.split("=")[1];
String name = paramTokens[0];
String value = paramTokens[1];
map.put(name, value);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think another "if n(name.equalsIgnoreCase(TOKEN)" is needed here considering that the map should only contain a "TOKEN" key. and then remove "guardUserInput(map)" call in line 59

s_logger.error("Unable to decode token");
s_logger.error("Unable to decode token due to null console proxy client param");
}
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

This else statement seems redundant and can go if the tokenMap only contains 1 TOKEN item

Copy link
Contributor

@dhlaluku dhlaluku left a comment

Choose a reason for hiding this comment

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

@GabrielBrascher overall nice code refactoring. I left some suggestions for further code refactors

@GabrielBrascher
Copy link
Member Author

Thanks, @dhlaluku! I appreciate the review and I will ping you when updating the code.

@GabrielBrascher GabrielBrascher modified the milestones: 4.12.0.0, 5.0.0.0 Jan 30, 2019
@rohityadavcloud rohityadavcloud removed this from the 4.13.0.0 milestone May 27, 2019
@rohityadavcloud
Copy link
Member

ping @GabrielBrascher is this PR abandoned or you still plan to submit changes?

@GabrielBrascher
Copy link
Member Author

@rhtyd thanks for pinging, I will take a look at this PR.

@rohityadavcloud rohityadavcloud added this to the 4.13.0.0 milestone May 27, 2019
@rohityadavcloud
Copy link
Member

ping @GabrielBrascher

@GabrielBrascher GabrielBrascher modified the milestones: 4.13.0.0, 4.14.0.0 Jun 24, 2019
@GabrielBrascher
Copy link
Member Author

Thanks for pointing this PR @rhtyd. I am removing the 4.13.0.0 milestone as it is not critical, I will get back on this one on the future.

@andrijapanicsb
Copy link
Contributor

ping @GabrielBrascher any plans with this one, or should we move it to 4.15 milestone?

@GabrielBrascher
Copy link
Member Author

@andrijapanicsb I will close this one for now. I shall get back to it when having some free time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants