Skip to content
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

Add new fields for wordpress filters EDLY-6765 #4350

Closed
wants to merge 91 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
4f1ebbb
Upgrade Django to 1.11.26
Nov 14, 2019
242f05e
Upgrade Django to 1.11.27
Dec 19, 2019
3f03def
Upgrade Django to 1.11.28
Feb 3, 2020
ee39988
Upgrade Django to 1.11.29
Feb 26, 2020
4af40ba
added invite_only field in course runs, api returns invite_only data …
rehan99000 Apr 7, 2020
d40e585
added migration for invite_only
rehan99000 Apr 7, 2020
398bf86
Merge pull request #1 from edly-io/rehan/EDLY-751
rehan99000 Apr 8, 2020
1fcb79c
haseeb/EDLY_1209 Updated cryptography library to 2.4.2 (#2)
Apr 13, 2020
dfdc8ff
EDLY_1304 Updated courses, course_runs and search API to filter by or…
Apr 30, 2020
bf49f5d
EDLY_1616 Added programs filtering functionality (#5)
Jul 7, 2020
60af611
Added Edly's API to create,update & view programs (#7)
Jul 29, 2020
0bc7dd2
Used Django's slugify function to generate slugs in course discovery …
Aug 20, 2020
b957903
Added edly_enable_marketing_site waffle flag to fix course publicatio…
Aug 24, 2020
343d8b4
Added banner image while updating data (#10)
Sep 14, 2020
bcf7d56
Upgrade Course Discovery to Juniper (Part1) (#11)
burhandodhy Jan 22, 2021
4dc3c62
Add WordPress data loader (#12)
burhandodhy Feb 10, 2021
b3fcb83
Adds instructor to Wordpress data loader (#13)
rehan99000 Feb 22, 2021
4e7ac04
Link Instructors with multiple courses (#14)
burhandodhy Mar 12, 2021
827d686
Sort course_runs on base of title and id (#15)
burhandodhy Apr 23, 2021
775eff0
Add Subjects data in course_runs api (#16)
burhandodhy Apr 23, 2021
300f452
Added sorting backend & fields in CourseRunSearchViewset haseeb/EDLY-…
Apr 29, 2021
7bfa88b
Create course discovery API for adding new client (#18)
asadmanzoor93 Apr 30, 2021
1b8afa8
Change incorrect field name for ordering EDLY-2824 (#20)
Apr 30, 2021
04c7651
Push course data to WordPress (#17)
burhandodhy May 5, 2021
1c50e84
Fix: Marketing URL not pulled in course runs (#21)
burhandodhy May 7, 2021
97694b3
Added default haystack filter in CourseRunSearchViewset EDLY-2824 (#22)
May 10, 2021
1be1a60
Added missing fields required at wordpress side EDLY-2824 (#23)
May 11, 2021
d8281e3
Removes session auth class from site creation API (#25)
asadmanzoor93 May 19, 2021
0cbcf95
Added default course run type audit in case of empty course run type …
May 19, 2021
cf87e69
Changed card image url field name in serializer (#27)
May 20, 2021
72920fa
Updated model attribute for course run index image url field (#28)
May 20, 2021
f0bea6b
Revert default type change and remove type__is_marketable filter from…
burhandodhy May 21, 2021
28c7d0e
Introduced title_override in CourseRunSearch (#30)
May 21, 2021
a311c85
Added sorting backend, updated filter & added required indexes for in…
May 25, 2021
94381f5
Fix: WordPress Data Loader Tests (#32)
burhandodhy May 26, 2021
8bc6a01
Filter Subjects base on Partner (#31)
burhandodhy May 26, 2021
b6279c8
EDLY-3051 Add email, phone & website in people api (#33)
May 27, 2021
6319858
Change image_url to card_image_url to make API consistent to model ED…
May 28, 2021
9932698
Allowed null fields to make them consistent to model EDLY-3059 (#36)
May 31, 2021
7bf1cb4
Cleaned up unused code to move closer to open edX codebase EDLY-2704 …
Jun 5, 2021
3bff495
Fix: Course title Capitalization issue (#38)
burhandodhy Jun 9, 2021
38d2bb6
Fix Subject Counts when Course has multiple course_runs (#39)
burhandodhy Jun 10, 2021
4af37b3
Added ability to unlink course instructors EDLY-3243 (#40)
Jul 1, 2021
5912e29
Added sorting functionality for person name in index EDLY-3246 (#41)
Jul 6, 2021
21031fe
Update courses discovery WordPress data loader for subjects translati…
asadmanzoor93 Aug 4, 2021
b0299b6
domain changes
taimoor-ahmed-1 Oct 1, 2021
1bb3169
Merge pull request #44 from edly-io/tai/EDLY-3642
taimoor-ahmed-1 Oct 22, 2021
4328eb3
Update data loader with course average rating (#45)
asadmanzoor93 Oct 29, 2021
f0b2d81
add youtube wordrpess video link field - EDLY 5023
faatehsultan Dec 15, 2022
92c336c
Merge pull request #46 from edly-io/faateh/EDLY-5023
faatehsultan Dec 27, 2022
350645b
dataloader API added
marslanabdulrauf Dec 22, 2022
72956a6
Merge pull request #47 from edly-io/marslan/EDLY-5058
marslanabdulrauf Dec 27, 2022
87a5a2a
celery added, dataloader API moved to celery (#48)
marslanabdulrauf Jan 5, 2023
c4cbdb5
Fix site creation automation api - EDLY-5126
taimoor-ahmed-1 Jan 9, 2023
251004c
Merge pull request #49 from edly-io/tai/EDLY-5126
taimoor-ahmed-1 Jan 9, 2023
68a8118
partner added to check the exising instructor (#51)
marslanabdulrauf Feb 1, 2023
2528c04
dataloader API updated to get body from data (#50)
marslanabdulrauf Feb 7, 2023
2bf8071
other management commands added on wordpress service (#52)
marslanabdulrauf Mar 8, 2023
2e2582c
Run Management command in shell environment (#53)
marslanabdulrauf Apr 5, 2023
0112fac
feat:Add command to automate Setup Edly Multisite Devstack Locally ED…
mfarhan943 May 25, 2023
cf45b67
Merge pull request #54 from edly-io/farhan/EDLY-5506
mfarhan943 Jun 5, 2023
2e5b19c
feat: Add new field 'course_duration_override' EDLY-5741
mfarhan943 Jun 21, 2023
b8b3da5
Merge pull request #56 from edly-io/farhan/EDLY-5741
mfarhan943 Jun 22, 2023
e78003b
Fetching Course From Studio Immediately to Discovery (#57)
daniyalfarman Jul 6, 2023
a93029f
Removed django.config import (#58)
daniyalfarman Jul 6, 2023
531ecbc
Run dataloader in edly_site without celery - EDLY-5759
Jul 12, 2023
fefbcc6
Merge pull request #59 from edly-io/tai/EDLY-5759
taimoor-ahmed-1 Jul 12, 2023
a5f4675
upgrade to koa release (#55)
muhammadali124 Aug 10, 2023
af3edf8
program fixes: create new program and its certificate fixed (#60)
marslanabdulrauf Aug 23, 2023
171221f
Merge remote-tracking branch 'origin/develop-juniper' into develop-koa
Sep 5, 2023
7ab93f0
Fix course_metadata migrations
Sep 25, 2023
eecca7f
Merge pull request #64 from edly-io/tai/fix-migrations
taimoor-ahmed-1 Sep 25, 2023
14d54b1
Fix migrations after merging
Sep 26, 2023
6beb6c7
Merge pull request #65 from edly-io/tai/fix-migration
taimoor-ahmed-1 Sep 26, 2023
3c44670
fix migrations
Sep 26, 2023
e6ee524
Merge pull request #66 from edly-io/tai/fix-migration
taimoor-ahmed-1 Sep 26, 2023
7887ca4
Fix update_index filtering course runs - EDLY-6158
Nov 14, 2023
af88aab
Merge pull request #73 from edly-io/tai/EDLY-6158
taimoor-ahmed-1 Nov 14, 2023
8920d45
Update marketing_url for course runs - EDLY-6224
Nov 20, 2023
b8ae0c1
Merge pull request #74 from edly-io/tai/6224
taimoor-ahmed-1 Nov 20, 2023
a2e82dd
Remove unique title for programs
Nov 30, 2023
8bde8db
Merge pull request #76 from edly-io/tai/EDLY-6151
taimoor-ahmed-1 Nov 30, 2023
135a14b
Fix course invite flag issue - EDLY-6132
Feb 14, 2024
fa3e865
Merge pull request #77 from edly-io/tai/EDLY-6132
taimoor-ahmed-1 Feb 14, 2024
bbd64dc
Add partner disablement option in discovery - EDLY-6648
Apr 2, 2024
808d508
Merge pull request #78 from edly-io/tai/EDLY-6648
taimoor-ahmed-1 Apr 4, 2024
faec5c1
Closed api client connections to avoid keeping session files open
muhammadali286 Apr 1, 2024
9c8a150
Merge pull request #79 from edly-io/ali_sr/EDLY-6639-too-many-open-files
muhammadali286 Apr 17, 2024
af9f9d2
Update Dataloader api
May 2, 2024
b4d068e
Merge pull request #80 from edly-io/tai/update_dataloader_api
taimoor-ahmed-1 May 2, 2024
0facc3a
feat: Add new fields for wordpress filters EDLY-6765
mfarhan943 May 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ omit =
course_discovery/settings*
course_discovery/conf*
course_discovery/apps/course_metadata/tests/factories.py
course_discovery/apps/course_metadata/algolia_models.py
course_discovery/apps/course_metadata/index.py
*conftest.py
*wsgi.py
*migrations*
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Push Docker Images

on:
push:
branches:
- master
jobs:
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build and Push docker image
env:
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
run : make docker_push
17 changes: 17 additions & 0 deletions .github/workflows/semgrep-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Semgrep
on: [pull_request]
jobs:
semgrep:
runs-on: ubuntu-latest
continue-on-error: true
name: Check
steps:
- uses: actions/checkout@v1
- uses: returntocorp/semgrep-action@v1
name: django rules
with:
config: p/django
- uses: returntocorp/semgrep-action@v1
name: other rules
with:
config: https://semgrep.live/dlukeomalley:use-assertEqual-for-equality
4 changes: 2 additions & 2 deletions .pep8 → .pycodestyle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[pep8]
ignore=E501
[pycodestyle]
ignore=E501,W504
max_line_length=119
exclude=settings,migrations,course_discovery/static,bower_components,course_discovery/wsgi.py
55 changes: 27 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
dist: focal
language: python

python:
- "3.5"
- 3.8

branches:
only:
Expand All @@ -14,43 +15,41 @@ sudo: required

cache:
- directories:
- node_modules
- course_discovery/static/bower_components

before_install:
- make travis_up

matrix:
include:
- env: TOXENV=django22
- env: TOXENV=django30
- env: COMMAND=test:quality

install:
- docker exec -t discovery bash -c 'sed -i "s/course_discovery.settings.devstack/course_discovery.settings.test/" /edx/app/discovery/discovery_env'
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make requirements'

script:
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make docs'
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make check_translations_up_to_date'
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make validate_translations'
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make clean_static'
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make static'
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make quality'

- env: COMMAND=test:unittests

install:
- docker exec -t discovery bash -c 'apt update && apt install -y xvfb firefox gettext wget'
# Remove firefox but leave its dependencies, and then download and install a working version of firefox.
- docker exec -t discovery bash -c 'sudo dpkg -r --force-all firefox && TEMP_DEB="$(mktemp)" && wget -O "$TEMP_DEB" https://s3.amazonaws.com/vagrant.testeng.edx.org/firefox_61.0.1%2Bbuild1-0ubuntu0.16.04.1_amd64.deb && dpkg -i "$TEMP_DEB"'
- docker exec -t discovery bash -c 'sed -i "s/course_discovery.settings.devstack/course_discovery.settings.test/" /edx/app/discovery/discovery_env'
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make requirements'

script:
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make clean_static'
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make static'
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && xvfb-run make test'

after_success:
- pip install -U codecov
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && coverage xml'
- codecov
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make docs'
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make clean_static'
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make static'
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make quality'
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make check_keywords'
allow_failures:
- env: TOXENV=django30

install:
- docker exec -t discovery bash -c 'sed -i "s|http://archive|http://us.archive|g" /etc/apt/sources.list' # US mirrors for speed
- docker exec -t discovery bash -c 'apt update && apt install -y --no-install-recommends firefox gettext'
- docker exec -t discovery bash -c 'sed -i "s/course_discovery.settings.devstack/course_discovery.settings.test/" /edx/app/discovery/discovery_env'
- docker exec -e TOXENV=$TOXENV -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make requirements'

script:
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make clean_static'
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make static'
- docker exec -e TOXENV=$TOXENV -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && make test'

after_success:
- pip install -U codecov
- docker exec -t discovery bash -c 'source /edx/app/discovery/discovery_env && cd /edx/app/discovery/discovery/ && coverage xml'
- codecov
13 changes: 5 additions & 8 deletions .travis/docker-compose-travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@ version: "2"

services:
db:
image: mysql:5.6
image: mysql:5.7
container_name: db
command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci
environment:
MYSQL_ROOT_PASSWORD: ""
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_USER: "discov001"
MYSQL_PASSWORD: "password"
MYSQL_ROOT_PASSWORD: "password"
MYSQL_DATABASE: "discovery"
es:
image: elasticsearch:1.5.2
image: elasticsearch:1.7.6
container_name: es
memcached:
image: memcached:1.4.24
image: memcached:1.6.8
container_name: memcached
discovery:
# Uncomment this line to use the official course-discovery base image
Expand Down Expand Up @@ -44,7 +41,7 @@ services:
DB_NAME: "discovery"
DB_PASSWORD: "password"
DB_PORT: "3306"
DB_USER: "discov001"
DB_USER: "root"
DJANGO_SETTINGS_MODULE: "course_discovery.settings.test"
ENABLE_DJANGO_TOOLBAR: 1
TEST_ELASTICSEARCH_URL: "http://es:9200"
5 changes: 1 addition & 4 deletions .travis/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
. /edx/app/discovery/nodeenvs/discovery/bin/activate

apt update
apt install -y xvfb firefox gettext wget
apt install -y xvfb firefox gettext

cd /edx/app/discovery/discovery
export PATH=$PATH:$PWD/node_modules/.bin
Expand All @@ -18,9 +18,6 @@ make requirements.js
# Ensure documentation can be compiled
make docs

# Check if translation files are up-to-date
make validate_translations

# Compile assets and run validation
make clean_static
make static
Expand Down
6 changes: 0 additions & 6 deletions AUTHORS

This file was deleted.

2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# The following users are the owners of all course-discovery files
* @edx/course-discovery-admins
72 changes: 72 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
FROM ubuntu:focal as app

# System requirements.
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get upgrade -qy
RUN apt-get install --yes \
git \
language-pack-en \
python3-venv \
python3.8-dev \
python3.8-venv \
build-essential \
libffi-dev \
libmysqlclient-dev \
libxml2-dev \
libxslt1-dev \
libjpeg-dev \
libssl-dev

RUN rm -rf /var/lib/apt/lists/*

ENV VIRTUAL_ENV=/venv
RUN python3.8 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

RUN pip install pip==20.2.3 setuptools==50.3.0 nodeenv

# Use UTF-8.
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

# Make necessary directories and environment variables.
RUN mkdir -p /edx/var/discovery/staticfiles
RUN mkdir -p /edx/var/discovery/media
ENV DJANGO_SETTINGS_MODULE course_discovery.settings.production

# Working directory will be root of repo.
WORKDIR /edx/app/discovery

# Copy just JS requirements and install them.
COPY package.json package.json
COPY package-lock.json package-lock.json
RUN nodeenv /edx/app/nodeenv --node=12.11.1 --prebuilt
ENV PATH /edx/app/nodeenv/bin:${PATH}
RUN npm install --production
COPY bower.json bower.json
RUN ./node_modules/.bin/bower install --allow-root --production

# Copy just Python requirements & install them.
COPY requirements/ requirements/
RUN pip install -r requirements/production.txt

# Copy over rest of code.
# We do this AFTER requirements so that the requirements cache isn't busted
# every time any bit of code is changed.
COPY . .

# Expose canonical Discovery port
EXPOSE 8381

CMD gunicorn --bind=0.0.0.0:8381 --workers 2 --max-requests=1000 -c course_discovery/docker_gunicorn_configuration.py course_discovery.wsgi:application

FROM app as devstack
ENV DISCOVERY_CFG /edx/app/discovery/devstack.yml
RUN make static

FROM app as newrelic
RUN pip install newrelic
CMD newrelic-admin run-program gunicorn --bind=0.0.0.0:8381 --workers 2 --max-requests=1000 -c course_discovery/docker_gunicorn_configuration.py course_discovery.wsgi:application
Loading