-
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
Enable symlinking js bundle via Hydra prop to make for easier local development for static_react_task #509
Conversation
Codecov Report
@@ Coverage Diff @@
## master #509 +/- ##
==========================================
- Coverage 65.72% 65.66% -0.07%
==========================================
Files 79 79
Lines 7239 7246 +7
==========================================
Hits 4758 4758
- Misses 2481 2488 +7
Continue to review full report at Codecov.
|
"refer to (such as images/video/css/scripts)" | ||
) | ||
}, | ||
) |
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.
Unrelated to the PR scope, I noticed that this is a duplicate field, it's already defined higher up. Cleaning up.
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.
Confirmed that it works on my end. Thank you!!!
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.
I feel we should do a bit more to prevent accidental mismatch between input configuration arguments. If someone tries to launch externally with this option set, the behavior may not be as expected. For this, you can add a case to StaticReactBlueprint.assert_task_args
that throws if launching with cfg.architect._architect_type == heroku
and this option set to true.
In the longer run, I think we'll need to dig deeper on compatibility between the different interfaces, but I don't want to block this implementation for that discussion.
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.
Approved pending the compatibility changes.
Makes sense @JackUrb - I was thinking the same thing, as this config option only really makes sense for when architect=local and for blueprint=static_react_task, even though it lives within the blueprint config. I wasn't sure whether to silently ignore the irrelevant config when architect != local or whether to fail. I don't have a strong opinion either way, happy to add in the check in I think it may make more sense to have it be |
I was wondering if there would ever be a situation where we want to use |
True, |
allowed_architects = ["local"] | ||
assert link_task_source == False or ( | ||
link_task_source == True and current_architect in allowed_architects | ||
), f"`link_task_source={link_task_source}` is not compatible with architect type: {args.architect._architect_type}. Please check your task configuration." |
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.
Added task args validation to ensure link_task_source
is not accidentally specified with something like heroku
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.
Thanks for adding the check!
Overview
@ytsheng mentioned that it's annoying that
python run_task.py
requires a rerun every time a React code change is made. I agreed.This PR update introduces a Hydra config property called
mephisto.blueprint.link_task_source
which can be set totrue
, to remediate this.`From the accompanying README update in this PR:
Testing
/examples/static_react_test/hydra_configs/conf/example.yaml
to includelink_task_source: true
:python run_task.py
npm run dev:watch
from the/examples/static_react_test/webapp
folder in a separate consolepackage.json
file, you can add something like"dev:watch": "webpack --mode development --watch"
under thescripts
key./examples/static_react_task/webapp/src/app.jsx
for example, in theisPreview
code block where the task description is written