{"action":"created","issue":{"url":"https://api.github.com/repos/edx/edx-platform/issues/14044","repository_url":"https://api.github.com/repos/edx/edx-platform","labels_url":"https://api.github.com/repos/edx/edx-platform/issues/14044/labels{/name}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/14044/comments","events_url":"https://api.github.com/repos/edx/edx-platform/issues/14044/events","html_url":"https://github.com/edx/edx-platform/pull/14044","id":191230351,"number":14044,"title":"Bump problem-builder to v2.6.4","user":{"login":"mtyaka","id":32585,"avatar_url":"https://avatars.githubusercontent.com/u/32585?v=3","gravatar_id":"","url":"https://api.github.com/users/mtyaka","html_url":"https://github.com/mtyaka","followers_url":"https://api.github.com/users/mtyaka/followers","following_url":"https://api.github.com/users/mtyaka/following{/other_user}","gists_url":"https://api.github.com/users/mtyaka/gists{/gist_id}","starred_url":"https://api.github.com/users/mtyaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtyaka/subscriptions","organizations_url":"https://api.github.com/users/mtyaka/orgs","repos_url":"https://api.github.com/users/mtyaka/repos","events_url":"https://api.github.com/users/mtyaka/events{/privacy}","received_events_url":"https://api.github.com/users/mtyaka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-11-23T10:09:58Z","updated_at":"2016-11-29T18:55:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/14044","html_url":"https://github.com/edx/edx-platform/pull/14044","diff_url":"https://github.com/edx/edx-platform/pull/14044.diff","patch_url":"https://github.com/edx/edx-platform/pull/14044.patch"},"body":"This patch fixes the problem where Problem Builder Long Answer blocks throw an error when used inside courses with long course keys (> 50 characters), see [TNL-5932](https://openedx.atlassian.net/browse/TNL-5932).\r\n\r\nIt introduces a new 255-char `course_key` field to the `Answer` model. The old 50-char `course_id` field is still present and used for fallback, but is deprecated and will be removed in next release.\r\n\r\nThis release replaces the initial approach from https://github.com/edx/edx-platform/pull/14013, because it was found that simply extending the existing `course_id` column isn't going to work well in production because the table affected by the migration is quite large and extending column length requires locking the table for the duration of the migration.\r\n\r\nFor more information on the new approach proposed by @maxrothman in https://github.com/edx/edx-platform/pull/14013#issuecomment-261635454, see https://github.com/open-craft/problem-builder/pull/131.\r\n\r\nBelow is the output of `sqlmigrate` for the new migration:\r\n\r\n```\r\nBEGIN;\r\nALTER TABLE `problem_builder_answer` ADD COLUMN `course_key` varchar(255) NULL;\r\nALTER TABLE `problem_builder_answer` ADD CONSTRAINT `problem_builder_answer_student_id_2ce682a818c95cbc_uniq` UNIQUE (`student_id`, `course_key`, `name`);\r\nCREATE INDEX `problem_builder_answer_c8235886` ON `problem_builder_answer` (`course_key`);\r\n\r\nCOMMIT;\r\n```\r\n\r\nNext release will add a data migration to copy contents of `course_id` to the new `course_key` column. EdX will fake this migration and copy data in batches instead.\r\nNext release will also drop the deprecated `course_id` column.\r\n\r\nSee https://github.com/edx/edx-platform/pull/14013#issuecomment-261635454 for more information.\r\n\r\n**Environments**:  edx.org and edge.edx.org\r\n\r\n**Merge deadline**: ASAP - this is blocking a course on Edge\r\n\r\n**JIRA tickets**: [TNL-5932](https://openedx.atlassian.net/browse/TNL-5932)\r\n\r\n**Discussions**: https://github.com/edx/edx-platform/pull/14013, https://github.com/open-craft/problem-builder/pull/131 and [TNL-5932](https://openedx.atlassian.net/browse/TNL-5932)\r\n\r\n**Sandbox URL**:\r\n\r\nSandboxes contain revision 0f03d27bdedd19c3db5a891d78f5ea0b305f9d65.\r\n\r\nThere is a course with course key longer than 50 characters that already contains some long answer blocks.\r\n\r\nI also created a course that was prepared with an older version of problem builder using now deprecated `course_id` field.\r\n\r\n- LMS: https://pr14044.sandbox.opencraft.hosting/\r\n- Studio: https://studio-pr14044.sandbox.opencraft.hosting/\r\n\r\n**Partner information**: hosted on edX Edge (Davidson College)\r\n\r\n**Testing instructions**:\r\n\r\nCheck that you can successfully add a Problem Builder \"Long Answer\" component to a course with a course key that is longer than 50 character and that answers answered on an older version of problem-builder continue to work correctly with this patch.\r\n\r\n1. Install problem-builder v2.6.1\r\n1. Create a course with a combined course key less than 50 characters.\r\n1. Add a Problem Builder component, then add the Long Answer component.\r\n1. Answered several questions.\r\n1. Create a course with a combined course key *more* than 50 characters.\r\n1. Add Unit with Problem Builder and a Long Answer element - watched it fail.\r\n1. Installed problem-builder from this PR.\r\n1. Run migrations.\r\n1. Verify that the answers are still present in the first course.\r\n1. Verify that the Long Answer element in the course with the very long course ID is working now, and you can submit answers to it.\r\n\r\n**Reviewers**\r\n- [ ] @haikuginger \r\n- [ ] @adampalay\r\n- [ ] @maxrothman / @edx/devops\r\n\r\n**Settings**\r\n```yaml\r\nNGINX_SET_X_FORWARDED_HEADERS: false\r\nINSIGHTS_VERSION: '58086e85d673e692cd498793905d8739cfc01515'\r\nEDXAPP_EXTRA_REQUIREMENTS:\r\n  - name: git+https://github.com/open-craft/problem-builder.git@v2.6.4#egg=xblock-problem-builder==2.6.4\r\n```"},"comment":{"url":"https://api.github.com/repos/edx/edx-platform/issues/comments/263663018","html_url":"https://github.com/edx/edx-platform/pull/14044#issuecomment-263663018","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/14044","id":263663018,"user":{"login":"maxrothman","id":2607086,"avatar_url":"https://avatars.githubusercontent.com/u/2607086?v=3","gravatar_id":"","url":"https://api.github.com/users/maxrothman","html_url":"https://github.com/maxrothman","followers_url":"https://api.github.com/users/maxrothman/followers","following_url":"https://api.github.com/users/maxrothman/following{/other_user}","gists_url":"https://api.github.com/users/maxrothman/gists{/gist_id}","starred_url":"https://api.github.com/users/maxrothman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxrothman/subscriptions","organizations_url":"https://api.github.com/users/maxrothman/orgs","repos_url":"https://api.github.com/users/maxrothman/repos","events_url":"https://api.github.com/users/maxrothman/events{/privacy}","received_events_url":"https://api.github.com/users/maxrothman/received_events","type":"User","site_admin":false},"created_at":"2016-11-29T18:55:05Z","updated_at":"2016-11-29T18:55:05Z","body":"Yeah, I think renaming the column in-place is infeasible. If we want the column to have the same name in the end, we'll have to repeat the whole process a second time, copying back to an identical column with the original name."}}
{"actor":{"display_login":"maxrothman"}}