-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Upgrade Underscore.js and Underscore.string.js #11631
Conversation
FYI @symbolist |
We hit this known BokChoy flaky test: https://openedx.atlassian.net/browse/SOL-430 |
jenkins run bokchoy |
71b9287
to
7e500f6
Compare
7e500f6
to
5844595
Compare
@andy-armstrong Here is the PR where the underscore.string.min.js upgrade passed all tests-- https://github.com/edx/edx-platform/pull/11632 I looked at the code and don't see a difference. I'll try rerunning the JS files to see if it is a timing issue. For reference, here is the link to the failure: https://build.testeng.edx.org/job/edx-platform-js-pr/14035/ |
jenkins run js |
5844595
to
7c67d79
Compare
@cahrens I rebased the branch and it is now green again, so I don't know if this means that we have some flaky tests or whether something legitimately changed. BTW, I'm thinking of merging this branch to master next week and getting it out in the following week's release, rather than waiting for the JQuery upgrade. I think this will minimize the risk, and I've discovered that it is necessary when using the UI Toolkit in edx-platform just to be able to use some of the utility methods. In order to do this, I have to finalize the testing plan and communicate it with edx-code and with the course teams. Let me know if you see a problem with this approach. FYI @AlasdairSwan |
7c67d79
to
00d6963
Compare
@cahrens I've got a little further investigating the test failure, since it is happening all the time on my branch. There seems to be something wrong with this line in edX Notes where it calls The Underscore function only take two arguments, but for some reason the Notes invocation passes three. When it fails, I only see two calls to |
@cahrens I've found the Underscore change where Now to work out how to rewrite the Notes function to preserve the intent. |
@cahrens I now believe that there's a problem with Underscore.string which is overwriting esamattis/underscore.string#489 If this is the case, I'm not sure why the other caller isn't having trouble too: https://github.com/edx/edx-platform/blob/master/cms/static/js/views/baseview.js#L30 I suppose it must be the case that Underscore.string isn't being brought in by Studio, at least in the cases where the base view is used. I'll investigate more in the morning as I'm out of time for tonight. |
@andy-armstrong I'm sorry you've been wasting time on this! Yes, wrap was overwritten by underscore.string, and the PR I submitted fixed the issue by ensuring that the underscore.string wrap function is excluded by exports. This was released as version 3.3.4, and it fixed my issue. It must be that somehow code is adding underscore.string to the _ namespace without using exports. If you are adding underscore.string methods to _ (which actually isn't recommended anymore), this is what the syntax should be: _.mixin( _s.exports()) |
@@ -6,7 +6,8 @@ | |||
"edx-pattern-library": "0.10.4", | |||
"requirejs": "~2.1.22", | |||
"uglify-js": "2.4.24", | |||
"underscore": "1.4.4" | |||
"underscore": "~1.8.3", | |||
"underscore.string": "~3.2.3" |
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.
This should be 3.3.4! Somehow the wrong version cropped in?
https://github.com/epeli/underscore.string/blob/master/CHANGELOG.markdown
And look, it was correct here:
https://github.com/edx/edx-platform/pull/11632/files
I am at a loss as to why this branch keeps losing changes.
00d6963
to
e5c7fdd
Compare
Thanks @cahrens. I've fixed the version and squashed it into the original commit. If this fixes the build both here and in my PR then I plan on merging this PR so that we're ready for the XSS marathon on Wednesday. I'll do so tomorrow after the release is cut to give us a week to settle in to the changes. Let me know if you see an issue with doing this. |
@cahrens Any objection to me merging this? |
Upgrade Underscore.js and Underscore.string.js
FYI @andy-armstrong and @dan-f, here is our feature branch.