quepid
quepid copied to clipboard
Imagine if we could run 1000's of queries nightly in Quepid!!!
Description
This takes the existing Angular1 app and makes a small stripped version that just runs the query and the splainer stuff, and dumps out a text field in the "Snapshot" JSON format. Then, this is exposed by the api /api/agent_q/fetch
as the JSON response. Oh, how does the API get the data? Glad you asked friend! The API instantiates Chrome and uses Chrome to invoke the stripped down case! It's like that movie Inception ;-).
sequenceDiagram
Alice->>+QuepidAPI: I want to run a query for case 5 and get back the docs. /api/cases/5/agent_q/
QuepidAPI->>+AgentQ: Can you run a query for me.
AgentQ->>+Chrome: Can you run a query for me.
Chrome-->>-QuepidAPI: Please run for me /core/5/stripped
QuepidAPI-->>-Chrome: Here is the HTML page with the data you want.
Chrome->>AgentQ: Here is the rendered HTML page
AgentQ-->>QuepidAPI: Here is the json response you want
QuepidAPI-->>Alice: Here is the query doc data in JSON
Motivation and Context
We have lots of logic in JavaScript and to move it out of there appears to be sissyphean... Leading us down the "big rewrite" path. Let's encapsulate the Angular1 and not expose it to more things.
Let's make it possible to run lots of queries... So if you have 5000 queries, let's run them in batches of 50, and we invoke the browser 100 times. Or batches of 10 and invoke it 500 times!
How Has This Been Tested?
Screenshots or GIFs (if appropriate):
Types of changes
- [] Bug fix (non-breaking change which fixes an issue)
- [] Improvement (non-breaking change which improves existing functionality)
- [] New feature (non-breaking change which adds new functionality)
- [] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [] My code follows the code style of this project.
- [] My change requires a change to the documentation.
- [] I have updated the documentation accordingly.
- [] I have read the CONTRIBUTING document.
- [] I have added tests to cover my changes.
- [] All new and existing tests passed.