Skip to content

Commit ceabb63

Browse files
authored
Merge branch 'master' into pwnage101/ENT-11570
2 parents f669d68 + daa14a2 commit ceabb63

100 files changed

Lines changed: 6798 additions & 896 deletions

File tree

Some content is hidden

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

.claude/settings.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Skill(quality-tests)",
5+
"Skill(unit-tests)",
6+
"Bash(make :*)",
7+
"Bash(docker compose :*)",
8+
"Bash(tox)",
9+
"Bash(tox :*)",
10+
"Bash(pytest :*)",
11+
"Bash(py.test :*)",
12+
"Bash(python manage.py :*)",
13+
"Bash(pylint :*)",
14+
"Bash(pycodestyle :*)",
15+
"Bash(isort :*)",
16+
"Bash(pip install :*)",
17+
"Bash(pip-compile :*)",
18+
"Bash(pip-sync :*)",
19+
"Bash(npm :*)",
20+
"Bash(diff-cover :*)",
21+
"Bash(coverage :*)",
22+
"Bash(doc8 :*)",
23+
"Bash(code_annotations :*)",
24+
"Bash(jasmine)"
25+
]
26+
},
27+
"extraKnownMarketplaces": {
28+
"edx-enterprise-team-marketplace": {
29+
"source": {
30+
"source": "github",
31+
"repo": "edx/ai-devtools-internal"
32+
}
33+
}
34+
},
35+
"enabledPlugins": {
36+
"pyright-lsp@claude-plugins-official": true,
37+
"edx-enterprise-backend@edx-enterprise-team-marketplace": true
38+
}
39+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
name: quality-tests
3+
description: Run code quality checks (linting, style, PII annotations) in a Docker container. Use when the user wants to run quality checks, lint code, or verify code style compliance.
4+
allowed-tools: Bash(docker *), Bash(make *), Bash(colima *)
5+
---
6+
7+
## Steps
8+
9+
### 1. Make sure the test-shell container is running
10+
11+
Determine if the test-shell container is running:
12+
13+
```bash
14+
docker compose ps
15+
```
16+
17+
Start the test-shell container if not running:
18+
19+
```bash
20+
make dev.up
21+
```
22+
23+
### 2. Run quality checks
24+
25+
```bash
26+
docker compose exec test-shell make quality
27+
```
28+
29+
## Troubleshooting
30+
31+
### ModuleNotFoundError
32+
33+
If tests fail due to missing imports, first try to install requirements:
34+
35+
```bash
36+
docker compose exec test-shell make requirements
37+
```
38+
39+
This is necessary at least when adding new requirements which have not yet been built into the image.
40+
41+
### Failed to connect to the docker API on MacOS
42+
43+
This likely just means colima needs to be started:
44+
45+
```bash
46+
colima start
47+
```

.claude/skills/unit-tests/SKILL.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
name: unit-tests
3+
description: Run Django unit tests in the edx-enterprise Docker container. Use when the user wants to run tests, check if tests pass, or verify test coverage.
4+
argument-hint: "<TEST_FILES>"
5+
allowed-tools: Bash(docker *), Bash(make *), Bash(colima *)
6+
---
7+
8+
## Arguments
9+
10+
`<TEST_FILES>` (optional): One or more folders, test file paths, or pytest node IDs to run. Coverage is only enabled when a single folder representing a code domain is provided or no arguments are provided.
11+
12+
Examples:
13+
- `/unit-tests` — run all tests with coverage
14+
- `/unit-tests tests/test_enterprise/test_tasks.py` — run one test file without coverage
15+
- `/unit-tests tests/test_enterprise/test_tasks.py tests/test_consent/test_helpers.py` — run multiple test files without coverage
16+
- `/unit-tests tests/test_enterprise/test_tasks.py::TestSomeClass::test_method` — run a single test by node ID without coverage
17+
18+
## Routing rules (evaluate in order)
19+
20+
- **No arguments** → Step 2b (whole-project tests + whole-project coverage)
21+
- **Everything else** → Step 2a (targeted tests, NO coverage)
22+
23+
## Steps
24+
25+
### 1. Make sure the test-shell container is running
26+
27+
Determine if the test-shell container is running:
28+
29+
```bash
30+
docker compose ps
31+
```
32+
33+
Start the test-shell container if not running:
34+
35+
```bash
36+
make dev.up
37+
```
38+
39+
### 2a. Run specific unit test files or functions
40+
41+
If `<TEST_FILES>` is provided, run only those tests using `pytest.local.ini` to disable coverage and warnings:
42+
43+
```bash
44+
docker compose exec test-shell bash -c "pytest -c pytest.local.ini <TEST_FILES>"
45+
```
46+
47+
Never enable coverage reports (by adding `--cov`) when only testing specific files, since the results will be misleading.
48+
49+
### 2b. Run whole-project unit tests and generate coverage
50+
51+
If no arguments are given, assume the user wants to run the full test suite for the entire project:
52+
53+
```bash
54+
docker compose exec test-shell make test
55+
```
56+
57+
Whole-project coverage will be reported in the console output. Specific line numbers with missing coverage will be reported.
58+
59+
## Troubleshooting
60+
61+
### ModuleNotFoundError
62+
63+
If tests fail due to missing imports, first try to install requirements:
64+
65+
```bash
66+
docker compose exec test-shell make requirements
67+
```
68+
69+
This is necessary at least when adding new requirements which have not yet been built into the image.
70+
71+
### Failed to connect to the docker API on MacOS
72+
73+
This likely just means colima needs to be started:
74+
75+
```bash
76+
colima start
77+
```

