-
Notifications
You must be signed in to change notification settings - Fork 479
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
Java Lab: Run validation code in start mode #45500
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.
LGTM!
// Get the access token to connect to javabuilder and then open the websocket connection. | ||
// The token prevents access to our javabuilder AWS execution environment by un-verified users. |
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.
nit: mind adding to this comment describing when we'd use this as opposed to the other functions? just want to make sure we document that this is meant for typical student code execution vs the other two are special cases
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.
done!
const ajaxPayload = { | ||
url: '/javabuilder/access_token_with_override_validation', | ||
type: 'get', | ||
data: requestData | ||
}; |
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.
nit: instead of creating the full payload each time, connectJavabuilderHelper
could take in a url and requestData param? it's a small change though so I'm fine with this as well
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.
done!
# To use a developer instance of Javabuilder instead, replace this url with | ||
# 'wss://<your-javabuilder-domain>.dev-code.org' |
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 these!
Allow validation code that has not yet been saved to the level to be run in start mode. This PR created the route we use here. If we are in start mode and are doing a test run, we use this route, which passes whatever validation code is currently in the editor. We don't need to use this route for a regular run because validation code is ignored on a normal run.
I also did a minor refactor of our connect logic since we now have 3 different routes. Instead of passing in parameters for each potential option and doing an if/else we now have 3 separate functions.
As part of this PR I also added a comment to
cdo.rb
with the format for dev javabuilder routes, because I kept having to put my route there for testing.Links
Testing story
Tested locally against deployed Javabuilder.
PR Checklist: