Skip to content

Commit

Permalink
merge v1.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie authored Jul 19, 2024
2 parents be012e5 + 9d52958 commit 47ef9dc
Show file tree
Hide file tree
Showing 214 changed files with 16,868 additions and 7,348 deletions.
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/release_cleanup.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ TBA
- [ ] Review code style and cleanup if needed
- [ ] Review and update doc entries if needed
- [ ] Ensure all relevant updates are in `CHANGELOG` and major changes doc
- [ ] Ensure new version is in `CORE_API_ALLOWED_VERSIONS`
- [ ] Ensure REST API versions are up to date and documented
- [ ] Upgrade version number of pypi package references in `README` and docs
- [ ] Upgrade docs config version number (usually at `x.y.z-WIP` when developing)
- [ ] Update latest version info in `codemeta.json`
- [ ] Update version number and date in `CHANGELOG`
- [ ] Update version number and date in `Major Changes` doc
- [ ] Ensure docs can be built without errors
- [ ] Ensure `generateschema` runs without errors or warnings (until in CI)

## Notes

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
strategy:
matrix:
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
services:
postgres:
image: postgres:11
image: postgres:16
env:
POSTGRES_DB: sodar_core
POSTGRES_USER: sodar_core
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
run: git fetch --prune --unshallow
- name: Install project Python dependencies
run: |
pip install "wheel>=0.38.4, <0.39"
pip install "wheel>=0.42.0, <0.43"
pip install -r requirements/local.txt
pip install -r requirements/test.txt
- name: Download icons
Expand All @@ -58,13 +58,13 @@ jobs:
coverage report
- name: Check linting
run: flake8 .
if: ${{ matrix.python-version == '3.8' }}
if: ${{ matrix.python-version == '3.11' }}
- name: Check formatting
run: make black arg=--check
if: ${{ matrix.python-version == '3.8' }}
if: ${{ matrix.python-version == '3.11' }}
- name: Report coverage with Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: './coverage.lcov'
if: ${{ matrix.python-version == '3.8' }}
if: ${{ matrix.python-version == '3.11' }}
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
image: python:3.8
image: python:3.11

services:
- postgres:11
- postgres:16

variables:
POSTGRES_DB: sodar_core
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version: 2
build:
os: ubuntu-20.04
tools:
python: '3.8'
python: '3.11'

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
144 changes: 144 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,150 @@ Changelog for the **SODAR Core** Django app package. Loosely follows the
`Keep a Changelog <http://keepachangelog.com/en/1.0.0/>`_ guidelines.


v1.0.0 (2024-07-19)
===================

Added
-----

