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

Update js dependencies #144

Merged
merged 53 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
6a9172e
Refactor autocomplete and add free autocomplete widget for arbitrary …
jochenklar Oct 6, 2023
6001430
refactor: use admin.register decorator
afuetterer Sep 28, 2023
345afd9
build: pin django-mptt dependency
afuetterer Oct 16, 2023
e710708
fix: update verbose_name_plural in questionset
afuetterer Nov 7, 2023
c7f625a
fix #791 for openid_connect providers and refactor keycloak snippet
MyPyDavid Oct 24, 2023
5c469a1
Add custom {more} markdown tag (#595)
jochenklar Oct 6, 2023
480ae0e
Adjust details/summary style
jochenklar Oct 6, 2023
983e7d4
Add ValueConflictValidator and check for conflicts when storing values
jochenklar Oct 30, 2023
ef5cd99
Autosave after eraseValue and removeValue
jochenklar Oct 30, 2023
dd7e415
Add tests for ValueConflictValidator
jochenklar Oct 31, 2023
6b07b40
Fix human2bytes utils function
jochenklar Oct 31, 2023
a5c916f
chore: refactor human2bytes utils func
MyPyDavid Oct 31, 2023
e31c155
Fix ValueQuotaValidator and add tests
jochenklar Oct 31, 2023
6cc0dbd
Update HUMAN2BYTES_MAPPER and add test
jochenklar Oct 31, 2023
41c92fa
Refactor progress bar and take sets and conditions into account (#596)
jochenklar Aug 22, 2023
e8bb565
Check is_optional for progress bar (again)
jochenklar Aug 22, 2023
39965a2
Add progress_count and progress_total to Project model, compute on POST
jochenklar Aug 24, 2023
e1e2fc5
Add navigation action to ProjectViewSet and refactor navigation (#299…
jochenklar Aug 24, 2023
fa2922d
Always show count in progress bar
jochenklar Sep 26, 2023
5de01de
Fix progress bar for questionsets
jochenklar Sep 26, 2023
2204884
Fix progress computation
jochenklar Sep 28, 2023
d6c9d17
Fix progress permissions
jochenklar Sep 28, 2023
0b2dd52
Add tests for progress and navigation
jochenklar Sep 28, 2023
c51b4f1
Add progress to project hierarchy (#488)
jochenklar Oct 8, 2023
2c2afef
chore: refactor values query to managers
MyPyDavid Nov 15, 2023
ade14af
Use "count of total" for the progress in projects table
jochenklar Nov 16, 2023
9ca8cb0
Add support for BASE_URL to the management react interface (#815)
jochenklar Nov 10, 2023
bbccddf
Rename variable
jochenklar Nov 16, 2023
f8c4a00
Merge pull request #821 from rdmorganiser/fix_management_interface
jochenklar Nov 16, 2023
0485fe9
Merge pull request #679 from rdmorganiser/refactor_progressbar
jochenklar Nov 16, 2023
6f0b734
Refresh navigation after auto-save in interview
jochenklar Nov 19, 2023
c998f9e
chore: add pytest-playwright dependency
afuetterer Oct 31, 2023
9b71c8d
chore: add custom pytest marker for e2e tests
afuetterer Oct 31, 2023
44c163e
chore: enable debug mode per env, default false
afuetterer Oct 31, 2023
cf198bd
refactor: add "fixtures" fixture to reuse in e2e tests
afuetterer Oct 31, 2023
9e94f17
test: add frontend-tests with pytest-playwright
afuetterer Oct 31, 2023
28197f1
ci: run e2e tests in ci
afuetterer Nov 2, 2023
874b917
Merge pull request #769 from afuetterer/715-frontend-tests
afuetterer Nov 19, 2023
7966a28
ci: add build-wheel job
afuetterer Nov 1, 2023
5304eb2
Merge pull request #812 from afuetterer/802-build-wheel-in-ci
afuetterer Nov 21, 2023
9578643
Merge pull request #772 from rdmorganiser/refactor_autocomplete
jochenklar Nov 23, 2023
a8d92c1
Fix translated strings (Projektaufgaben, Projektansichten) and some
jochenklar Oct 16, 2023
5c43c33
Add accept to project import plugins to restrict upload files (to e.g…
jochenklar Oct 16, 2023
c9bfea1
Add accept=".xml" to management upload form component
jochenklar Oct 16, 2023
adbd6fb
chore: add email to RoleAdmin
MyPyDavid Nov 22, 2023
0bb87a9
Merge pull request #785 from rdmorganiser/minor_fixes
jochenklar Nov 23, 2023
851baa4
chore: update ruff repo name in pre-commit config
afuetterer Nov 3, 2023
e4cdaab
build: update pre-commit hooks
github-actions[bot] Nov 14, 2023
d2b078f
chore: fix ruff errors (PGH002, UP032)
afuetterer Nov 15, 2023
f7af042
ci: add dependency groups to dependabot config
afuetterer Nov 19, 2023
0e95d6a
ci: update dependabot js groups
afuetterer Nov 23, 2023
6bd56ec
build(deps-dev): bump the babel group with 5 updates
dependabot[bot] Nov 23, 2023
28d5045
build(deps): pin react-bootstrap
afuetterer Nov 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 .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ module.exports = {
'react': {
'version': 'detect'
}
}
},
}
108 changes: 78 additions & 30 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,80 @@
version: 2
updates:
- package-ecosystem: pip
directory: /
schedule:
interval: monthly
open-pull-requests-limit: 10
target-branch: dependency-updates
labels:
- dependencies
- python
- type:maintenance
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
open-pull-requests-limit: 10
target-branch: dependency-updates
labels:
- dependencies
- github_actions
- type:maintenance
- package-ecosystem: npm
directory: /
schedule:
interval: monthly
open-pull-requests-limit: 10
target-branch: dependency-updates
labels:
- dependencies
- javascript
- type:maintenance
- package-ecosystem: pip
directory: /
schedule:
interval: monthly
open-pull-requests-limit: 10
target-branch: dependency-updates
labels:
- dependencies
- python
- type:maintenance
ignore:
- dependency-name: django-mptt # pinned, 0.15 requires Python >= 3.9
groups:
# create a single pull request containing all updates for the optional dependencies
optional:
patterns:
- coveralls
- django-allauth
- django-auth-ldap
- gunicorn
- mysqlclient
- pre-commit
- psycopg*
- pytest*
# create a single pull request containing all updates for django related dependencies
django:
patterns:
- django*
- drf*
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
open-pull-requests-limit: 10
target-branch: dependency-updates
labels:
- dependencies
- github_actions
- type:maintenance
groups:
# create a single pull request containing all updates for GitHub Actions
github-actions:
patterns:
- '*'
- package-ecosystem: npm
directory: /
schedule:
interval: monthly
open-pull-requests-limit: 10
target-branch: dependency-updates
labels:
- dependencies
- javascript
- type:maintenance
ignore:
- dependency-name: react-bootstrap # rdmo still uses bootstrap 3, which is not supported by react-bootstrap > 0.33.1
groups:
react:
patterns:
- react*
redux:
patterns:
- redux*
babel:
patterns:
- '@babel*'
- babel*
webpack:
patterns:
- webpack*
- copy-webpack-plugin
eslint:
patterns:
- eslint*
prod-dependencies:
dependency-type: production
dev-dependencies:
dependency-type: development
69 changes: 54 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,30 @@ jobs:
GITHUB_DB_BACKEND: ${{ matrix.db-backend }}
COVERALLS_FLAG_NAME: '${{ matrix.db-backend }}: ${{ matrix.python-version }}'
COVERALLS_PARALLEL: true
# end-to-end tests
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
if: matrix.python-version == '3.12' && matrix.db-backend == 'postgres'
- name: Cache Playwright browsers
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright/
key: playwright-browsers
if: matrix.python-version == '3.12' && matrix.db-backend == 'postgres'
- name: Install e2e tests dependencies
run: |
npm install
npm run build:prod
playwright install chromium
if: matrix.python-version == '3.12' && matrix.db-backend == 'postgres'
- name: Run end-to-end tests
run: pytest -p randomly -p no:cacheprovider --reuse-db --numprocesses=auto --dist=loadscope -m e2e --nomigrations
if: matrix.python-version == '3.12' && matrix.db-backend == 'postgres'
env:
DJANGO_DEBUG: True
GITHUB_DB_BACKEND: ${{ matrix.db-backend }}

coveralls:
name: Indicate completion to coveralls
Expand All @@ -106,6 +130,35 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-wheel:
name: Build python wheel
needs: test
runs-on: ubuntu-22.04
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
- run: npm install
- run: npm run build:prod
- uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: pip
- run: python -m pip install --upgrade build pip setuptools wheel
- run: python -m build --wheel
- run: |
PR_NUMBER=${{ github.event.pull_request.number }}
WHL_FILE=$(ls dist/*.whl)
NEW_NAME="${WHL_FILE/-py3-none-any/dev${PR_NUMBER}-py3-none-any}"
mv "$WHL_FILE" "$NEW_NAME"
- uses: actions/upload-artifact@v3
with:
name: wheel
path: dist/*.whl

dev-setup:
# Ref: structlog (MIT licensed) <https://github.com/hynek/structlog/blob/main/.github/workflows/ci.yml>
name: "Test dev setup on ${{ matrix.os }}"
Expand Down Expand Up @@ -140,29 +193,15 @@ jobs:
- run: python -m pip freeze
- run: python -m pip list --outdated

webpack-build:
name: Test webpack-build
needs: lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- run: npm install --dev
- run: npm run build
- run: npm run build:prod

required-checks-pass:
if: always()
needs:
- lint
- test
- coveralls
- build-wheel
- dev-setup
- optional-dependencies
- webpack-build
runs-on: ubuntu-22.04
steps:
- uses: re-actors/alls-green@release/v1
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
hooks:
- id: check-hooks-apply
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-ast
- id: check-json
Expand All @@ -21,13 +21,13 @@ repos:
- id: trailing-whitespace
exclude: \.dot$
- id: debug-statements
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.291
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.50.0
rev: v8.54.0
hooks:
- id: eslint
args: [--fix, --color]
Expand Down
49 changes: 25 additions & 24 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,33 @@
from rdmo.accounts.utils import set_group_permissions


@pytest.fixture(scope="session")
def fixtures():
allowed_file_stems = {
'accounts',
'conditions',
'domain',
'groups',
'options',
'overlays',
'projects',
'questions',
'sites',
'tasks',
'users',
'views'
}
fixtures = []
for fixture_dir in settings.FIXTURE_DIRS:
filenames = [filename for filename in Path(fixture_dir).iterdir() if filename.stem in allowed_file_stems]
fixtures.extend(filenames)
return fixtures


@pytest.fixture(scope='session')
def django_db_setup(django_db_setup, django_db_blocker):
def django_db_setup(django_db_setup, django_db_blocker, fixtures):
"""Populate database with test data from fixtures directories."""
with django_db_blocker.unblock():
fixtures = []
for fixture_dir in settings.FIXTURE_DIRS:
for file in Path(fixture_dir).iterdir():
if file.stem in [
'accounts',
'conditions',
'domain',
'groups',
'options',
'overlays',
'projects',
'questions',
'sites',
'tasks',
'users',
'views'
]:
fixtures.append(file)

call_command('loaddata', *fixtures)
set_group_permissions()

Expand All @@ -49,7 +53,4 @@ def files(settings, tmp_path):
@pytest.fixture
def json_data():
json_file = Path(settings.BASE_DIR) / 'import' / 'catalogs.json'
json_data = {
'elements': json.loads(json_file.read_text())
}
return json_data
return {'elements': json.loads(json_file.read_text())}
Loading