Skip to content

Commit f2b0bc5

Browse files
stopnoanimereivvaxkamilszymczak1github-actions[bot]sio2dockerhub
authored
Update webpack-libs with master (#9)
* Ordering of DifficultyTags (sio2project#449) * Add ordering for DifficultyTag and DiffultyTagLocalization * Make migrations * Update migrations * Add a note about copying limits (sio2project#480) * Add a note about copying limits * Add text translation * Github Actions - Downloaded translations. (sio2project#495) Co-authored-by: SIO2 Automatic Agent <[email protected]> * add buttons to expand group member lists (sio2project#493) * Searchbox bugfix (sio2project#489) * Now if tags don't show up in probset, only superusers can filter by them. * Fix bug allowing for duplicate difficulty search tags. * Fix bug in filtering by difficulty tags. * PARTIAL fix to tests in TestProblemSearchHintsTags. * Hide tags under searchbox and tag search hints when PROBLEM_TAGS_VISIBLE = False (even for admin). * Fix more tag hint tests. * Fix all but one test from TestProblemSearch. * Remove temporary comment. * Override setting globally for TestProblemSearchHintsTags. * Override settings globally for TestProblemSearchOrigin. * Add setting override to test_statistics_sorting_with_query. * Fix column number in test_statistics_sorting_with_query. * Fix the column number being ordered by in test_problem_statistics.py. * Better problem column array naming in TestProblemStatisticsDisplay. * Rename problem 'Znacznik' in test_problem_search.json to 'Znacznik_zadanie', as 'Tags' are localised in Polish to 'Znaczniki' which caused false positives when checking if the task appeared in URL. * Rename 'Znacznik_zadanie' to 'Znaczn1k', as its previous name still caused name collisions. * fix minor bugs in usergroups app and add tests (sio2project#498) * first commit * fix permissions * fix admin panel not saving * small fixes * fix origin info * change permission name * fix permissions for contest admins * fix permissions for contest admins * fix for problems without contests * add test * resolve conflicts * small fix * test tags tab * squash migrations * remove redundant migrations * display nickname next to the full name when displaying contest pupils * add logic and use member.username * fix more similar cases * fix order of names * more elegant code * more elegant code * revert changes * more elegant code * add buttons to expand group member lists * fix minor bugs * add tests * Add copying problems in bulk * Refactor Problem.name property to allow for prefetch_related (sio2project#441) Problem.name previously queried through the whole ProblemName table. Now it accesses the names for the problem through self.names, which allows other code to optimize this query by using prefetch_related on the names property. * Add prefetch_related on names to task_archive_tag_view (sio2project#441) * Add tests to check correctness of new Problem.name property (sio2project#441) * Fix access to relationship before Problem is saved (sio2project#441) Previous implementation of Problem.name errored out if Problem.name was accessed before the instance of Problem was saved with .save(). This is now fixed. * Pass problem ids as request arguments * Add test for reattaching multiple problems * Add command for creating mock competitions (sio2project#502) * Add create_mock_contest command (sio2project#496) * Directly check if primary key exists instead of try/catch (sio2project#441) * Add school year field to contest model and filter for contest selection (sio2project#491) * Add school year field to contest model and filter function * Fix filter function * Filtering in ORM * Add tests * Fix select_contest template * Contest pagination * add test option to check if variables in template tags are defined (sio2project#506) * first commit * fix permissions * fix admin panel not saving * small fixes * fix origin info * change permission name * fix permissions for contest admins * fix permissions for contest admins * fix for problems without contests * add test * resolve conflicts * small fix * test tags tab * squash migrations * remove redundant migrations * display nickname next to the full name when displaying contest pupils * add logic and use member.username * fix more similar cases * fix order of names * more elegant code * more elegant code * revert changes * more elegant code * add buttons to expand group member lists * fix minor bugs * add tests * add test option to check if variables in template tags are defined * code style * better approach * better approach * cleaner code * Filter by tag proposals (sio2project#503) * Add the option for filtering by algorithm tags to take into account most popular tag proposals when choosing which tasks to show in the results. * Add the value `include_proposals` to be included in `?q=` for the problemset page controlling whether filtering by algorithm tags takes the most popular tag proposals into account. * Add `TestTagProposalsSearch` test class for this feature. * Create contest monitoring page (sio2project#359) * Fix adding new tags from problem admin (sio2project#304) * Create monitoring site for contests * Add monitoring template * Implement round times monitoring * Add contest permissions info to monitoring page * Added General info tab. -Added q_size and q_size_global to General info. * Add relative start/end times to monitoring * Cleanup * Change monitoring template * Added count of unanswered questions and date of oldest unanswered question to general info * Add attachments info to monitoring page * Quickfix * Add submissions info to monitoring page * Number of submission of every kind * Added count of submissions with system errors * Add info about test limits to contest monitoring * Extend problems info in monitoring page * Refactor contest monitoring view * Added round extensions * Added bool, that shows if someone solved a problem * Bugfix: Changed round to round-name * Bugfix: Added contest filter to SE detection * Create tests_monitoring file * Add tests round times * Bugfix: changed pub-date to date * Added tests for general info * WIP * Changed fixture and fixed system error counter * WIP * Add attachments tests * Changed fixture * Moved monitoring tests from tests_monitoring.py to tests.py * Added fixture to monitoring tests * Changed colspan * Use humanize module --------- Co-authored-by: Zonkil <[email protected]> Co-authored-by: Iteron-dev <[email protected]> * livedata: fix cache_unless_admin_or_observer (sio2project#387) * livedata: fix cache_unless_admin_or_observer result.content is of type "bytes", so wrapping it in str() will create a string that's wrapped in b''. * Add test for cache_unless_admin_or_observer * Mass create tool (sio2project#513) * Add tool for mass mock data creation. * Change __str__ for TagThrough models to include the problem they connect with tag. * Remove all u before strings in models.py, as they were redundant. * Add TestMassCreateTool tests testing mass_create_tool.py functionality. * Django 5 migration (sio2project#483) * Fix: Use `line.fields|length` in fieldset.html and change GET to POST in test_invalidated_user_logout * Fix: Change `pytest.mark.optionalhook` to `pytest.hookimpl(optionalhook=True)` * Fix: Django deprecations (DEFAULT_FILE_STORAGE, index_together) * Bump django-compressor from `>=4.3,<4.4` to `>=4.5,<4.6` * Bump django-mptt from `>=0.14,<0.15` to `>=0.16,<0.17` and update postgres to 14.17 * Fix: `Model instances passed to related filters must be saved` error in models.py * Fix: Remove `filter_horizontal` in BaseTagAdmin and bump django to 5.1.7 * Fix: Django deprecation (log_deletion, log_actions) * Fix: test_can_change_login_from_invalid and test_login_cannot_change_from_valid * Fix: Add `unlocalize` to progress percentage in task-archive-problemgroup.html * Refactor: Remove redundant `USE_L10N` in default_settings.py (due django deprecation) * Fix: Move `DATETIME_FORMAT` to custom format files * Fix: `TypeError: cannot pickle 'generator' object` error * Fix: Replace LogoutView with logout() in `not_anonymous` function * Fix: TestsSelectionForm * Fix: Add `request` lookup_allowed() (django deprecation) * Fix: Add missing migrations (due to index_together deprecation) * Fix: Migrations due `index_together` deprecation * Bump django from `5.1.7` to `o>=5.2,<5.3` * Refactor: Use admin decorators and replace `re_path` with `path` (assisted by `django-upgrade` tool) * Refactor: Remove redundant comment from setup.py * Docs: Adapt to Django 5.2 * Bump the minimum version of `pytest-django` to `4.11`, and update `django-nested-admin` to `>=4.1,<4.2` * Feat: Update migrations for index_together deprecation and add a fast migration note in UPGRADING.rst. * Fix: typo in UPGRADING.rst * Feat: Convert 're_path' to 'path' in contests/urls.py * Refactor: Use `path` instead of `re_path` in `/oioioi/statistics/urls.py` * Github Actions - Downloaded translations. (sio2project#516) Co-authored-by: SIO2 Automatic Agent <[email protected]> * Uncommited changes * add "Projekt MAP" banner * Revert "dodanie brakującego pliku" This reverts commit f64b36a. * Revert "add "Projekt MAP" banner" This reverts commit 08d1a92. * Revert "Revert "add "Projekt MAP" banner"" This reverts commit 470cec97b9cb7556a463d6518a04cc82963f0cda. * Revert "Revert "dodanie brakującego pliku"" This reverts commit bba1a2357344e98ae15d900eccb99bfd8d4aec9e. * Fix Szkopul kursy * Add missing migrations * change szkopul contact info * Add MP2024 contest controller. * Actually fix notifications * socket.io version bump (1.3.7 -> 4.7.2 !!!) * removes "request" dependency as it's long deprecated - now using the fetch API * some work towards typing and partially rewriting the javascript code * Add MAP course * Szkopul views fixes * Add map registered * Add autoscroll to task * MAP course changes * Add migrations * stop maili o 4 tej nad ranem * Changes for MP2025 * migration rename for problems * fix issue with oi migration * add missing migrations * optimised recent contests query thingy * hotfixes from deployment on 2025-05-27 * fixing broken tests * Update python to 3.11 (sio2project#519) * Multiple additional admin operations for Problem model (sio2project#511) * Add assigning to a round * Improve appearance and handle edge cases * Add tests for assigning problems to rounds * Add safer handling of problem_ids * Add better test coverage * Fix test_bad_problem_ids * Add tests for managing problems from another contest * Handle reattaching problems safer * Fix small issue with tests * Include twalen's suggestions * Changes from deployment (sio2project#524) --------- Co-authored-by: reivvax <[email protected]> Co-authored-by: Kamil Szymczak <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: SIO2 Automatic Agent <[email protected]> Co-authored-by: Atanazy Gawrysiak <[email protected]> Co-authored-by: Grzegorz Franciszek Krawczyk <[email protected]> Co-authored-by: Kamil Szymczak <[email protected]> Co-authored-by: kyepskee <[email protected]> Co-authored-by: Franciszek Czauderna <[email protected]> Co-authored-by: Mateusz Jacniacki <[email protected]> Co-authored-by: Zonkil <[email protected]> Co-authored-by: Iteron-dev <[email protected]> Co-authored-by: Maciej Dziurzyński <[email protected]> Co-authored-by: Iteron-dev <[email protected]> Co-authored-by: sio2 <[email protected]> Co-authored-by: Tomasz Waleń <[email protected]> Co-authored-by: MasloMaslane <[email protected]> Co-authored-by: tkwiatkowski <[email protected]> Co-authored-by: Meten <[email protected]>
1 parent fb70679 commit f2b0bc5

File tree

206 files changed

+7484
-1728
lines changed

Some content is hidden

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

206 files changed

+7484
-1728
lines changed

.github/workflows/cypress.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
timeout-minutes: 60
1414

1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
- name: Install `easy_toolbox.py` requirements
1818
run: |
1919
python -m pip install --upgrade pip

.github/workflows/doc.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v3
13-
- name: Set up Python 3.10
14-
uses: actions/setup-python@v4
12+
- uses: actions/checkout@v4
13+
- name: Set up Python 3.11
14+
uses: actions/setup-python@v5
1515
with:
16-
python-version: '3.10'
16+
python-version: '3.11'
1717

1818
- name: Install apt dependencies
1919
run: |

.github/workflows/nightly.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v3
15-
- name: Set up Python 3.10
16-
uses: actions/setup-python@v4
14+
- uses: actions/checkout@v4
15+
- name: Set up Python 3.11
16+
uses: actions/setup-python@v5
1717
with:
18-
python-version: '3.10'
18+
python-version: '3.11'
1919

2020
- name: Install apt dependencies
2121
run: |

.github/workflows/pytest.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v3
17-
- name: Set up Python 3.10
18-
uses: actions/setup-python@v4
16+
- uses: actions/checkout@v4
17+
- name: Set up Python 3.11
18+
uses: actions/setup-python@v5
1919
with:
20-
python-version: '3.10'
20+
python-version: '3.11'
2121

2222
- name: Install apt dependencies
2323
run: |

.github/workflows/translations-download.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- uses: actions/checkout@v3
20-
- name: Set up Python 3.10
21-
uses: actions/setup-python@v4
19+
- uses: actions/checkout@v4
20+
- name: Set up Python 3.11
21+
uses: actions/setup-python@v5
2222
with:
23-
python-version: '3.10'
23+
python-version: '3.11'
2424

2525
- name: Install apt dependencies
2626
run: |

.github/workflows/translations-upload.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- uses: actions/checkout@v3
20-
- name: Set up Python 3.10
21-
uses: actions/setup-python@v4
19+
- uses: actions/checkout@v4
20+
- name: Set up Python 3.11
21+
uses: actions/setup-python@v5
2222
with:
23-
python-version: '3.10'
23+
python-version: '3.11'
2424

2525
- name: Install apt dependencies
2626
run: |

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.10 AS base
1+
FROM python:3.11 AS base
22

33
ENV PYTHONUNBUFFERED 1
44

@@ -56,7 +56,7 @@ USER oioioi
5656
ENV PATH $PATH:/home/oioioi/.local/bin/
5757

5858
ENV BERKELEYDB_DIR /usr
59-
RUN pip3 install --user psycopg2-binary==2.8.6 twisted uwsgi
59+
RUN pip3 install --user psycopg2-binary==2.9.5 twisted uwsgi
6060
RUN pip3 install --user bsddb3==6.2.7
6161

6262
WORKDIR /sio2/oioioi
@@ -82,7 +82,7 @@ WORKDIR /sio2/deployment
8282
RUN mkdir -p /sio2/deployment/logs/{supervisor,runserver}
8383

8484
# The stage below is independent of base and can be built in parallel to optimize build time.
85-
FROM python:3.10 AS development-sandboxes
85+
FROM python:3.11 AS development-sandboxes
8686

8787
ENV DOWNLOAD_DIR=/sio2/sandboxes
8888
ENV MANIFEST_URL=https://downloads.sio2project.mimuw.edu.pl/sandboxes/Manifest

UPGRADING.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,35 @@ Then run::
1212

1313
and restart the judging machines.
1414

15+
Fast Django Migration to 5.2 (Important for Large OIOIOI Instances)
16+
-----------------------------------
17+
18+
The following migrations require removing an index (created by the deprecated ``index_together``) and creating a new one:
19+
20+
* ``oi/migrations/0008_sync_indexes_state.py``
21+
* ``forum/migrations/0013_sync_indexes_state.py``
22+
* ``contests/migrations/0021_sync_indexes_state.py``
23+
24+
Since dropping and then creating an index takes a long time for instances with a very large number of submissions, you can speed this up as follows:
25+
26+
Because these indexes are in the database schema, you should mark these migrations (``0008_sync_indexes_state.py``, ``0021_sync_indexes_state.py``, ``0013_sync_indexes_state.py``) as fake.
27+
See the `django docs <https://docs.djangoproject.com/en/5.2/ref/django-admin/#cmdoption-migrate-fake>`_ for details.
28+
Then, rename the existing indexes created by ``IndexTogether`` to the corresponding names specified in these migrations.
29+
You can manually identify the indexes by checking which two fields they cover.
30+
31+
For example, an index named ``forum_post_thread_id_add_date_6d8ec21d_idx`` should be renamed to ``forum_post_thread__54acb8_idx``.
32+
Similarly, rename the other indexes so that the database state is correct, i.e., the database contains indexes with the names specified in the migrations.
33+
34+
After these steps, you will achieve a consistent database state without waiting a long time for the migrations to complete.
35+
36+
::
37+
38+
python manage.py migrate oi 0008 --fake
39+
40+
python manage.py migrate forum 0021 --fake
41+
42+
python manage.py migrate contests 0013 --fake
43+
1544
Changes in the deployment directory
1645
-----------------------------------
1746

conftest.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44

55
from oioioi.base.tests import pytest_plugin as base_plugin
66
from oioioi.contests.tests import pytest_plugin as contests_plugin
7+
from django.conf import settings
78

89

910
def pytest_addoption(parser):
1011
parser.addoption(
1112
'--runslow', action='store_true', default=False, help="run slow tests"
1213
)
14+
parser.addoption(
15+
'--strict-template-vars', action='store_true', help="Raise errors for undefined template variables")
1316

1417

1518
# called for running each test
@@ -18,6 +21,12 @@ def pytest_runtest_setup(item):
1821
base_plugin.pytest_runtest_setup(item)
1922

2023

24+
def pytest_configure(config):
25+
if config.getoption("--strict-template-vars"):
26+
# this will raise an error if a template variable is not defined
27+
settings.TEMPLATES[0]['OPTIONS']['string_if_invalid'] = '{% templatetag openvariable %} INVALID_VAR: %s {% templatetag closevariable %}'
28+
29+
2130
def pytest_collection_modifyitems(config, items):
2231
# --runslow flag: do not skip slow tests
2332
if config.getoption('--runslow', False):
@@ -29,12 +38,12 @@ def pytest_collection_modifyitems(config, items):
2938

3039

3140
# Removing links column from html report
32-
@pytest.mark.optionalhook
41+
@pytest.hookimpl(optionalhook=True)
3342
def pytest_html_results_table_header(cells):
3443
cells.pop()
3544

3645

3746
# Removing links column from html report
38-
@pytest.mark.optionalhook
47+
@pytest.hookimpl(optionalhook=True)
3948
def pytest_html_results_table_row(report, cells):
4049
cells.pop()

docker-compose-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ x-common-envs: &common-envs
55

66
services:
77
db:
8-
image: library/postgres:12.2
8+
image: library/postgres:14.17
99
environment:
1010
POSTGRES_USER: "oioioi"
1111
POSTGRES_PASSWORD: "password"

0 commit comments

Comments
 (0)