Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

chore: Syncing 2u/project-theseus with master [2023-08-29] #4022

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
b782d39
build: Creating a missing workflow file `self-assign-issue.yml`.
Feb 23, 2023
3dfeacb
build: Creating a missing workflow file `add-remove-label-on-comment.…
Feb 23, 2023
62ba107
build: Updating a missing workflow file `add-depr-ticket-to-depr-boar…
Feb 23, 2023
0fc5040
docs: Remove repo specific CONTRIBUTING.rst
Mar 6, 2023
3fb3c4e
fix: account for refunds in exec ed 2u redemption flow (#3920)
adamstankiewicz Mar 8, 2023
64e89b8
chore: add logging to include fulfillment details upon GEAG allocatio…
adamstankiewicz Mar 8, 2023
c74de17
chore: quality
adamstankiewicz Mar 8, 2023
9495e3e
fix: Pick the right purchase from ios response (#3921)
jawad-khan Mar 16, 2023
4e117d0
feat: Added Android refund api (#3922)
jawad-khan Mar 16, 2023
654dfb5
feat: Error if products in basket are already purchased (#3929)
moeez96 Mar 23, 2023
c22db3d
chore: add logging to debug ent-6954 (#3931)
adamstankiewicz Mar 23, 2023
fe975c4
fix: Fix error in checkout api for mobile (#3934)
moeez96 Mar 29, 2023
3ad694a
fix: Return error in case of duplicate transaction_id for mobile (#3936)
moeez96 Apr 3, 2023
c871aee
feat: Added course and expires field in product form on ecommerce das…
jawad-khan Apr 10, 2023
405592f
fix: reorder JWT decoders (#3941)
robrap Apr 11, 2023
99fe140
fix: cached monitoring (#3942)
robrap Apr 11, 2023
a50fd85
feat: add discount_jwt monitoring (#3944)
robrap Apr 11, 2023
ae883c3
feat: Added data_share_consent field to order fullfillment notes (#3939)
irfanuddinahmad Apr 12, 2023
b5fa2e5
chore: Switch from edx-sphinx-theme to sphinx-book-theme
xitij2000 Mar 24, 2023
29e78ed
test: Add tests for Mobile IAP (#3937)
moeez96 Apr 13, 2023
5c605ea
fix: fix codecov error
aht007 Apr 14, 2023
580be67
fix: add an exec ex 2u max application check to the checkout flow. EN…
iloveagent57 Apr 14, 2023
d6924e3
feat: add product entitlement info api (#3945)
aht007 Apr 19, 2023
c27b0fb
fix: Updated format for data_share_consent field
Apr 21, 2023
300c376
docs: Update the contributing guidelines link.
Apr 24, 2023
679a1f7
feat!: remove custom JWT decoding (#3943)
robrap Apr 26, 2023
43b7e87
fix: Course to have multiple seats with certificate_type attribute (#…
moeez96 Apr 28, 2023
274f212
temp: update JWT_DECODE_HANDER in devstack.py
robrap May 1, 2023
b21e122
feat: add native Dockerfile to create ansible free image
iamsobanjaved Apr 25, 2023
68482ce
feat: add additional fields to EnterpriseLearnerOfferApiSerializer (#…
adamstankiewicz May 10, 2023
a0251ba
refactor: add logging to mobile IAP (#3962)
moeez96 May 11, 2023
addfb62
refactor: Improve exception handling for mobile IAP (#3969)
moeez96 May 15, 2023
9cf9d56
feat: Fix capture_context error on Payment MFE (#3965)
JadeyOlivier May 16, 2023
c623201
feat: Add enterprise_customer_name in the event metadata for offer us…
saleem-latif May 17, 2023
3bae030
feat: Embargo check for subscription Programs (#3960)
aht007 May 17, 2023
e987d3d
fix: Enable TrackingMiddleware for Mobile IAP basket (#3977)
moeez96 May 25, 2023
87292e2
chore: updated Python requirements (edx-ecommerce-worker to version 3…
ishahroz May 31, 2023
f805880
fix: schedule upgrade-python-requirements monthly
pshiu Aug 24, 2022
82ae511
fix: add edx-revenue-tasks to user_reviewers & remove team_reviewers
pshiu Sep 8, 2022
e084e2d
feat: add sf line item field to enterprise offers
brobro10000 Jun 6, 2023
110d834
feat: Added ios refund callback (#3967)
jawad-khan Jun 14, 2023
fd492fc
feat: add SDN endpoints (#3985)
christopappas Jun 16, 2023
6b88537
fix: fix 500 on SDN for subscriptions (#3989)
aht007 Jun 19, 2023
2f1437e
fix: pytest-selenium, pytest-variables, pyjwkest dependency issues (#…
pshiu Jun 20, 2023
fd5f0c2
feat: add coupon sf opp line item attribute
iloveagent57 Jun 20, 2023
0730221
feat: Store price and currency for Mobile IAP (#3992)
moeez96 Jun 23, 2023
a4298d2
fix: return 200 on embargo failure to prevent downstream error (#3993)
christopappas Jun 23, 2023
356f2fc
feat: Make mobile IAP execute/ API atomic (#3995)
moeez96 Jul 5, 2023
8095432
chore: added CODEOWNERS file (#3970)
ishahroz Jul 7, 2023
05e9777
refactor: Add logging to mobile IAP checkout/ API (#4000)
moeez96 Jul 7, 2023
a4766a5
chore: django security patch 3.2.20 upgrade (#3999)
UsamaSadiq Jul 7, 2023
3b1fcb0
feat: Updates opportunity line item regex and tests (#3996)
brobro10000 Jul 10, 2023
e233314
feat: unenroll refunded android users daily (#4015)
jawad-khan Aug 3, 2023
b5a96f1
feat: mail mobile team for a mobile course change in publisher (#4014)
jawad-khan Aug 17, 2023
d560f7b
chore: Syncing 2u/project-theseus with master [2023-08-29]
grmartin Aug 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/add-depr-ticket-to-depr-board.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
secrets:
GITHUB_APP_ID: ${{ secrets.GRAPHQL_AUTH_APP_ID }}
GITHUB_APP_PRIVATE_KEY: ${{ secrets.GRAPHQL_AUTH_APP_PEM }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_ISSUE_BOT_TOKEN }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_ISSUE_BOT_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/add-remove-label-on-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This workflow runs when a comment is made on the ticket
# If the comment starts with "label: " it tries to apply
# the label indicated in rest of comment.
# If the comment starts with "remove label: ", it tries
# to remove the indicated label.
# Note: Labels are allowed to have spaces and this script does
# not parse spaces (as often a space is legitimate), so the command
# "label: really long lots of words label" will apply the
# label "really long lots of words label"

name: Allows for the adding and removing of labels via comment

on:
issue_comment:
types: [created]

jobs:
add_remove_labels:
uses: openedx/.github/.github/workflows/add-remove-label-on-comment.yml@master

7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ jobs:
architecture: x64
- name: Report coverage
if: matrix.testname == 'test-python'
run: |
pip install codecov
codecov
uses: codecov/codecov-action@v3
with:
flags: unittests
fail_ci_if_error: false

docs:
runs-on: ubuntu-latest
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and Push Docker Images

on:
push:
branches:
- master
- open-release/**
jobs:
push:
runs-on: ubuntu-latest

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

# Use the release name as the image tag if we're building an open release tag.
# Examples: if we're building 'open-release/olive.master', tag the image as 'olive.master'.
# Otherwise, we must be building from a push to master, so use 'latest'.
- name: Get tag name
id: get-tag-name
uses: actions/github-script@v5
with:
script: |
const branchName = context.ref.split('/').slice(-1)[0];
const tagName = branchName === 'master' ? 'latest' : branchName;
console.log('Will use tag: ' + tagName);
return tagName;
result-encoding: string

- name: Build and push Dev Docker image
uses: docker/build-push-action@v1
with:
push: true
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
target: dev
repository: edxops/ecommerce-dev
tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }}

# The current priority is to get the devstack off of Ansible based Images. Once that is done, we can come back to this part to get
# suitable images for smaller prod environments.
# - name: Build and push prod Docker image
# uses: docker/build-push-action@v1
# with:
# push: true
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_PASSWORD }}
# target: prod
# repository: edxops/ecommerce-prod
# tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }}
12 changes: 12 additions & 0 deletions .github/workflows/self-assign-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This workflow runs when a comment is made on the ticket
# If the comment starts with "assign me" it assigns the author to the
# ticket (case insensitive)

name: Assign comment author to ticket if they say "assign me"
on:
issue_comment:
types: [created]

jobs:
self_assign_by_comment:
uses: openedx/.github/.github/workflows/self-assign-issue.yml@master
7 changes: 4 additions & 3 deletions .github/workflows/upgrade-python-requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Upgrade Requirements

on:
schedule:
- cron: "15 1 * * 4"
- cron: "15 1 1 * *"
workflow_dispatch:
inputs:
branch:
Expand All @@ -13,8 +13,9 @@ jobs:
call-upgrade-python-requirements-workflow:
with:
branch: ${{ github.event.inputs.branch }}
team_reviewers: "revenue-squad"
email_address: [email protected]
user_reviewers: edx-revenue-tasks
team_reviewers: ""
email_address: [email protected]
send_success_notification: false
secrets:
requirements_bot_github_token: ${{ secrets.REQUIREMENTS_BOT_GITHUB_TOKEN }}
Expand Down
5 changes: 5 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Team @openedx/revenue-squad will be the default owners for
# everything in this repo. Unless a later match takes
# precedence, @openedx/revenue-squad will be requested for
# review when someone opens a pull request.
* @openedx/revenue-squad
4 changes: 0 additions & 4 deletions CONTRIBUTING.rst

This file was deleted.

89 changes: 89 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
FROM ubuntu:focal as app

ENV DEBIAN_FRONTEND noninteractive
# System requirements.
RUN apt update && \
apt-get install -qy \
curl \
git \
language-pack-en \
build-essential \
python3.8-dev \
python3-virtualenv \
python3.8-distutils \
libmysqlclient-dev \
libssl-dev \
libcairo2-dev && \
rm -rf /var/lib/apt/lists/*

# 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

ARG COMMON_APP_DIR="/edx/app"
ARG COMMON_CFG_DIR="/edx/etc"
ARG SERVICE_NAME="ecommerce"
ARG ECOMMERCE_APP_DIR="${COMMON_APP_DIR}/${SERVICE_NAME}"
ARG ECOMMERCE_VENV_DIR="${COMMON_APP_DIR}/${SERVICE_NAME}/venvs/${SERVICE_NAME}"
ARG ECOMMERCE_CODE_DIR="${ECOMMERCE_APP_DIR}/${SERVICE_NAME}"
ARG ECOMMERCE_NODEENV_DIR="${ECOMMERCE_APP_DIR}/nodeenvs/${SERVICE_NAME}"

ENV ECOMMERCE_CFG "${COMMON_CFG_DIR}/ecommerce.yml"
ENV ECOMMERCE_CODE_DIR "${ECOMMERCE_CODE_DIR}"
ENV ECOMMERCE_APP_DIR "${ECOMMERCE_APP_DIR}"

# Add virtual env and node env to PATH, in order to activate them
ENV PATH "${ECOMMERCE_VENV_DIR}/bin:${ECOMMERCE_NODEENV_DIR}/bin:$PATH"

RUN virtualenv -p python3.8 --always-copy ${ECOMMERCE_VENV_DIR}

RUN pip install nodeenv

RUN nodeenv ${ECOMMERCE_NODEENV_DIR} --node=16.14.0 --prebuilt && npm install -g [email protected]

# Set working directory to the root of the repo
WORKDIR ${ECOMMERCE_CODE_DIR}

# Install JS requirements
COPY package.json package.json
COPY package-lock.json package-lock.json
COPY bower.json bower.json
RUN npm install --production && ./node_modules/.bin/bower install --allow-root --production

# Expose canonical ecommerce port
EXPOSE 18130

FROM app as prod

ENV DJANGO_SETTINGS_MODULE "ecommerce.settings.production"

COPY requirements/production.txt ${ECOMMERCE_CODE_DIR}/requirements/production.txt

RUN pip install -r ${ECOMMERCE_CODE_DIR}/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 . .

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

FROM app as dev

ENV DJANGO_SETTINGS_MODULE "ecommerce.settings.devstack"

COPY requirements/dev.txt ${ECOMMERCE_CODE_DIR}/requirements/dev.txt

RUN pip install -r ${ECOMMERCE_CODE_DIR}/requirements/dev.txt

# Devstack related step for backwards compatibility
RUN touch ${ECOMMERCE_APP_DIR}/ecommerce_env

# 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 . .

CMD while true; do python ./manage.py runserver 0.0.0.0:18130; sleep 2; done
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
⛔️ DEPRECATION WARNING
⛔️ DEPRECATION WARNING
======================
This repository is deprecated and in maintainence-only operation while we work on a replacement, please see `this announcement <https://discuss.openedx.org/t/deprecation-removal-ecommerce-service-depr-22/6839>`__ for more information.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -32,7 +32,7 @@ How To Contribute

Anyone merging to this repository is expected to `release and monitor their changes <https://openedx.atlassian.net/wiki/spaces/RS/pages/1835106870/How+to+contribute+to+our+repositories>`__; if you are not able to do this DO NOT MERGE, please coordinate with someone who can to ensure that the changes are released.

Please also read `How To Contribute <https://github.com/openedx/edx-platform/blob/master/CONTRIBUTING.rst>`__. Even though it was written with ``edx-platform`` in mind, these guidelines should be followed for Open edX code in general.
Please also read `How To Contribute <https://github.com/openedx/.github/blob/master/CONTRIBUTING.md>`__.

Reporting Security Issues
-------------------------
Expand Down
7 changes: 7 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,13 @@ def django_db_setup(django_db_setup, django_db_blocker, django_db_use_migrations
type='text',
required=False
)
ProductAttribute.objects.create(
product_class=coupon,
name='Salesforce Opportunity Line Item',
code='salesforce_opportunity_line_item',
type='text',
required=False
)
ProductAttribute.objects.create(
product_class=coupon,
name='Is Public Code?',
Expand Down
6 changes: 6 additions & 0 deletions docs/additional_features/gate_ecommerce.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ Waffle offers the following feature gates.
- Switch
- Allow a missing LMS user id without raising a MissingLmsUserIdException. For background, see
`0004-unique-identifier-for-users <https://github.com/openedx/ecommerce/blob/master/docs/decisions/0004-unique-identifier-for-users.rst>`_
* - disable_redundant_payment_check_for_mobile
- Switch
- Enable returning an error for duplicate transaction_id for mobile in-app purchases.
* - mail_mobile_team_for_change_in_course
- Switch
- Alert mobile team for a change in a course having mobile seats, so that they can adjust prices on mobile platforms.
* - enable_stripe_payment_processor
- Flag
- Ignore client side payment processor setting and use Stripe. For background, see `frontend-app-payment 0005-stripe-custom-actions <https://github.com/openedx/frontend-app-payment/blob/master/docs/decisions/0005-stripe-custom-actions.rst>`_.
Expand Down
49 changes: 39 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
from __future__ import absolute_import

import os
from datetime import datetime


import edx_theme

# on_rtd is whether we are on readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
Expand All @@ -33,7 +34,6 @@
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'edx_theme',
]

# Add any paths that contain templates here, relative to this directory.
Expand All @@ -50,8 +50,8 @@

# General information about the project.
project = u'E-Commerce Service'
author = edx_theme.AUTHOR
copyright = edx_theme.COPYRIGHT # pylint: disable=redefined-builtin
author = 'edX Inc.'
copyright = f'{datetime.now().year}, edX Inc.' # pylint: disable=redefined-builtin

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -101,15 +101,44 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'edx_theme'
html_theme = 'sphinx_book_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
# html_theme_options = {}

html_theme_options = {
"repository_url": "https://github.com/openedx/ecommerce",
"repository_branch": "master",
"path_to_docs": "docs/",
"home_page_in_toc": True,
"use_repository_button": True,
"use_issues_button": True,
"use_edit_page_button": True,
# Please don't change unless you know what you're doing.
"extra_footer": """
<a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">
<img
alt="Creative Commons License"
style="border-width:0"
src="https://i.creativecommons.org/l/by-sa/4.0/80x15.png"/>
</a>
<br>
These works by
<a
xmlns:cc="https://creativecommons.org/ns#"
href="https://openedx.org"
property="cc:attributionName"
rel="cc:attributionURL"
>The Center for Reimagining Learning</a>
are licensed under a
<a
rel="license"
href="https://creativecommons.org/licenses/by-sa/4.0/"
>Creative Commons Attribution-ShareAlike 4.0 International License</a>.
"""
}
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [edx_theme.get_html_theme_path()]
# html_theme_path = []

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
Expand All @@ -120,12 +149,12 @@

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
# html_logo = None
html_logo = "https://logos.openedx.org/open-edx-logo-color.png"

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
# html_favicon = None
html_favicon = "https://logos.openedx.org/open-edx-favicon.ico"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
15 changes: 15 additions & 0 deletions ecommerce/bff/subscriptions/permissions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
Permission classes for Product Entitlement Information API
"""
from django.conf import settings
from rest_framework import permissions


class CanGetProductEntitlementInfo(permissions.BasePermission):
"""
Grant access to the product entitlement API for the service user or superusers.
"""

def has_permission(self, request, view):
return request.user.is_superuser or request.user.is_staff or (
request.user.username == settings.SUBSCRIPTIONS_SERVICE_WORKER_USERNAME)
7 changes: 7 additions & 0 deletions ecommerce/bff/subscriptions/serializers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from rest_framework import serializers


class CourseEntitlementInfoSerializer(serializers.Serializer):
course_uuid = serializers.CharField()
mode = serializers.CharField()
sku = serializers.CharField()
Loading
Loading