Skip to content

Commit

Permalink
merge v1.0.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie authored Aug 8, 2024
2 parents 47ef9dc + 32f0abb commit 42d2732
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 40 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,32 @@ Changelog for the **SODAR Core** Django app package. Loosely follows the
`Keep a Changelog <http://keepachangelog.com/en/1.0.0/>`_ guidelines.


v1.0.1 (2024-08-08)
===================

Added
-----

- **Projectroles**
- Previously removed ``BatchUpdateRolesMixin`` (#1464)

Changed
-------

- **General**
- Upgrade minimum Django version to v4.2.15 (#1466)
- **Timeline**
- Rename search item category to ``Timeline Events`` (#1465)

Fixed
-----

- **Projectroles**
- ``BatchUpdateRolesMixin`` removal breaking tests in other repos (#1464)
- **Timeline**
- Deprecated link dict ``blank`` field assumed as mandatory (#1462)


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

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ and breaking changes are possible.

.. code-block:: console
pip install django-sodar-core==1.0.0
pip install django-sodar-core==1.0.1
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
4 changes: 2 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
"codeRepository": "https://github.com/bihealth/sodar-core",
"datePublished": "2023-12-06",
"dateModified": "2023-12-06",
"dateCreated": "2024-07-19",
"dateCreated": "2024-08-08",
"description": "SODAR Core: A Django-based framework for scientific data management and analysis web apps",
"keywords": "Python, Django, scientific data managmenent, software library",
"license": "MIT",
"title": "SODAR Core",
"version": "v1.0.0"
"version": "v1.0.1"
}
2 changes: 1 addition & 1 deletion docs/source/app_projectroles_integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ release tag or commit ID.

.. code-block:: console
django-sodar-core==1.0.0
django-sodar-core==1.0.1
Install the requirements for development:

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# The short X.Y version
version = '1.0'
# The full version, including alpha/beta/rc tags
release = '1.0.0'
release = '1.0.1'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ the package is under active development and breaking changes are expected.

.. code-block:: console
pip install django-sodar-core==1.0.0
pip install django-sodar-core==1.0.1
Please note that the django-sodar-core package only installs
:term:`Django apps<Django App>`, which you need to include in a
Expand Down
19 changes: 19 additions & 0 deletions docs/source/major_changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,25 @@ older SODAR Core version. For a complete list of changes in current and previous
releases, see the :ref:`full changelog<changelog>`.


v1.0.1 (2024-08-08)
*******************

Release Highlights
==================

- Add erroneously removed BatchUpdateRolesMixin test helper
- Fix handling of deprecated "blank" field in timeline object links
- General bug fixes and minor updates

Breaking Changes
================

System Prerequisites
--------------------

The minimum Django version has been bumped to v4.2.15.


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

Expand Down
77 changes: 46 additions & 31 deletions projectroles/tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,31 @@
LDAP_DOMAIN = 'EXAMPLE'


# Mixins -----------------------------------------------------------------------


class BatchUpdateRolesMixin:
"""
Helpers for batchupdateroles testing.
NOTE: May be needed by external repos for testing, do not remove!
"""

file = None

def write_file(self, data):
"""Write data to temporary CSV file"""
if not isinstance(data[0], list):
data = [data]
self.file.write(
bytes('\n'.join([';'.join(r) for r in data]), encoding='utf-8')
)
self.file.close()


# Tests ------------------------------------------------------------------------


class TestAddRemoteSite(
ProjectMixin,
RoleMixin,
Expand Down Expand Up @@ -231,19 +256,11 @@ class TestBatchUpdateRoles(
RoleMixin,
RoleAssignmentMixin,
ProjectInviteMixin,
BatchUpdateRolesMixin,
TestCase,
):
"""Tests for batchupdateroles command"""

def _write_file(self, data):
"""Write data to temporary CSV file"""
if not isinstance(data[0], list):
data = [data]
self.file.write(
bytes('\n'.join([';'.join(r) for r in data]), encoding='utf-8')
)
self.file.close()

def setUp(self):
super().setUp()
# Init roles
Expand Down Expand Up @@ -288,7 +305,7 @@ def test_invite(self):
email = '[email protected]'
self.assertEqual(ProjectInvite.objects.count(), 0)

self._write_file([self.project_uuid, email, PROJECT_ROLE_GUEST])
self.write_file([self.project_uuid, email, PROJECT_ROLE_GUEST])
self.command.handle(
**{'file': self.file.name, 'issuer': self.user_owner.username}
)
Expand All @@ -307,7 +324,7 @@ def test_invite_existing(self):
self.make_invite(email, self.project, self.role_guest, self.user_owner)
self.assertEqual(ProjectInvite.objects.count(), 1)

self._write_file([self.project_uuid, email, PROJECT_ROLE_GUEST])
self.write_file([self.project_uuid, email, PROJECT_ROLE_GUEST])
self.command.handle(
**{'file': self.file.name, 'issuer': self.user_owner.username}
)
Expand All @@ -325,7 +342,7 @@ def test_invite_multi_user(self):
[self.project_uuid, email, PROJECT_ROLE_GUEST],
[self.project_uuid, email2, PROJECT_ROLE_GUEST],
]
self._write_file(fd)
self.write_file(fd)
self.command.handle(
**{'file': self.file.name, 'issuer': self.user_owner.username}
)
Expand All @@ -342,7 +359,7 @@ def test_invite_multi_project(self):
[self.category_uuid, email, PROJECT_ROLE_GUEST],
[self.project_uuid, email, PROJECT_ROLE_GUEST],
]
self._write_file(fd)
self.write_file(fd)
# NOTE: Using user_owner_cat as they have perms for both projects
self.command.handle(
**{'file': self.file.name, 'issuer': self.user_owner_cat.username}
Expand All @@ -358,7 +375,7 @@ def test_invite_multi_project(self):

def test_invite_owner(self):
"""Test inviting an owner (should fail)"""
self._write_file(
self.write_file(
[self.project_uuid, '[email protected]', PROJECT_ROLE_OWNER]
)
self.command.handle(
Expand All @@ -369,7 +386,7 @@ def test_invite_owner(self):

def test_invite_delegate(self):
"""Test inviting a delegate"""
self._write_file(
self.write_file(
[self.project_uuid, '[email protected]', PROJECT_ROLE_DELEGATE]
)
self.command.handle(
Expand All @@ -383,7 +400,7 @@ def test_invite_delegate_no_perms(self):
"""Test inviting a delegate without perms (should fail)"""
user_delegate = self.make_user('delegate')
self.make_assignment(self.project, user_delegate, self.role_delegate)
self._write_file(
self.write_file(
[self.project_uuid, '[email protected]', PROJECT_ROLE_DELEGATE]
)
self.command.handle(
Expand All @@ -396,7 +413,7 @@ def test_invite_delegate_limit(self):
"""Test inviting a delegate with limit reached (should fail)"""
user_delegate = self.make_user('delegate')
self.make_assignment(self.project, user_delegate, self.role_delegate)
self._write_file(
self.write_file(
[self.project_uuid, '[email protected]', PROJECT_ROLE_DELEGATE]
)
self.command.handle(
Expand All @@ -413,7 +430,7 @@ def test_role_add(self):
user_new.save()
self.assertEqual(ProjectInvite.objects.count(), 0)

self._write_file([self.project_uuid, email, PROJECT_ROLE_GUEST])
self.write_file([self.project_uuid, email, PROJECT_ROLE_GUEST])
self.command.handle(
**{'file': self.file.name, 'issuer': self.user_owner.username}
)
Expand All @@ -439,7 +456,7 @@ def test_role_update(self):
1,
)

self._write_file([self.project_uuid, email, PROJECT_ROLE_CONTRIBUTOR])
self.write_file([self.project_uuid, email, PROJECT_ROLE_CONTRIBUTOR])
self.command.handle(
**{'file': self.file.name, 'issuer': self.user_owner.username}
)
Expand All @@ -455,7 +472,7 @@ def test_role_update_owner(self):
self.user_owner.email = email
self.user_owner.save()

self._write_file([self.project_uuid, email, PROJECT_ROLE_CONTRIBUTOR])
self.write_file([self.project_uuid, email, PROJECT_ROLE_CONTRIBUTOR])
self.command.handle(
**{'file': self.file.name, 'issuer': self.user_owner.username}
)
Expand All @@ -482,7 +499,7 @@ def test_role_update_delegate_no_perms(self):
user_delegate = self.make_user('delegate')
self.make_assignment(self.project, user_delegate, self.role_delegate)

self._write_file([self.project_uuid, email, PROJECT_ROLE_DELEGATE])
self.write_file([self.project_uuid, email, PROJECT_ROLE_DELEGATE])
self.command.handle(
**{'file': self.file.name, 'issuer': user_delegate.username}
)
Expand All @@ -502,7 +519,7 @@ def test_role_update_delegate_limit(self):
user_delegate = self.make_user('delegate')
self.make_assignment(self.project, user_delegate, self.role_delegate)

self._write_file([self.project_uuid, email, PROJECT_ROLE_DELEGATE])
self.write_file([self.project_uuid, email, PROJECT_ROLE_DELEGATE])
self.command.handle(
**{'file': self.file.name, 'issuer': self.user_owner.username}
)
Expand All @@ -514,7 +531,7 @@ def test_role_update_delegate_limit(self):

def test_role_add_inherited_owner(self):
"""Test adding role with inherited owner rank (should fail)"""
self._write_file(
self.write_file(
[
self.project_uuid,
self.user_owner_cat.email,
Expand All @@ -540,7 +557,7 @@ def test_role_add_inherited_higher(self):
user_new.email = '[email protected]'
self.make_assignment(self.category, user_new, self.role_guest)

self._write_file(
self.write_file(
[
self.project_uuid,
user_new.email,
Expand All @@ -566,7 +583,7 @@ def test_role_add_inherited_equal(self):
user_new.email = '[email protected]'
self.make_assignment(self.category, user_new, self.role_contributor)

self._write_file(
self.write_file(
[
self.project_uuid,
user_new.email,
Expand All @@ -592,9 +609,7 @@ def test_role_add_inherited_lower(self):
user_new.email = '[email protected]'
self.make_assignment(self.category, user_new, self.role_contributor)

self._write_file(
[self.project_uuid, user_new.email, PROJECT_ROLE_GUEST]
)
self.write_file([self.project_uuid, user_new.email, PROJECT_ROLE_GUEST])
self.command.handle(
**{'file': self.file.name, 'issuer': self.user_owner.username}
)
Expand All @@ -621,7 +636,7 @@ def test_invite_and_update(self):
[self.project_uuid, email, PROJECT_ROLE_GUEST],
[self.project_uuid, email2, PROJECT_ROLE_GUEST],
]
self._write_file(fd)
self.write_file(fd)
self.command.handle(
**{'file': self.file.name, 'issuer': self.user_owner.username}
)
Expand All @@ -641,7 +656,7 @@ def test_command_no_issuer(self):
admin.is_superuser = True
admin.save()
email = '[email protected]'
self._write_file([self.project_uuid, email, PROJECT_ROLE_GUEST])
self.write_file([self.project_uuid, email, PROJECT_ROLE_GUEST])
self.command.handle(**{'file': self.file.name, 'issuer': None})
invite = ProjectInvite.objects.first()
self.assertEqual(invite.issuer, admin)
Expand All @@ -650,7 +665,7 @@ def test_command_no_perms(self):
"""Test invite with issuer who lacks permissions for a project"""
issuer = self.make_user('issuer')
email = '[email protected]'
self._write_file([self.project_uuid, email, PROJECT_ROLE_GUEST])
self.write_file([self.project_uuid, email, PROJECT_ROLE_GUEST])
self.command.handle(
**{'file': self.file.name, 'issuer': issuer.username}
)
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ setuptools>=70.0.0, <70.1
packaging>=23.2, <24.0

# Django
django>=4.2.14, <5.0
django>=4.2.15, <5.0

# Configuration
django-environ>=0.11.2, <0.12
Expand Down
2 changes: 1 addition & 1 deletion timeline/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def _get_ref_description(cls, event, ref_label, app_plugin, request):
link = PluginObjectLink(
url=link['url'],
name=link['label'],
blank=link['blank'],
blank=link.get('blank', False),
)
if not link.name:
logger.warning(
Expand Down
2 changes: 1 addition & 1 deletion timeline/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def search(self, search_terms, user, search_type=None, keywords=None):
items = [e for e in events if self.check_permission(user, e)]
ret = PluginSearchResult(
category='all',
title='Timeline Event',
title='Timeline Events',
search_types=['timeline'],
items=items,
)
Expand Down

0 comments on commit 42d2732

Please sign in to comment.