diff --git a/.github/workflows/upgrade-python-requirements.yml b/.github/workflows/upgrade-python-requirements.yml index c87666e706..56370551df 100644 --- a/.github/workflows/upgrade-python-requirements.yml +++ b/.github/workflows/upgrade-python-requirements.yml @@ -20,7 +20,13 @@ jobs: python-version: ["3.8"] steps: + - name: setup target branch + run: echo "target_branch=$(if ['${{ github.event.inputs.branch }}' = '']; then echo 'master'; else echo '${{ github.event.inputs.branch }}'; fi)" >> $GITHUB_ENV + - uses: actions/checkout@v1 + with: + ref: ${{ env.target_branch }} + - name: setup python uses: actions/setup-python@v2 with: @@ -34,9 +40,6 @@ jobs: cd $GITHUB_WORKSPACE make upgrade - - name: setup target branch - run: echo "target_branch=$(if ['${{ github.event.inputs.branch }}' = '']; then echo 'master'; else echo '${{ github.event.inputs.branch }}'; fi)" >> $GITHUB_ENV - - name: setup testeng-ci run: | git clone https://github.com/edx/testeng-ci.git diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index ae08aba526..7e8bc5836b 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -1,6 +1,6 @@ -############################ +######################## Contributing to Open edX -############################ +######################## Contributions to Open edX are very welcome, and strongly encouraged! We've put together `some documentation that describes our contribution process`_, @@ -99,19 +99,24 @@ to ask clarifying questions on the ticket as needed, too, if anything is unclear Step 1: Sign a Contribution Agreement ===================================== -Before edX can accept any code contributions from you, you'll need to sign -the `individual contributor agreement`_ and send it in. This confirms -that you have the authority to contribute the code in the pull request and -ensures that edX can relicense it. +Before edX can accept any code contributions from you, you'll need to sign the +`Individual Contributor Agreement`_. This confirms that you have the authority +to contribute the code in the pull request and ensures that edX can re-license +it. -You should print out the agreement and sign it. Then scan (or photograph) the -signed agreement and email it to the email address indicated on the agreement. -Alternatively, you're also free to physically mail the agreement to the street -address on the agreement. Once we have your agreement in hand, we can begin -reviewing and merging your work. +.. _Individual Contributor Agreement: https://openedx.org/cla + +If you will be contributing code on behalf of your employer or another +institution you are affiliated with, please reach out by email to legal@edx.org +to request the Entity Contributor Agreement. + +Once we have received and processed your agreement, we will reach out to you by +email to confirm. (Please make sure to indicate your email correctly in the +agreement.) After that we can begin reviewing and merging your work. Step 2: Fork, Commit, and Pull Request ====================================== + GitHub has some great documentation on `how to fork a git repository`_. Once you've done that, make your changes and `send us a pull request`_! Be sure to include a detailed description for your pull request, so that a community @@ -214,5 +219,3 @@ Expectations You Have of Us 3. Once we have determined through visual review that your code is not malicious, we will run a Jenkins build on your branch. - -.. _individual contributor agreement: https://open.edx.org/wp-content/uploads/2019/01/individual-contributor-agreement.pdf diff --git a/Makefile b/Makefile index 32b078d402..f99ad8e9ad 100644 --- a/Makefile +++ b/Makefile @@ -67,7 +67,9 @@ pre-requirements: ## install Python requirements for running pip-tools pip install -qr requirements/edx/pip-tools.txt requirements: pre-requirements ## install development environment requirements - pip-sync -q requirements/edx/development.txt requirements/edx/private.* + # The "$(wildcard..)" is to include private.txt if it exists, and make no mention + # of it if it does not. Shell wildcarding can't do that with default options. + pip-sync -q requirements/edx/development.txt $(wildcard requirements/edx/private.txt) shell: ## launch a bash shell in a Docker container with all edx-platform dependencies installed docker run -it -e "NO_PYTHON_UNINSTALL=1" -e "PIP_INDEX_URL=https://pypi.python.org/simple" -e TERM \ @@ -130,4 +132,3 @@ docker_push: docker_tag docker_auth ## push to docker hub docker push "openedx/edx-platform:${GITHUB_SHA}-newrelic" docker push 'openedx/edx-platform:latest-devstack' docker push "openedx/edx-platform:${GITHUB_SHA}-devstack" - diff --git a/README.rst b/README.rst index dc8bd0eca3..a7ae2cefe2 100644 --- a/README.rst +++ b/README.rst @@ -86,5 +86,5 @@ Reporting Security Issues Please do not report security issues in public. Please email security@edx.org. -.. _individual contributor agreement: https://openedx.org/wp-content/uploads/2019/01/individual-contributor-agreement.pdf +.. _individual contributor agreement: https://openedx.org/cla .. _CONTRIBUTING: https://github.com/edx/edx-platform/blob/master/CONTRIBUTING.rst diff --git a/cms/djangoapps/contentstore/api/tests/test_quality.py b/cms/djangoapps/contentstore/api/tests/test_quality.py index 1f5e055705..8625cbeb55 100644 --- a/cms/djangoapps/contentstore/api/tests/test_quality.py +++ b/cms/djangoapps/contentstore/api/tests/test_quality.py @@ -45,7 +45,7 @@ class CourseQualityViewTest(BaseCourseViewTest): 'number_with_highlights': 0, 'total_visible': 1, 'total_number': 1, - 'highlights_enabled': False, + 'highlights_enabled': True, 'highlights_active_for_course': False, }, 'subsections': { diff --git a/cms/djangoapps/contentstore/api/views/course_quality.py b/cms/djangoapps/contentstore/api/views/course_quality.py index 998bc828c5..b0dab122f2 100644 --- a/cms/djangoapps/contentstore/api/views/course_quality.py +++ b/cms/djangoapps/contentstore/api/views/course_quality.py @@ -9,7 +9,6 @@ from rest_framework.generics import GenericAPIView from rest_framework.response import Response from scipy import stats -from cms.djangoapps.contentstore.views.item import highlights_setting from openedx.core.lib.api.view_utils import DeveloperErrorViewMixin, view_auth_classes from openedx.core.lib.cache_utils import request_cached from openedx.core.lib.graph_traversals import traverse_pre_order @@ -149,7 +148,7 @@ class CourseQualityView(DeveloperErrorViewMixin, GenericAPIView): total_visible=len(visible_sections), number_with_highlights=len(sections_with_highlights), highlights_active_for_course=course.highlights_enabled_for_messaging, - highlights_enabled=highlights_setting.is_enabled(), + highlights_enabled=True, # used to be controlled by a waffle switch, now just always enabled ) def _subsections_quality(self, course, request): # lint-amnesty, pylint: disable=missing-function-docstring diff --git a/cms/djangoapps/contentstore/views/item.py b/cms/djangoapps/contentstore/views/item.py index 69f61537b0..0cf5f405ba 100644 --- a/cms/djangoapps/contentstore/views/item.py +++ b/cms/djangoapps/contentstore/views/item.py @@ -1,7 +1,6 @@ """Views for items (modules).""" -import hashlib # lint-amnesty, pylint: disable=unused-import import logging from collections import OrderedDict from datetime import datetime @@ -21,7 +20,6 @@ from edx_proctoring.api import ( get_exam_configuration_dashboard_url ) from edx_proctoring.exceptions import ProctoredExamNotFoundException -from edx_toggles.toggles import LegacyWaffleSwitch from help_tokens.core import HelpUrlExpert from opaque_keys.edx.keys import CourseKey from opaque_keys.edx.locator import LibraryUsageLocator @@ -36,7 +34,6 @@ from cms.djangoapps.models.settings.course_grading import CourseGradingModel from cms.djangoapps.xblock_config.models import CourseEditLTIFieldsEnabledFlag from cms.lib.xblock.authoring_mixin import VISIBILITY_VIEW from common.djangoapps.edxmako.shortcuts import render_to_string -from openedx.core.djangoapps.schedules.config import COURSE_UPDATE_WAFFLE_FLAG from openedx.core.lib.gating import api as gating_api from openedx.core.lib.xblock_utils import hash_resource, request_token, wrap_xblock, wrap_xblock_aside from openedx.core.djangoapps.bookmarks import api as bookmarks_api @@ -92,9 +89,6 @@ NEVER = lambda x: False ALWAYS = lambda x: True -highlights_setting = LegacyWaffleSwitch('dynamic_pacing', 'studio_course_update', __name__) - - def _filter_entrance_exam_grader(graders): """ If the entrance exams feature is enabled we need to hide away the grader from @@ -1262,8 +1256,8 @@ def create_xblock_info(xblock, data=None, metadata=None, include_ancestor_info=F 'highlights_enabled_for_messaging': course.highlights_enabled_for_messaging, }) xblock_info.update({ - 'highlights_enabled': highlights_setting.is_enabled(), - 'highlights_preview_only': not COURSE_UPDATE_WAFFLE_FLAG.is_enabled(course.id), + 'highlights_enabled': True, # used to be controlled by a waffle switch, now just always enabled + 'highlights_preview_only': False, # used to be controlled by a waffle flag, now just always disabled 'highlights_doc_url': HelpUrlExpert.the_one().url_for_token('content_highlights'), }) diff --git a/cms/djangoapps/contentstore/views/tests/test_item.py b/cms/djangoapps/contentstore/views/tests/test_item.py index 2124f572e3..8a53dae1f7 100644 --- a/cms/djangoapps/contentstore/views/tests/test_item.py +++ b/cms/djangoapps/contentstore/views/tests/test_item.py @@ -13,7 +13,6 @@ from django.test import TestCase from django.test.client import RequestFactory from django.urls import reverse from edx_proctoring.exceptions import ProctoredExamNotFoundException -from edx_toggles.toggles.testutils import override_waffle_switch from mock import Mock, PropertyMock, patch from opaque_keys import InvalidKeyError from opaque_keys.edx.asides import AsideUsageKeyV2 @@ -66,7 +65,6 @@ from ..item import ( _xblock_type_and_display_name, add_container_page_publishing_info, create_xblock_info, - highlights_setting ) @@ -2696,12 +2694,8 @@ class TestXBlockInfo(ItemTest): def test_highlights_enabled(self): self.course.highlights_enabled_for_messaging = True self.store.update_item(self.course, None) - chapter = self.store.get_item(self.chapter.location) - with override_waffle_switch(highlights_setting, active=True): - chapter_xblock_info = create_xblock_info(chapter) - course_xblock_info = create_xblock_info(self.course) - self.assertTrue(chapter_xblock_info['highlights_enabled']) - self.assertTrue(course_xblock_info['highlights_enabled_for_messaging']) + course_xblock_info = create_xblock_info(self.course) + self.assertTrue(course_xblock_info['highlights_enabled_for_messaging']) def validate_course_xblock_info(self, xblock_info, has_child_info=True, course_outline=False): """ @@ -2731,7 +2725,7 @@ class TestXBlockInfo(ItemTest): self.assertEqual(xblock_info['due'], None) self.assertEqual(xblock_info['format'], None) self.assertEqual(xblock_info['highlights'], self.chapter.highlights) - self.assertFalse(xblock_info['highlights_enabled']) + self.assertTrue(xblock_info['highlights_enabled']) # Finally, validate the entire response for consistency self.validate_xblock_info_consistency(xblock_info, has_child_info=has_child_info) diff --git a/cms/envs/common.py b/cms/envs/common.py index 7a4194a92c..746f08a5ae 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -2023,6 +2023,11 @@ INTEGRATED_CHANNELS_API_CHUNK_TRANSMISSION_LIMIT = {} BASE_COOKIE_DOMAIN = 'localhost' +# This limits the type of roles that are submittable via the `student` app's manual enrollment +# audit API. While this isn't used in CMS, it is used via Enterprise which is installed in +# the CMS. Without this, we get errors. +MANUAL_ENROLLMENT_ROLE_CHOICES = ['Learner', 'Support', 'Partner'] + ############## Settings for the Discovery App ###################### COURSE_CATALOG_URL_ROOT = 'http://localhost:8008' @@ -2335,6 +2340,9 @@ DISABLE_DEPRECATED_SIGNUP_URL = False LOGISTRATION_RATELIMIT_RATE = '100/5m' LOGISTRATION_PER_EMAIL_RATELIMIT_RATE = '30/5m' LOGISTRATION_API_RATELIMIT = '20/m' +RESET_PASSWORD_TOKEN_VALIDATE_API_RATELIMIT = '30/7d' +RESET_PASSWORD_API_RATELIMIT = '30/7d' + ##### REGISTRATION RATE LIMIT SETTINGS ##### REGISTRATION_VALIDATION_RATELIMIT = '30/7d' diff --git a/cms/envs/test.py b/cms/envs/test.py index 4fd06839f4..09c9919a35 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -331,7 +331,8 @@ LOGISTRATION_PER_EMAIL_RATELIMIT_RATE = '6/5m' LOGISTRATION_API_RATELIMIT = '5/m' REGISTRATION_VALIDATION_RATELIMIT = '5/minute' - +RESET_PASSWORD_TOKEN_VALIDATE_API_RATELIMIT = '2/m' +RESET_PASSWORD_API_RATELIMIT = '2/m' # Don't tolerate deprecated edx-platform import usage in tests. ERROR_ON_DEPRECATED_EDX_PLATFORM_IMPORTS = True diff --git a/cms/static/js/spec/views/pages/course_outline_spec.js b/cms/static/js/spec/views/pages/course_outline_spec.js index af26914fbf..afb5d5cfd3 100644 --- a/cms/static/js/spec/views/pages/course_outline_spec.js +++ b/cms/static/js/spec/views/pages/course_outline_spec.js @@ -573,8 +573,7 @@ describe('CourseOutlinePage', function() { }); describe('Content Highlights', function() { - var createCourse, createCourseWithHighlights, createCourseWithHighlightsDisabled, - clickSaveOnModal, clickCancelOnModal; + let createCourse, createCourseWithHighlights, clickSaveOnModal, clickCancelOnModal; beforeEach(function() { setSelfPaced(); @@ -592,11 +591,6 @@ describe('CourseOutlinePage', function() { createCourse({highlights: highlights}); }; - createCourseWithHighlightsDisabled = function() { - var highlightsDisabled = {highlights_enabled: false}; - createCourse(highlightsDisabled, highlightsDisabled); - }; - clickSaveOnModal = function() { $('.wrapper-modal-window .action-save').click(); }; @@ -643,11 +637,6 @@ describe('CourseOutlinePage', function() { $('button.status-highlights-enabled-value').click(); }; - it('does not display settings when disabled', function() { - createCourseWithHighlightsDisabled(); - expect(highlightsSetting()).not.toExist(); - }); - it('displays settings when enabled', function() { createCourseWithHighlights([]); expect(highlightsSetting()).toExist(); @@ -778,11 +767,6 @@ describe('CourseOutlinePage', function() { expectHighlightsToBe(updatedHighlights); }; - it('does not display link when disabled', function() { - createCourseWithHighlightsDisabled(); - expect(highlightsLink()).not.toExist(); - }); - it('displays link when no highlights exist', function() { createCourseWithHighlights([]); expectHighlightLinkNumberToBe(0); diff --git a/cms/templates/js/course-outline.underscore b/cms/templates/js/course-outline.underscore index e41860960e..0f83b02e59 100644 --- a/cms/templates/js/course-outline.underscore +++ b/cms/templates/js/course-outline.underscore @@ -212,7 +212,7 @@ if (is_proctored_exam) {

<% } %> - <% if (xblockInfo.get('highlights_enabled') && xblockInfo.isChapter()) { %> + <% if (xblockInfo.isChapter()) { %>
<% var number_of_highlights = (xblockInfo.get('highlights') || []).length; %>