.coveragerc

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ branch = True
33
data_file = .coverage
44
source=enterprise
55
omit =
6-
enterprise/settings*
7-
enterprise/conf*
8-
enterprise/django_compatibility.py
9-
consent/apps.py
10-
consent/errors.py
11-
*migrations*
12-
*admin/__init__.py
13-
*static*
14-
*templates*
15-
*urls.py
6+
enterprise/settings/*
7+
enterprise/conf/*
8+
consent/settings/*
9+
consent/conf/*
10+
*/mocks.py
11+
*/urls.py
12+
*/migrations/*
13+
*/admin.py
14+
*/static/*
15+
*/templates/*
16+
*/tests/*
17+
test_*

.github/dependabot.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
version: 2
22
updates:
3-
# Adding new check for github-actions
3+
# Ensure all GitHub Actions are up-to-date.
44
- package-ecosystem: "github-actions"
55
directory: "/"
66
schedule:
7-
interval: "weekly"
7+
interval: "weekly"
8+
# Disable any org-level dependabot settings for "pip" packages.
9+
# This library does not need automatic python package updates, and
10+
# furthermore it is detrimental to staying synchronized with upstream
11+
# openedx-platform.
12+
- package-ecosystem: "pip"
13+
directory: "/"
14+
schedule:
15+
interval: "weekly"
16+
open-pull-requests-limit: 0 # This disables all PRs for pip updates

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: ['3.11', '3.12']
19-
toxenv: [quality, docs, django52-celery53, pii_check]
18+
python-version: ['3.12']
19+
toxenv: [quality, docs, django52, pii_check]
2020
env:
2121
RUNJSHINT: true
2222
steps:
@@ -35,14 +35,14 @@ jobs:
3535
TOXENV: ${{ matrix.toxenv }}
3636
run: tox
3737
- name: Run code coverage
38-
if: matrix.python-version == '3.11' && matrix.toxenv == 'django42-celery53'
39-
uses: codecov/codecov-action@v4
38+
if: matrix.python-version == '3.12' && matrix.toxenv == 'django52' # Only run this once as part of tests
39+
uses: codecov/codecov-action@v5
4040
with:
4141
flags: unittests
4242
fail_ci_if_error: true
4343
token: ${{ secrets.CODECOV_TOKEN }}
4444
- name: Run jshint
45-
if: matrix.toxenv=='django42-celery53' # Only run this once as part of tests
45+
if: matrix.python-version == '3.12' && matrix.toxenv == 'django52' # Only run this once as part of tests
4646
run: |
4747
npm ci
4848
make jshint

.github/workflows/mysql8-migrations.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
matrix:
2020
os: [ ubuntu-latest ]
21-
python-version: ['3.11']
21+
python-version: ['3.12']
2222

2323
steps:
2424
- name: Checkout repo

.github/workflows/postgresql-migrations.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
matrix:
2929
os: [ ubuntu-latest ]
30-
python-version: ['3.11']
30+
python-version: ['3.12']
3131

3232
steps:
3333
- name: Checkout repo

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: setup python
1717
uses: actions/setup-python@v5
1818
with:
19-
python-version: 3.11
19+
python-version: 3.12
2020
- name: Setup Node.js
2121
uses: actions/setup-node@v2
2222
with:
@@ -33,4 +33,4 @@ jobs:
3333
uses: pypa/gh-action-pypi-publish@release/v1
3434
with:
3535
user: __token__
36-
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}
36+
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}

.github/workflows/upgrade-python-requirements.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Upgrade Requirements
22

33
on:
44
schedule:
5-
- cron: "0 2 * * 1"
5+
- cron: "0 2 * * 1" # "At 02:00 on Monday"
66
workflow_dispatch:
77
inputs:
88
branch:
@@ -16,6 +16,7 @@ jobs:
1616
team_reviewers: "2u-enterprise-titans"
1717
email_address: enterprise-integrations@edx.org
1818
send_success_notification: false
19+
python_version: 3.12
1920
secrets:
2021
requirements_bot_github_token: ${{ secrets.REQUIREMENTS_BOT_GITHUB_TOKEN }}
2122
requirements_bot_github_email: ${{ secrets.REQUIREMENTS_BOT_GITHUB_EMAIL }}

0 commit comments

Comments
 (0)