[WIP] ✨ added db import polling endpoints#10340
[WIP] ✨ added db import polling endpoints#10340vikaspotluri123 wants to merge 3 commits intoTryGhost:masterfrom
Conversation
vikaspotluri123
left a comment
There was a problem hiding this comment.
Functional tests will come after an initial review 😄
There was a problem hiding this comment.
Since this is APIv2, it might be possible to alter the POST .../db method once changes are made to the admin client
4665afb to
9a4e848
Compare
refs TryGhost#9388 - GET /ghost/api/v2/admin/db/import returns the import state (currently importing or not) as well as the result of the last import schema: { db: [], importing: Boolean, lastResult: { id: Number, success: Boolean, errors: undefined (success) | Array (!success) problems: Array (success) | undefined (!success) } } - POST /ghost/api/v2/admin/db/import - receives a file to import - Returns a randomly generated id which will be included in the `lastResult` field of the GET endpoint once the import completes
0a96b51 to
ab769a6
Compare
|
I'm not exactly sure why, but it looks like something is blocking 😬 The first import status request responds quickly, but the second request takes 7+ seconds. I don't have a large import to test, so I've been adding a 10s delay to after the import completes. |
|
Hm let me know if you need help, then i can help debugging |
|
I'm not entirely sure where to start 🤔 First 2 import responses work properly (first is PUT and second is running: true), but the last one delays until the import finishes (but technically responds properly). Running The import I'm using is a few repeats of the default posts which was exported as part of qa for this PR |
|
I don't see this behaviour. But what I do see is: lot's of error messages from xmlrpc, which is weird, because we skip the service if |
I guess this should be fixed via 2fd5964. |
|
@vikaspotluri123 Do you need any further feedback/help? :) |
|
Not at the moment, but I'll let you know 😄 |
Maybe it's a different node version? I'm testing with 10.15.3 FWIW I'm also not starting with a fresh instance, though I doubt that makes a difference wrt import times 🤔 |
|
Hmm will test again on Monday. |
|
@vikaspotluri123 Sorry didn't have time to review again. Will do next Monday 🤺 |
|
Will have a look at these on Monday @vikaspotluri123 One thing that definitely needs more thinking is naming of the API endpoints as these are a bit unusual cases and should probably be treated differently to normal ones where they return resource(s) 🤔 |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Not stale, just needs a broader discussion about the approach and introduction of new endpoints within the team. |
|
@vikaspotluri123 as a part of a more aggressive push to reduce the number of open issues that are not actively worked on the #9388 has been closed down. Closing this PR to keep "open PRs" tab clean. We definitely will come back to this once main issue is reopened/higher in priorities as the approach seems correct to me but needs more planning and broader team discussion as mentioned above 😉 |

refs #9388 (this is just the backend)
schema:
lastResultfield of the GET endpoint