| Age | Commit message (Collapse) | Author |
|
This task will run every 5 minutes, synchronising parent imports with
the status of their children.
When all children have finished, if none of them have failed, the parent
import should get a status of "successful":
WorkbenchImport status: :successful
NetexImport status: :successful
NetexImport status: :successful
When all children have finished, if any of them have failed, the parent
import should get a status of "failed":
WorkbenchImport status: :failed
NetexImport status: :failed
NetexImport status: :successful
We need a Cron job for this instead of being able to do it via a Ruby
method because the thing that's setting the status on the sub-imports
when they're complete is the STIF Java IEV application. Thus there's no
way for our Ruby code to know that a sub-import has finished. Because of
that, we do this polling mechanism every five minutes to update the
imports that need updating.
Created a Rake task to use in the Whenever schedule because the `runner`
method from Whenever expanded to `script/rails`, which is a bloody
ancient file, and tries to run via JRuby lolwat. Didn't want to bother
adding a configuration to Whenever to use something more modern, and
didn't know whether the binstub in `bin/` for `rails` is available since
we don't commit those to the repo apparently (although I knew that fact
from before).
Refs #3511
|
|
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
|
|
Have Rails automatically fill in the `parent_id` and `parent_type`
fields by declaring this as a polymorphic field.
The type will always end up being "Import", but this is fine and will
still allow us to use ActiveRecord in an easy way:
https://stackoverflow.com/questions/9628610/why-polymorphic-association-doesnt-work-for-sti-if-type-column-of-the-polymorph#comment47744381_10820800
Refs #3511, #3555
|
|
I briefly forgot that the `NetexImport` factory lived in the
"imports.rb" factory file. Move it to its own file to make it easier to
find.
Refs #3511
|
|
We need a way to detemine whether the parent of an import has been
notified. We can already select all imports that have a parent and have
finished with a failing status. We additionally need to be able to
select only those imports that haven't notified their parent of having
finished with a failing status. This field allows us to filter out only
the sub-imports that haven't yet sent a notification call.
The ultimate goal is to be able to enable the parent import to know that
one of its sub-imports failed, and thus fail and potentially stop the
parent import task. If one of the sub-imports fails the parent task is
considered as having failed.
Refs #3511
|
|
Seems like these files are no longer used. Originally they were meant to
be used in tests for `WorkbenchImport`, but have been superseded by
"single_reference_import.zip" and "multiple_reference_import.zip".
Refs #3507
|
|
The config variable started out as `config.front_end_host`, but I
requested that Robert change the name. It's now known as
`config.rails_host`, but the corresponding environment variable stayed
the same. Update the env variable to match the config variable.
Refs #3507
|
|
1726 workbench import for multi netex import
|
|
3507 1726 impl workbench import
|
|
- Added tests for HTTPService (regression)
- Removed some dead code (Workbench model spec, Import factory)
- Changed front_end_host to rails_host in config
|
|
|
|
|
|
|
|
4176_1726_neteximp_autocreate_ref
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Refs #4185 @1
|
|
|
|
- Specing that, in case of a correct request Referential & NetexImport instances are created and a 201 is returned
- Specing that, in case of an incorrect request, no instance is created and a 406 with a correct error message is returned
- Implemented
MISSING:
Refactor controller implmentation
|
|
|
|
|
|
|
|
|
|
StifReflexAttributesSupport
|
|
|
|
|
|
|
|
|
|
StifReflexAttributesSupport
|
|
- speced and implemented Import instance behavior (status, total_steps, current_step)
- failure behavior and it's impact to the above
|
|
|
|
This reverts commit e6e6047d9240ffb54fb1989f68c2a6a388b7e66e.
|
|
This reverts commit f27abef1479cf8fc14e78fdaa6d9d69aed0d8ba7.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|