Skip to content

Commit 3b86322

Browse files
authored
Merge branch 'main' into dependabot/github_actions/actions/setup-python-4
2 parents b06caf4 + 5f2875a commit 3b86322

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1321
-617
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "weekly"
8+
reviewers:
9+
- "edx/arbi-bom"

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
matrix:
1313
tox-env: [django32, quality]
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616
- uses: actions/setup-python@v4
1717
with:
1818
python-version: '3.8'

.github/workflows/escalate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: atlassian/gajira-create@v3
2020
id: jiracreate
2121
with:
22-
project: PSRE
22+
project: GSRE
2323
issuetype: Story
2424
summary: ${{ github.event.issue.title }}
2525
description: |

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v4
1616
- name: setup python
1717
uses: actions/setup-python@v4
1818
with:

.github/workflows/test_publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
testing:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v4
1111
- uses: actions/setup-python@v4
1212
with:
1313
python-version: '3.8'
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Upgrade Requirements
2+
3+
on:
4+
schedule:
5+
- cron: "5 4 * * 0"
6+
workflow_dispatch:
7+
inputs:
8+
branch:
9+
description: "Target branch to create requirements PR against"
10+
required: true
11+
default: main
12+
13+
jobs:
14+
call-upgrade-python-requirements-workflow:
15+
uses: openedx/.github/.github/workflows/upgrade-python-requirements.yml@master
16+
with:
17+
branch: ${{ github.event.inputs.branch }}
18+
team_reviewers: "arbi-bom"
19+
email_address: arbi-bom@edx.org
20+
send_success_notification: false
21+
secrets:
22+
requirements_bot_github_token: ${{ secrets.REQUIREMENTS_BOT_GITHUB_TOKEN }}
23+
requirements_bot_github_email: ${{ secrets.REQUIREMENTS_BOT_GITHUB_EMAIL }}
24+
edx_smtp_username: ${{ secrets.EDX_SMTP_USERNAME }}
25+
edx_smtp_password: ${{ secrets.EDX_SMTP_PASSWORD }}

CHANGELOG.rst

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,56 @@ Change Log
1313
1414
Unreleased
1515
~~~~~~~~~~
16-
*
16+
17+
[3.1.1] - 2023-11-06
18+
~~~~~~~~~~~~~~~~~~~~
19+
Fixed
20+
_____
21+
* ConfigWatcher should now respond to model events properly now that it registers receivers with strong references. (Tested in sandbox.)
22+
23+
[3.1.0] - 2023-10-31
24+
~~~~~~~~~~~~~~~~~~~~
25+
26+
Changed
27+
_______
28+
29+
* Add log message for each model the ConfigWatcher is listening to
30+
* Ensure that ConfigWatcher only attaches receivers once
31+
32+
[3.0.0] - 2023-10-30
33+
~~~~~~~~~~~~~~~~~~~~
34+
35+
Changed
36+
_______
37+
38+
* Renamed ``ConfigWatcherApp`` to ``ConfigWatcher`` to be less redundant. This is technically a breaking change but the app was not in use yet.
39+
* Enabled ``ConfigWatcher`` as a plugin for LMS
40+
41+
[2.2.0] - 2023-10-27
42+
~~~~~~~~~~~~~~~~~~~~
43+
44+
Added
45+
_____
46+
47+
* Add ``edx_arch_experiments.config_watcher`` Django app for monitoring Waffle changes
48+
* Add script to get github action errors
49+
* Add script to republish failed events
50+
51+
[2.1.0] - 2023-10-10
52+
~~~~~~~~~~~~~~~~~~~~
53+
54+
* Add ORA2 to our code owner mapping script.
55+
56+
[2.0.0] - 2023-06-01
57+
~~~~~~~~~~~~~~~~~~~~
58+
59+
* Removes summary hook aside, now in the ai-aside repo
60+
61+
[1.2.0] - 2023-05-08
62+
~~~~~~~~~~~~~~~~~~~~
63+
64+
* Update summary hook to trigger on videos
65+
* Remove text selection data key from summary hook html
1766

1867
[1.1.4] - 2023-04-14
1968
~~~~~~~~~~~~~~~~~~~~

