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

HPCC4J-631 Provide meaningful version error message #741

Merged

Conversation

rpastrana
Copy link
Member

@rpastrana rpastrana commented Aug 23, 2024

  • Ensures version response is not HTML based
  • Adds relevant message to parsing errors

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change is a breaking change (fix or feature that will cause existing behavior to change).

Checklist:

  • I have created a corresponding JIRA ticket for this submission
  • My code follows the code style of this project.
    • I have applied the Eclipse code-format template provided.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the HPCC Systems CONTRIBUTORS document (https://github.com/hpcc-systems/HPCC-Platform/wiki/Guide-for-contributors).
  • The change has been fully tested:
    • This change does not cause any existing JUnits to fail.
    • I have include JUnit coverage to test this change
    • I have performed system test and covered possible regressions and side effects.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Premature optimization
    • This change fixes the problem, not just the symptom

Testing:

@rpastrana rpastrana requested a review from jpmcmu August 23, 2024 15:49
@rpastrana
Copy link
Member Author

we might need to add a test without credentials which would cause the ESP to respond w/ HTML, but it would require a known secured HPCC test environment

Copy link

Jira Issue: https://hpccsystems.atlassian.net/browse/HPCC4J-631

Jirabot Action Result:
Workflow Transition To: Merge Pending
Updated PR

Copy link
Contributor

@jpmcmu jpmcmu left a comment

Choose a reason for hiding this comment

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

@rpastrana Looks pretty good, minor question about handling whitespace, but not critical IMO


if (response == null || response.isEmpty())
throw new Exception("Cannot get target HPCC build version, received empty " + wsconn.getBaseUrl() + " wssmc/activity response");

if (response.startsWith("<html")) //crude, but can prevent wasteful overhead
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this handle possible whitespace before the html tag?

- Ensures version response is not HTML based
- Adds relevant message to parsing errors

Signed-off-by: Rodrigo Pastrana <[email protected]>
@rpastrana
Copy link
Member Author

@jpmcmu made the change we discussed, please give it a quick look-over

Copy link
Contributor

@jpmcmu jpmcmu left a comment

Choose a reason for hiding this comment

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

@rpastrana looks good

@rpastrana rpastrana merged commit f989a40 into hpcc-systems:candidate-9.6.x Aug 27, 2024
4 of 6 checks passed
Copy link

Jirabot Action Result:
Added fix version: 9.6.44
Added fix version: 9.8.18
Workflow Transition: 'Resolve issue'

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.

2 participants