-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating mephisto-task
to use the Architect 1.0 API, pushing to static tasks.
#660
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, I'm loving these changes and the reduction in complexity incurred by them. Overall I think it will make Mephisto easier to maintain, more versatile, and friendlier to newcomers. Appreciate all of the fixes also rolled in here.
Left a few comments throughout.
Also thanks for the thorough PR description and outline. It made reviewing this PR significantly easier.
mephisto/abstractions/blueprints/static_html_task/source/dev/app.jsx
Outdated
Show resolved
Hide resolved
2152340
to
7aa8025
Compare
7aa8025
to
e133209
Compare
Codecov Report
@@ Coverage Diff @@
## node-router-update #660 +/- ##
======================================================
- Coverage 64.46% 64.35% -0.11%
======================================================
Files 91 91
Lines 8492 8489 -3
======================================================
- Hits 5474 5463 -11
- Misses 3018 3026 +8
Continue to review full report at Codecov.
|
Overview
As part of #655, this PR contains the full set of changes to update
mephisto-task
to work with the 1.0 API for architects and packets. Upgradesmephisto-task
to version2.0.0
to note this. Also happens to fix the bug in #419 while we're at it. Incorporates the changes from #659 to allow me to do the editing.Implementation
There are a lot of changes here, but the most critical surround the change to the API for
mephisto-task
'sAgentState
. We used to directly keep track of a number of variables that would persist in our local storage, when these were frequently task-specific. By allowing these to be parsed from 'live data' packets instead, we can allow the downstream tasks to decide what to keep and how to parse, rather than leaking that through the abstraction.One element that remains a bit leaky - triggering these kinds of state callbacks requires that the live data packet you send contains a
{ 'state': {...}}
field. I've noted this in the architecture doc. Ultimately I'm fine with having the packets serve two functions starting at themephisto-task
level, as I think it lets me abstract the Packets from the data that is sent with them. It may be worthwhile to add some kind of function to theAgent
class likesend_state
or something that just acts as a wrapper around this send, but that could be unnecessary.With this change, the callbacks that trigger for
useMephistoTask
anduseMephistoLiveTask
needed to be updated somewhat, but hopefully in a way that's clear with this context.For a full list of changes:
useMephistoTask
blockedExplanation
as part of the state, this way we can pull from anAgentDetails
event when the Mephisto backend provides a reason for us to show the worker.utils.js
useMephistoLiveTask
:socket_handler.jsx
to use the new packet typesonStateUpdate
as we no longer track this at the packet levelraw_messages
to allow amephisto-task
task to replay them, restoring the original state and messages present.state
switch noted above foronMessageReceived
, which is now pulled out for use withraw_messages
.getWorkerRegistrationInfo
from the required functions ofwrap_crowd_source.js
as we only have a single step registration handshake now. Updates the documentation to reflect this.StaticAgentState
handles parsing submissions with files. Now that we directly pass the submitted data rather than the full context packet, we don't need to extract out from onboarding or task data. We can then check for files and do final file parsing.StaticHTMLBlueprint
tasks. Transitioning from onboarding now works correctly in a way that required a refresh to fix before.webpack
andwebpack-cli
.yaml
s that were actually broken :(Testing
Automated tests should still be passing, considering this isn't touched.
I updated both of the
StaticBlueprint
task examples, and tried out various configuration steps. Went fully from onboarding through to completing a task in both setups.React preview
React task
React onboarding
HTML task (with file upload)
HTML onboarding