Dockerfile

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Docker in this repo is only supported for running tests locally
2+
# as an alternative to virtualenv natively - johnnagro 2023-09-06
3+
FROM ubuntu:focal as app
4+
LABEL org.opencontainers.image.authors="sre@edx.org"
5+
6+
7+
# Packages installed:
8+
# git; Used to pull in particular requirements from github rather than pypi,
9+
# and to check the sha of the code checkout.
10+
11+
# build-essentials; so we can use make with the docker container
12+
13+
# language-pack-en locales; ubuntu locale support so that system utilities have a consistent
14+
# language and time zone.
15+
16+
# python; ubuntu doesnt ship with python, so this is the python we will use to run the application
17+
18+
# python3-pip; install pip to install application requirements.txt files
19+
20+
# pkg-config
21+
# mysqlclient>=2.2.0 requires this (https://github.com/PyMySQL/mysqlclient/issues/620)
22+
23+
# libmysqlclient-dev; to install header files needed to use native C implementation for
24+
# MySQL-python for performance gains.
25+
26+
# libssl-dev; # mysqlclient wont install without this.
27+
28+
# python3-dev; to install header files for python extensions; much wheel-building depends on this
29+
30+
# gcc; for compiling python extensions distributed with python packages like mysql-client
31+
32+
# If you add a package here please include a comment above describing what it is used for
33+
RUN apt-get update && apt-get -qy install --no-install-recommends \
34+
language-pack-en \
35+
locales \
36+
python3.8 \
37+
python3-pip \
38+
python3.8-venv \
39+
pkg-config \
40+
libmysqlclient-dev \
41+
libssl-dev \
42+
python3-dev \
43+
gcc \
44+
build-essential \
45+
git \
46+
curl
47+
48+
49+
RUN pip install --upgrade pip setuptools
50+
# delete apt package lists because we do not need them inflating our image
51+
RUN rm -rf /var/lib/apt/lists/*
52+
53+
RUN ln -s /usr/bin/python3 /usr/bin/python
54+
55+
RUN locale-gen en_US.UTF-8
56+
ENV LANG en_US.UTF-8
57+
ENV LANGUAGE en_US:en
58+
ENV LC_ALL en_US.UTF-8
59+
ENV DJANGO_SETTINGS_MODULE test_settings
60+
61+
# Env vars: path
62+
ENV VIRTUAL_ENV='/edx/app/venvs/edx-arch-experiments'
63+
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
64+
ENV PATH="/edx/app/edx-arch-experiments/node_modules/.bin:${PATH}"
65+
ENV PATH="/edx/app/edx-arch-experiments/bin:${PATH}"
66+
ENV PATH="/edx/app/nodeenv/bin:${PATH}"
67+
68+
RUN useradd -m --shell /bin/false app
69+
70+
WORKDIR /edx/app/edx-arch-experiments
71+
72+
RUN python3.8 -m venv $VIRTUAL_ENV
73+
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
74+
75+
# Copy the requirements explicitly even though we copy everything below
76+
# this prevents the image cache from busting unless the dependencies have changed.
77+
COPY requirements/ /edx/app/edx-arch-experiments/requirements/
78+
79+
# Dependencies are installed as root so they cannot be modified by the application user.
80+
RUN pip install -r requirements/dev.txt
81+
RUN pip install nodeenv
82+
83+
# Set up a Node environment and install Node requirements.
84+
# Must be done after Python requirements, since nodeenv is installed
85+
# via pip.
86+
# The node environment is already 'activated' because its .../bin was put on $PATH.
87+
RUN nodeenv /edx/app/nodeenv --node=18.15.0 --prebuilt
88+
89+
RUN mkdir -p /edx/var/log
90+
91+
# Code is owned by root so it cannot be modified by the application user.
92+
# So we copy it before changing users.
93+
USER app
94+
95+
# This line is after the requirements so that changes to the code will not
96+
# bust the image cache
97+
COPY . /edx/app/edx-arch-experiments
98+

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ upgrade: ## update the requirements/*.txt files with the latest packages satisfy
4343
$(CMD_PIP_COMPILE) -o requirements/base.txt requirements/base.in
4444
$(CMD_PIP_COMPILE) -o requirements/test.txt requirements/test.in
4545
$(CMD_PIP_COMPILE) -o requirements/doc.txt requirements/doc.in
46+
$(CMD_PIP_COMPILE) -o requirements/scripts.txt requirements/scripts.in
4647
$(CMD_PIP_COMPILE) -o requirements/quality.txt requirements/quality.in
4748
$(CMD_PIP_COMPILE) -o requirements/ci.txt requirements/ci.in
4849
$(CMD_PIP_COMPILE) -o requirements/dev.txt requirements/dev.in
@@ -104,3 +105,8 @@ dummy_translations: ## generate dummy translation (.po) files
104105
build_dummy_translations: extract_translations dummy_translations compile_translations ## generate and compile dummy translation files
105106

106107
validate_translations: build_dummy_translations detect_changed_source_translations ## validate translations
108+
109+
## Docker in this repo is only supported for running tests locally
110+
## as an alternative to virtualenv natively - johnnagro 2023-09-06
111+
test-shell: ## Run a shell, as root, on the specified service container
112+
docker-compose run -u 0 test-shell env TERM=$(TERM) /bin/bash

README.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ edx-arch-experiments
44
|pypi-badge| |ci-badge| |codecov-badge| |pyversions-badge|
55
|license-badge|
66

7-
A plugin to include applications under development by the architecture team at 2U.
7+
A plugin to include applications under development by and useful utility scripts for the architecture team at 2U.
88

99
Overview
1010
------------------------
1111

1212
This plugin is meant to house experimental and in-development applications from the edX architecture team at 2U that are either not appropriate (i.e. 2U-specific) or not yet ready for community consumption.
13-
13+
It also includes some one-off scripts meant to reduce toil for the team.
1414

1515
Development Workflow
1616
--------------------
@@ -28,7 +28,11 @@ One Time Setup
2828
2929
Local testing
3030
~~~~~~~~~~~~~
31-
To test your changes locally, you will need to install the package from your local branch into edx-platform. For example, if using devstack, copy or clone your branch into <devstack-parent>/src/edx-arch-experiments. Then, in an lms or cms shell, run ``pip install -e /edx/src/edx-arch-experiments``. The plug-in configuration will automatically be picked up once installed, and changes will be hot reloaded.
31+
Two options are available for testing changes locally:
32+
33+
First, via `make test-shell` a dockerized development envrionment can be launched to run `pytest` and do basic migration work.
34+
35+
Second, a local copy of the package can be installed into edx-platform. For example, if using devstack, copy or clone your branch into <devstack-parent>/src/edx-arch-experiments. Then, in an lms or cms shell, run ``pip install -e /edx/src/edx-arch-experiments``. The plug-in configuration will automatically be picked up once installed, and changes will be hot reloaded.
3236

3337

3438
Every time you develop something in this repo

docker-compose.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Docker in this repo is only supported for running tests locally
2+
# as an alternative to virtualenv natively - johnnagro 2023-09-06
3+
version: "2.1"
4+
services:
5+
test-shell:
6+
build:
7+
context: .
8+
dockerfile: Dockerfile
9+
container_name: arch-experiments.test.app
10+
hostname: app.test.arch-experiments
11+
volumes:
12+
- .:/edx/app/edx-arch-experiments
13+
14+
networks:
15+
- devstack_default
16+
# Allows attachment to this container using 'docker attach <containerID>'.
17+
stdin_open: true
18+
tty: true
19+
environment:
20+
DJANGO_SETTINGS_MODULE: test_settings
21+
22+
networks:
23+
devstack_default:
24+
external: true

edx_arch_experiments/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
A plugin to include applications under development by the architecture team at 2U.
33
"""
44

5-
__version__ = '1.1.4'
5+
__version__ = '3.1.1'
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""
2+
App for reporting configuration changes to Slack for operational awareness.
3+
"""
4+
5+
from django.apps import AppConfig
6+
7+
8+
class ConfigWatcher(AppConfig):
9+
"""
10+
Django application to report configuration changes to operators.
11+
"""
12+
name = 'edx_arch_experiments.config_watcher'
13+
14+
# Mark this as a plugin app
15+
plugin_app = {}
16+
17+
def ready(self):
18+
from .signals import receivers # pylint: disable=import-outside-toplevel
19+
20+
receivers.connect_receivers()

0 commit comments

Comments
 (0)