| Age | Commit message (Collapse) | Author | 
|---|
|  |  | 
|  |  | 
|  | af83/6884-tomtom-matrix--handle-error-when-response-doesn,t-inclu
Handle API error(s) in Tomtom matrix. Fixes #6884 | 
|  |  | 
|  |  | 
|  | If there's an API error, we shouldn't update the route's `costs` field.
Let's say we've already calculated some costs for a route A. We then edit
and re-save A, which triggers a recalculation of the costs. Now the
TomTom API responds with an error. We don't want to overwrite our
existing costs with an empty array because they could still be useful.
In this case, we should instead keep the existing costs we already had.
To achieve this, move the `RemoteError` rescue into
`RouteWayCostCalculator`, leaving the error unhandled in
`TomTom.matrix`.
Refs #6884 | 
|  |  | 
|  | Calculate routes using the TomTom matrix API. Update the spec's HTTP
request stub accordingly (note that the stub is still fake).
Refs #6222 | 
|  | This new method will launch a worker that takes the route's `StopArea`s,
converts them to `WayCost`s, sends them to the TomTom API to calculate
distance and time costs, and saves those costs to the route's `costs`
field.
Refs #6095 | 
|  |  | 
|  |  | 
|  | Replace `ParentImportNotifier` with the new generalised
`ParentNotifier`. This will allow us to use the same service for parent
notification of both imports and compliance check sets.
Delete the `ParentImportNotifier` class and spec as these are now
superseded by `ParentNotifier`.
Refs #4758 | 
|  | This is a takeoff on `ParentImportNotifier`. I just copied over the
class and spec and generalised the service to work with `Import`-style
interfaces. We can now use the same notifier service class for both
imports and compliance check sets.
Refs #4758 | 
|  |  | 
|  | Still missing:
- Pagination
- Filters | 
|  | - Rebased #5006 upoon master and created #5281 from #5006
  - Setup regression test based on client provided input
  - Fixed bug with multiple spurious directory occurances | 
|  | Implementing allowed vs foreign line lookup for the zip service
   - Adapting `lib/stif/netex_file.rb` to expose the already implemented matching
   - `app/services/zip_service.rb` augmented to check for allowed lines and returning forbidden lines
   - Specs with fixtures and using the beforementioned new zip support in the specs
   - Fixture directories for the new specs | 
|  | Zip Support for Specs, allowing to create zip archives in memory
   * create zip archive from hash or directory tree
   * Metaspecs -- commented out
     - for potential refactoring of Zip Support
     - as readable documentation on how to use Zip Support | 
|  | Speced and implemented ZipService to return additional directories
in the entry's `spurious` field. | 
|  | These relied on the previous behaviour of `#post_resource` handling
uploads. This is no longer the case. Instead, you have to call
`HTTPService.upload` manually and pass the result to `#post_resource`
via the `params` argument (like in `WorkbenchImportWorker#params`). | 
|  | This is no longer being used as the `WorkbenchImportWorker` was
refactored and it was decided that we don't want to enable retries for
imports.
For example, imagine you have an hour-long import that fails after 50
minutes. We retry three times and now we've wasted 2.5 hours of your
time just to tell you that the import failed.
Thus the decision was to remove it. | 
|  | - Replzed Lazy Enum over get_next_entry and group by with explicit looping and yielding to an instance level enumerator
          that yields streams per subdir (wich represents a referential).
        - Fixtures and Specs that use a REAL usecase.
        Next: Get rid of metadata kludge (should fix failing specs) | 
|  |  | 
|  | af83/3511-cron-job-to-notify-parent-WorkbenchImport-of-sub-import-status--rb201708011853
3511 cron job to notify parent workbench import of sub import status  rb201708011853 | 
|  |  | 
|  | Make Robert happy :)
Refs #3511 | 
|  | merge to keep a reference in feature branch) | 
|  | A new service, `ParentImportNotifier`, will be called by a Cron job
every 5 minutes. This service will query all finished sub-imports that
haven't yet notified their parent, and tell them to do so.
factories/workbench_imports.rb:
Add a `WorkbenchImport` factory. This is currently incomplete. We'll
want to correctly initialise the `file` attribute eventually.
import.rb:
factories/imports.rb:
In order to get the test setup to work correctly, we skip the
`before_create` callback on `Import`. This is because that callback
initialises `status` to "new". We want to be able to set any status
value in our tests to test things properly. Thus the callback messes
with our buttermilk. For all imports created by the factory, skip this
callback. In order to skip the callback, I had to put it in its own
method and pass the method name to `#skip_callback`. That's why the
callback is now in a new method in `Import`.
Adds an empty `#notify_parent` method in `Import`. For now this doesn't
do anything, but eventually it will be filled in to perform the actual
notification. I this changeset, all we're doing is setting up the
connecting logic to notify the right things from the Cron job.
import_spec.rb:
Remove the `.class_name` validation because we removed that previously
in `Import`. The `belongs_to` is now a polymorphic association, with no
class name specified.
parent_import_notifier_spec.rb:
Needed to use `create` instead of `build_stubbed` in a lot of these
cases so that I could validate the query. Really don't like this because
now this set of tests is SUPER SLOW. If you have any ideas for how to
speed it up, let's do that.
Refs #3511 | 
|  | - Added tests for HTTPService (regression)
- Removed some dead code (Workbench model spec, Import factory)
- Changed front_end_host to rails_host in config | 
|  |  | 
|  |  | 
|  |  | 
|  | - speced and implemented Import instance behavior (status, total_steps, current_step)
- failure behavior and it's impact to the above | 
|  |  | 
|  | logging) | 
|  |  | 
|  | - speced but missing error treatment | 
|  |  |