- **General**
- Python v3.11 support (#1157)
- Flake8 rule in ``Makefile`` (#1387)
- OpenID Connect (OIDC) authentication support (#1367)
- **Adminalerts**
- Admin alert email sending (#415)
- ``notify_email_alert`` app setting (#415)
- **Filesfolders**
- Optional pagination for REST API list views (#1313)
- **Projectroles**
- ``full_title`` field in ``ProjectSerializer`` and API views (#1314)
- Custom password argument in ``createdevusers`` management command (#1393)
- ``PluginObjectLink`` data class in plugins (#1343)
- ``PluginSearchResult`` data class in plugins (#1399)
- Target user ``sodar_uuid`` updating in remote sync (#1316, #1317)
- Update local user data in remote sync (#1407)
- ``USER`` scope settings in remote sync (#1322)
- ``AppLinkContent`` utility class (#1380, #1381)
- ``checkusers`` management command (#1410)
- ``SODARPageNumberPagination`` pagination class (#1313)
- Optional pagination for REST API list views (#1313)
- Email notification opt-out settings (#1417, #1418)
- CC and BCC field support in sending generic emails (#415)
- ``SODARUserAdditionalEmail`` model (#874)
- ``is_source_site()`` and ``is_target_site()`` rule predicates
- ``settings_link`` kwarg in ``send_generic_email()`` (#1418)
- ``addremotesite`` and ``syncgroups`` command tests (#352)
- ``RemoteSite.owner_modifiable`` field (#817)
- ``assert_displayed()`` UI test helper
- ``RemoteProjectAccessAjaxView`` Ajax view (#1358)
- Remote project access status updating in project detail view (#1358)
- ``SidebarContentAjaxView`` for sidebar and project dropdown content retrieval (#1366)
- ``UserDropdownContentAjaxView`` for user dropdown content retrieval (#1366, #1392)
- ``SODARUser.get_auth_type()`` helper (#1367)
- ``ProjectInvite.is_ldap()`` helper (#1367)
- ``AppSettingAPI.is_set()`` helper (#1450)
- ``checks`` module for Django checks (#504)
- Django check for enabled auth methods (#1451)
- **Timeline**
- ``sodar_uuid`` field in ``TimelineEventObjectRef`` model (#1415)
- REST API views (#1350)
- ``get_project()`` helpers in ``TimelineEvent`` and ``TimelineEventObjectRef`` (#1350)
- Optional pagination for REST API list views (#1313)
- **Userprofile**
- Additional email address management and verification (#874)

Changed
-------

- **General**
- Upgrade to Django v4.2 (#880)
- Upgrade minimum PostgreSQL version to v12 (#1074)
- Upgrade to PostgreSQL v16 in CI (#1074)
- Upgrade general Python dependencies (#1374)
- Reformat with black v24.3.0 (#1374)
- Update download URL in ``get_chromedriver_url.py`` (#1385)
- Add ``AUTH_LDAP_USER_SEARCH_BASE`` as a Django setting (#1410)
- Change ``ATOMIC_REQUESTS`` recommendation and default to ``True`` (#1281)
- Add OpenAPI dependencies (#1444)
- Squash migrations (#1446)
- **Filesfolders**
- Add migration required by Django v4.2 (#1396)
- Add app specific media type and versioning (#1278)
- **Projectroles**
- Rename ``AppSettingAPI`` ``app_name`` arguments to ``plugin_name`` (#1285)
- Default password in ``createdevusers`` management command (#1390)
- Deprecate ``local`` in app settings, use ``global`` instead (#1319)
- Enforce optional handling of app settings ``global`` attributes (#1395)
- Expect ``get_object_link()`` plugin methods to return ``PluginObjectLink`` (#1343)
- Deprecate returning ``dict`` from ``get_object_link()`` (#1343)
- Expect ``search()`` plugin methods to return list of ``PluginSearchResult`` objects (#1399)
- Deprecate returning ``dict`` from ``search()`` (#1399)
- Update core API view media type and versioning (#1278, #1406)
- Separate projectroles and remote sync API media types and versioning (#1278)
- Rename base test classes for consistency (#1259)
- Prevent setting global user app settings on target site in ``AppSettingAPI`` (#1329)
- Move project app link logic in ``AppLinkContent`` (#1380)
- Move user dropdown link logic in ``AppLinkContent`` (#1381, #1413)
- Do not recreate ``AppSetting`` objects on remote sync update (#1409)
- Enforce project and site uniqueness in ``RemoteProject`` model (#1433)
- Remove redundant permission check in ``project_detail.html`` (#1438)
- Move sidebar, project dropdown and user dropdown creation to ``utils`` (#1366)
- Refactor ``ProjectInviteProcessMixin.get_invite_type()`` into ``ProjectInvite.is_ldap()`` (#1367)
- **Sodarcache**
- Rewrite REST API views (#498, #1389)
- Raise ``update_cache()`` exception for ``synccache`` in debug mode (#1375)
- **Timeline**
- Update ``get_object_link()`` usage for ``PluginObjectLink`` return data (#1343)
- Rename ``ProjectEvent*`` models to ``TimelineEvent*`` (#1414)
- Move event name from separate column into badge (#1370)
- Use constants for event status types (#973)
- **Userprofile**
- Disable global user settings on target site in ``UserSettingsForm`` (#1329)

Fixed
-----

- **General**
- ``README.rst`` badge rendering (#1402)
- **Filesfolders**
- OpenAPI ``generateschema`` errors and warnings (#1442)
- **Projectroles**
- ``SODARUser.update_full_name()`` not working with existing name (#1371)
- Legacy public guest access in child category breaks category updating (#1404)
- Incorrect DAL widget highlight colour after upgrade (#1412)
- ``ProjectStarringAjaxView`` creating redundant database objects (#1416)
- ``addremotesite`` crash in ``TimelineAPI.add_event()`` (#1425)
- ``addremotesite`` allows creation of site with mode identical to host (#1426)
- Public guest access field not correctly hidden in project form (#1429)
- Revoked remote projects displayed in project detail view (#1432)
- Invalid URLs for remote peer projects in project detail view (#1435)
- Redundant ``Project.get_source_site()`` calls in project detail view (#1436)
- ``RemoteSite.get_access_date()`` invalid date sorting (#1437)
- OpenAPI ``generateschema`` compatibility (#1440, #1442)
- ``ProjectCreateView`` allows ``POST`` with disabled target project creation (#1448)
- Plugin existence not explicitly checked in ``AppSettingAPI.set()`` update query (#1452)
- ``search_advanced.html`` header layout (#1453)
- **Sodarcache**
- REST API set view ``app_name`` incorrectly set (#1405)
- **Timeline**
- OpenAPI ``generateschema`` warnings (#1442)

Removed
-------

- **General**
- SAML support (#1368)
- Python v3.8 support (#1382)
- **Projectroles**
- ``PROJECTROLES_HIDE_APP_LINKS`` setting (#1143)
- ``CORE_API_*`` Django settings (#1278)
- Project starring timeline event creation (#1294)
- ``user_email_additional`` app setting (#874)
- ``get_visible_projects()`` template tag (#1432)
- App setting value max length limit (#1443)
- Redundant project permission in ``UserSettingRetrieveAPIView`` (#1449)


v0.13.4 (2024-02-16)
====================

Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ define USAGE=
@echo -e
@echo -e "Usage:"
@echo -e "\tmake black [arg=--<arg>] -- black formatting"
@echo -e "\tmake flake -- run flake8"
@echo -e "\tmake celery -- start celery worker"
@echo -e "\tmake serve -- start source server"
@echo -e "\tmake serve_target -- start target server"
Expand All @@ -25,6 +26,11 @@ black:
black . -l 80 --skip-string-normalization --exclude ".git|.venv|.tox|build|env|src|docs|migrations|versioneer.py" $(arg)


.PHONY: flake
flake:
flake8 .


.PHONY: celery
celery:
celery -A config worker -l info --beat
Expand Down
18 changes: 10 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
SODAR Core
^^^^^^^^^^

.. image:: https://badge.fury.io/py/django-sodar-core.svg
.. |b1| image:: https://badge.fury.io/py/django-sodar-core.svg
:target: https://badge.fury.io/py/django-sodar-core

.. image:: https://github.com/bihealth/sodar-core/actions/workflows/build.yml/badge.svg
.. |b2| image:: https://github.com/bihealth/sodar-core/actions/workflows/build.yml/badge.svg
:target: https://github.com/bihealth/sodar-core/actions?query=workflow%3ABuild

.. image:: https://coveralls.io/repos/github/bihealth/sodar-core/badge.svg?branch=main
.. |b3| image:: https://coveralls.io/repos/github/bihealth/sodar-core/badge.svg?branch=main
:target: https://coveralls.io/github/bihealth/sodar-core?branch=main

.. image:: https://img.shields.io/badge/License-MIT-green.svg
.. |b4| image:: https://img.shields.io/badge/License-MIT-green.svg
:target: https://opensource.org/licenses/MIT

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
.. |b5| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/ambv/black

.. image:: https://readthedocs.org/projects/sodar-core/badge/?version=latest
.. |b6| image:: https://readthedocs.org/projects/sodar-core/badge/?version=latest
:target: https://sodar-core.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4269346.svg
.. |b7| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4269346.svg
:target: https://doi.org/10.5281/zenodo.4269346

|b1| |b2| |b3| |b4| |b5| |b6| |b7|

SODAR Core is a framework for Django web application development.

It was conceived to facilitate the creation of scientific data management and
Expand Down Expand Up @@ -115,7 +117,7 @@ and breaking changes are possible.

.. code-block:: console
pip install django-sodar-core==0.13.4
pip install django-sodar-core==1.0.0
For installing a development version you can point your dependency to a specific
commit ID in GitHub. Note that these versions may not be stable.
Expand Down
22 changes: 19 additions & 3 deletions adminalerts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,28 @@
from adminalerts.models import AdminAlert


# Local constants
EMAIL_HELP_CREATE = 'Send alert as email to all users on this site'
EMAIL_HELP_UPDATE = 'Send updated alert as email to all users on this site'


class AdminAlertForm(SODARModelForm):
"""Form for AdminAlert creation/updating"""

send_email = forms.BooleanField(
initial=True,
label='Send alert as email',
required=False,
)

class Meta:
model = AdminAlert
fields = [
'message',
'date_expire',
'active',
'require_auth',
'send_email',
'description',
]

Expand All @@ -40,13 +52,17 @@ def __init__(self, current_user=None, *args, **kwargs):

# Creation
if not self.instance.pk:
self.fields[
'date_expire'
].initial = timezone.now() + timezone.timedelta(days=1)
self.initial['date_expire'] = timezone.now() + timezone.timedelta(
days=1
)
self.fields['send_email'].help_text = EMAIL_HELP_CREATE
# Updating
else: # self.instance.pk
# Set description value as raw markdown
self.initial['description'] = self.instance.description.raw
self.fields['send_email'].help_text = EMAIL_HELP_UPDATE
# Sending email for update should be false by default
self.initial['send_email'] = False

def clean(self):
"""Custom form validation and cleanup"""
Expand Down
Loading

0 comments on commit 47ef9dc

Please sign in to comment.