aboutsummaryrefslogtreecommitdiffstats
path: root/app
AgeCommit message (Collapse)Author
2017-08-29Set started_at & ended_at for WorkbenchImportWorker#performXinhui
Refs #4293
2017-08-29Refs #3367 Change Time table overlap querycedricnjanga
2017-08-29Fixes Import#child_change argumentAlban Peignier
2017-08-29Refs #3367 Change Time table overlap querycedricnjanga
2017-08-29Merge pull request #57 from ↵teddywing
af83/import--fix-parent-status-update-on-child-change Import fix parent status update on child change OH GOODNESS WHAT HAVE I DONE I SKIPPED ALL THE SPECS
2017-08-29Import#update_status: Clean up status assignmentTeddy Wing
Clean up this section a tiny bit. Should function the same way as before.
2017-08-29Import#update_status: Update `ended_at` when import has finished statusTeddy Wing
Previously we were only updating the `ended_at` field when the import had a 'successful' status. But there are other statuses that indicate the import finished, and the `ended_at` field should be updated in these cases also. Committing what I have now which seems to work but I didn't write specs for it because it was a pain to test (what with creating a child, etc.). The `#update_status` method should be refactored to make testing the `ended_at` update easier. This needs to be committed without specs now because I'm off to go to a client meeting and this work/branch is blocking QA of imports both internally and externally. So I guess doing things right comes later. That is to say, probably a lot later. Who knows.
2017-08-29Import: Add TODOsTeddy Wing
A bunch of things that need to be written to get this in proper working order.
2017-08-29Import: Remove `#ready?`Teddy Wing
This method is no longer used, now that we have Alban's `#update_status` method. Originally this was supposed to be used to determine if the import was finished or not. Now, the parent import status field update doesn't depend on it, and we can use the `Referential#ready` field to determine whether or not to display the import in the interface.
2017-08-28Import#child_change: Update ready status of referentialAlban Peignier
After handling a status update of the parent import, if the parent import finished, we should update its referential to `ready: true` so that the referential actually gets displayed on the page.
2017-08-28Import#child_change: Move status update logic into a new methodAlban Peignier
Instead of just looking at the given child, the parent import status is now determined by checking all children and assigning a value based on their status. This also updates the `current_step` (which was previously handled by the `WorkbenchImportWorker`, remind me to remove it from where), and the `ended_at` time. I think `ended_at` should probably be updated in both successful and failed cases. Will have to make that update.
2017-08-28Timetable validate form updatecedricnjanga
2017-08-28Refs #4319 fix timetable autocompletecedricnjanga
2017-08-28Refs #4255: updating overheaded component styles, adding children method for ↵jpl
import
2017-08-28Don't use directly Rails.root/tmp directory (no writable on servers). Refs #4315Alban Peignier
2017-08-28Define Import#creator even if referential isn't created. Refs #4273Alban Peignier
2017-08-28Fixes ImportsController#collection. Refs #4273Alban Peignier
2017-08-28Merge branch '4273_http_service_broken'Alban Peignier
2017-08-27Create STIF::NetexFile to read zip content and create ReferentialMetadata ↵Alban Peignier
from real data. Refs #4273
2017-08-27Fixes API:v1:NetexImportsController specs. Refs #4273Alban Peignier
2017-08-27Change ImportsController to manage only WorkbenchImports. Refs #4273Alban Peignier
2017-08-27Create NetexImport even if Referential can be created. Add a ImportMessage ↵Alban Peignier
and failed status in this case. Refs #4273
2017-08-27Add .zip to uploaded filename (mandatory for java import ?). Refs #4273Alban Peignier
2017-08-27Make NetexImport#parent mandatory. Refs #4273Alban Peignier
2017-08-27Call launch_java_import only when NetexImport is created. Refs #4273Alban Peignier
2017-08-27Launch WorkbenchImportWorker when WorkbenchImport is created. Refs #4273Alban Peignier
2017-08-27Add Import#messages to manage ImportMessages. Refs #4273Alban Peignier
2017-08-27Import#referential is mandatory only for NetexImport. Refs #4273Alban Peignier
2017-08-27Disable authentication in NetexImportsController for the moment. Refs #4273Alban Peignier
2017-08-25ErrorFormat: Add TODO to move this fileTeddy Wing
Robert recommended that this file should not live in concerns. Move it somewhere else (maybe lib/ ?).
2017-08-25ErrorFormat: Change collection structureTeddy Wing
These tests were failing: 1) NetexImport POST netex_imports with correct credentials and incorrect request behaves like illegal attributes missing file does not succeed Failure/Error: expect( json_response_body['errors'][bad_attribute.to_s] ).not_to be_empty TypeError: no implicit conversion of String into Integer Shared Example Group: "illegal attributes" called from ./spec/requests/api/v1/netex_import_spec.rb:90 # ./spec/requests/api/v1/netex_import_spec.rb:77:in `[]' # ./spec/requests/api/v1/netex_import_spec.rb:77:in `block (6 levels) in <top (required)>' # -e:1:in `<main>' 2) NetexImport POST netex_imports with correct credentials and incorrect request name already taken behaves like illegal attributes missing name does not succeed Failure/Error: expect( json_response_body['errors'][bad_attribute.to_s] ).not_to be_empty TypeError: no implicit conversion of String into Integer Shared Example Group: "illegal attributes" called from ./spec/requests/api/v1/netex_import_spec.rb:96 # ./spec/requests/api/v1/netex_import_spec.rb:77:in `[]' # ./spec/requests/api/v1/netex_import_spec.rb:77:in `block (6 levels) in <top (required)>' # -e:1:in `<main>' The problem was caused by the fact that the error messages come back from `ErrorFormat` as an array of hashes, which contain a single key corresponding to the invalid field. Instead, the error messages should be returned as a single hash with a bunch of keys corresponding to the invalid fields. This change gets the above tests to pass.
2017-08-25ErrorFormat: Tidy up whitespaceTeddy Wing
2017-08-25Clean timetable dates after updating day typescedricnjanga
2017-08-25Disable duplicate modal submit button on conditionscedricnjanga
2017-08-25Remove `controllers/support/error_format.rb`Teddy Wing
This one doesn't do anything. The real one currently lives in `app/models/concerns/error_format.rb` (it shouldn't live there according to Robert, but for now that's the story).
2017-08-25Remove `RetryService`Teddy Wing
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.
2017-08-25NetexImport: Run Java import API call in a threadTeddy Wing
While testing imports with Alban, we saw that this request was blocking, not asynchronous. The Java application apparently didn't figure that it should close HTTP connections before handling a long-running import job. In order to get around that on the Rails appliation side, Alban suggested putting the request in a thread. Works like a charm, and we respond in a sensible amount of time.
2017-08-25WorkbenchImportWorker#params: Remove unpermitted `referential_id`Teddy Wing
This param isn't permitted by the controller and we're currently not using it for anything. It produces a warning message in the logs, so I figured we should remove it. We may want to change the architecture to create referentials outside of the API, and thus would have to add this param in, but until then it's not needed.
2017-08-24Edit VJ to enable shift and to go past midnight (DayOffset)cedricnjanga
2017-08-23Refs #4258: adding overhead feature to table_builder, with static samples on ↵jpl
imports#show
2017-08-23API - WorkbenchImport #create actionXinhui
Refs #4280
2017-08-23Model Import belong_to referential is no longer requiredXinhui
Refs #4280
2017-08-23Transferring code to Teddy; allowing him to do git push --force-with-leaseRobert
2017-08-22Refs: 4273@5h; Still debugging zip file upload inside post to Rails api; ↵Robert
Retry removed (but not the deadcode yet) [amend me]
2017-08-22API - workbench imports controllerXinhui
2017-08-22API - Refactoring iboo controller basic auth username should be an ↵Xinhui
organisation code
2017-08-22API - new end point for workbenchesXinhui
2017-08-22API - Iboo controller for basic auth end pointsXinhui
2017-08-22Refs #4256: adding started_at filterjpl
2017-08-22Updating imports menu link (tests ok)jpl