bcgov / ols-router

BC Advanced Route Planner
https://bcgov.github.io/ols-router/
Apache License 2.0
23 stars 11 forks source link

Admin App Import does not work. #322

Open dkelsey opened 3 years ago

dkelsey commented 3 years ago

Describe the bug

I used the Import feature to import a revised configuration.
The import claims it is successful. When I review the parameters I see that nothing has changed.

Note:

To Reproduce

Steps to reproduce the behavior:

${TEST_ADMIN_ENDPOINT} - the url for the Admin App Endpoint in TEST ${DEV_ADMIN_ENDPOINT} - the url for the Admin App Endpoint in DEV

  1. export a configuration from another environment.
    curl -s https://${TEST_ADMIN_ENDPOINT}/int/export >ols-router-data.config.json
  2. Modify the output file in some way so that you can confirm the import succeeds I change the dataSource.baseFileUrl to something like 'this is a test'
  3. import the configuration
    curl -X POST https://${DEV_ADMIN_ENDPONT}/int/import -F file=@ols-router-data.config.json

Response:

<!DOCTYPE html>
<html>
  <head>
    <title>OLS Router Admin</title>
    <link href="css/styles.css" rel="stylesheet" type="text/css" />
  </head>
  <body>
    <div class="body">
      <div class="sideBar">
        <div class="sideNav">
          <div class="sideMenu">
            <div class="title">OLS Router Admin</a></div>
            <ul>
              <li><a href="params.jsp">Parameter Defaults</a></li>
              <li><a href="import_export.jsp">Import/Export</a></li>
              <li><a href="help.jsp">Administration Help</a></li>
            </ul>
          </div>
        </div>
      </div>
      <div class="bodyContainer">
<div class="bodyContent">
<h1>Import Configuration</h1>

  <h2>Import Successful</h2>

    <p><strong>Messages</strong></p>
    <ul>

    </ul>

</div>

      </div>
    </div>
  </body>
Screen Shot 2021-09-01 at 3 01 13 PM
  1. I review the parameters in the UI and do not see my change or any other changes. Screen Shot 2021-09-01 at 3 01 29 PM

Additional Context:

cmhodgson commented 3 years ago

This bug is actually in the ols-util code, and I believe it was fixed for geocoder last year, perhaps by this commit: https://github.com/bcgov/ols-util/pull/12/commits/c5123427f2919cb852168af0653408e2c98f87e0

We haven't tested/delivered a new version of router since then, so the new version of ols-util has not been included in the router yet. You could make this change in the POM but it will require testing as there are other changes to the ols-util that have not been tested in the router.