Skip to content

Commit c808804

Browse files
authored
Merge pull request #233 from qld-gov-au/QOLDEV-1221-update-to-2.11.4
[QOLDEV-1221] apply QGOV changes on top of 2.11.4 base
2 parents 882f16b + e71383e commit c808804

24 files changed

Lines changed: 724 additions & 98 deletions

File tree

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ defaults:
2424
CKAN_POSTGRES_USER: ckan_default
2525
CKAN_POSTGRES_PWD: pass
2626
PGPASSWORD: ckan
27-
PYTEST_COMMON_OPTIONS: -v --ckan-ini=test-core-circle-ci.ini --cov=ckan --cov=ckanext --junitxml=~/junit/result/junit.xml
27+
PYTEST_COMMON_OPTIONS: -v --ckan-ini=test-core-ci.ini --cov=ckan --cov=ckanext --junitxml=~/junit/result/junit.xml
2828
# report usage of deprecated features
2929
SQLALCHEMY_WARN_20: 1
3030
pg_image: &pg_image

.github/workflows/docs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,10 @@ jobs:
3131
- name: Create Docs
3232
run: |
3333
sphinx-build doc build/sphinx
34+
35+
#as pytest runs test_building_the_docs, we might as well have an output
36+
- name: Store docs
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: ckan-docs-${{ github.sha }}
40+
path: ./build/sphinx

CHANGELOG.rst

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,35 @@ Changelog
99

1010
.. towncrier release notes start
1111
12+
v.2.11.x 2025-xx-xx
13+
==================
14+
15+
Major features
16+
--------------
17+
18+
- Update to Interface IUploader, on get_uploader and get_resource_uploader,
19+
new to include new method signature metadata() which can be utilised by
20+
archiver and other plugins instead of trying on local disk directly
21+
- Add get API `resource_file_metadata_show` which takes resource ID and returns
22+
{ 'content_type': content_type, 'size': length, 'hash': hash } if found
23+
- Show "Displayed name" instead of "Full name"
24+
- Allow sysadmins to see user emails on profile pages
25+
- Allow the existence of deleted datasets to be hidden from unauthorised access
26+
even if private datasets are revealed
27+
- Delete file on disk when resource is deleted
28+
- Provide 'Add resource' shortcut on dataset pages alongside 'Manage'
29+
30+
Bugfixes
31+
--------
32+
33+
- Convert dict values into strings before passing to Solr
34+
- Add '/dataset' fallback when generating URLs
35+
- Avoid changing package modified timestamp when reordering resources
36+
- Shorten the lock timeout on dropping datastore tables to avoid deadlocks
37+
- Add 'en_AU' locale to DataTables
38+
- Instruct bots not to index search result pages
39+
40+
1241
v.2.11.4 2025-10-29
1342
===================
1443

@@ -1494,8 +1523,8 @@ Migration notes
14941523
in the server, all users will be logged out of the site**.
14951524
This can happen for instance:
14961525

1497-
* if the CKAN container is redeployed in a Docker / cloud setup and the session directory is not persisted
1498-
* if the sessions are periodically cleaned by an external script
1526+
* if the CKAN container is redeployed in a Docker / cloud setup and the session directory is not persisted
1527+
* if the sessions are periodically cleaned by an external script
14991528

15001529
Here's a summary of the behaviour changes between CKAN versions:
15011530

@@ -1518,13 +1547,13 @@ Migration notes
15181547
(note that this stores *all* session data, not just the user identifier). This will probably
15191548
be the default behaviour in future CKAN versions::
15201549

1521-
# ckan.ini
1522-
beaker.session.type = cookie
1523-
beaker.session.validate_key = CHANGE_ME
1550+
# ckan.ini
1551+
beaker.session.type = cookie
1552+
beaker.session.validate_key = CHANGE_ME
15241553

1525-
beaker.session.httponly = True
1526-
beaker.session.secure = True
1527-
beaker.session.samesite = Lax # or Strict
1554+
beaker.session.httponly = True
1555+
beaker.session.secure = True
1556+
beaker.session.samesite = Lax # or Strict
15281557

15291558
Alternatively you can configure another persistent backend for the sessions in the server,
15301559
like an SQL Database or Redis (see the `Beaker configuration <https://beaker.readthedocs.io/en/latest/configuration.html>`_
@@ -1771,14 +1800,14 @@ Migration notes
17711800
store the session data in the `client-side cookie <https://beaker.readthedocs.io/en/latest/sessions.html#cookie-based>`_.
17721801
This will probably be the default behaviour in future CKAN versions::
17731802

1774-
# ckan.ini
1775-
beaker.session.type = cookie
1803+
# ckan.ini
1804+
beaker.session.type = cookie
17761805
beaker.session.data_serializer = json
1777-
beaker.session.validate_key = CHANGE_ME
1806+
beaker.session.validate_key = CHANGE_ME
17781807

1779-
beaker.session.httponly = True
1780-
beaker.session.secure = True
1781-
beaker.session.samesite = Lax
1808+
beaker.session.httponly = True
1809+
beaker.session.secure = True
1810+
beaker.session.samesite = Lax
17821811
# or Strict, depending on your setup
17831812

17841813
v.2.9.8 2023-02-15

ckan/config/config_declaration.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,19 @@ groups:
619619
If False, all unauthorised requests will receive HTTP 404 Not Found.
620620
Default is False.
621621
622+
- key: ckan.auth.reveal_deleted_datasets
623+
type: bool
624+
default: True
625+
description: |
626+
Determines whether unauthorised requests for deleted datasets should have
627+
the existence of the datasets revealed (True) or hidden (False).
628+
This behaves similarly to ckan.auth.reveal_private_datasets; True gives
629+
either HTTP 403 Forbidden (if logged in) or a redirect to the login page,
630+
while False gives HTTP 404 Not Found. However, it will only take effect
631+
if ckan.auth.reveal_private_datasets is already True; otherwise,
632+
return HTTP 404 on unauthorised requests regardless of this value.
633+
Default is True.
634+
622635
- key: ckan.auth.enable_cookie_auth_in_api
623636
type: bool
624637
default: True

ckan/i18n/en_AU/LC_MESSAGES/ckan.po

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# Copyright (C) 2024 ORGANIZATION
33
# This file is distributed under the same license as the ckan project.
44
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
5-
#
5+
#
66
# Translators:
77
# Adrià Mercader <amercadero@gmail.com>, 2024
8-
#
8+
#
99
#, fuzzy
1010
msgid ""
1111
msgstr ""
@@ -3132,7 +3132,7 @@ msgstr "Change details"
31323132

31333133
#: ckan/templates/user/edit_user_form.html:17
31343134
msgid "Full name"
3135-
msgstr "Full name"
3135+
msgstr "Displayed name"
31363136

31373137
#: ckan/templates/user/edit_user_form.html:17
31383138
msgid "eg. Joe Bloggs"
@@ -3304,7 +3304,7 @@ msgstr "username"
33043304

33053305
#: ckan/templates/user/new_user_form.html:11
33063306
msgid "Full Name"
3307-
msgstr "Full Name"
3307+
msgstr "Displayed name"
33083308

33093309
#: ckan/templates/user/new_user_form.html:37
33103310
msgid "Create Account"
@@ -3407,7 +3407,7 @@ msgstr "Open ID"
34073407

34083408
#: ckan/templates/user/snippets/info.html:84
34093409
msgid "This means only you can see this"
3410-
msgstr "This means only you can see this"
3410+
msgstr "This means only yourself and administrators can see this"
34113411

34123412
#: ckan/templates/user/snippets/info.html:89
34133413
msgid "Member Since"

ckan/lib/helpers.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,71 @@ def _get_auto_flask_context():
325325

326326
@core_helper
327327
def url_for(*args: Any, **kw: Any) -> str:
328+
'''Return the URL for an endpoint given some parameters, defaulting to
329+
using 'dataset' if the given custom dataset fails.
330+
331+
This is a wrapper for :py:func:`flask.url_for`
332+
and :py:func:`routes.url_for` that adds some extra features that CKAN
333+
needs.
334+
335+
To build a URL for a Flask view, pass the name of the blueprint and the
336+
view function separated by a period ``.``, plus any URL parameters::
337+
url_for('api.action', ver=3, logic_function='status_show')
338+
# Returns /api/3/action/status_show
339+
340+
For a fully qualified URL pass the ``_external=True`` parameter. This
341+
takes the ``ckan.site_url`` and ``ckan.root_path`` settings into account::
342+
343+
url_for('api.action', ver=3, logic_function='status_show',
344+
_external=True)
345+
346+
# Returns http://example.com/api/3/action/status_show
347+
348+
URLs built by Pylons use the Routes syntax::
349+
350+
url_for(controller='my_ctrl', action='my_action', id='my_dataset')
351+
# Returns '/dataset/my_dataset'
352+
353+
Or, using a named route::
354+
355+
url_for('dataset.read', id='changed')
356+
# Returns '/dataset/changed'
357+
358+
Use ``qualified=True`` for a fully qualified URL when targeting a Pylons
359+
endpoint.
360+
361+
For backwards compatibility, an effort is made to support the Pylons syntax
362+
when building a Flask URL, but this support might be dropped in the future,
363+
so calls should be updated.
364+
'''
365+
try:
366+
return base_url_for(*args, **kw)
367+
except FlaskRouteBuildError:
368+
# If the url failed, try again but replace any custom dataset type in
369+
# use with the default 'dataset'
370+
retry_with_default = False
371+
# Update args if a custom dataset type was set there
372+
if (len(args) and '.' in args[0]
373+
and not args[0].startswith('/')
374+
and not args[0].startswith('dataset.')):
375+
args = args[0].split('.', 1)
376+
args = ('dataset.' + args[1],)
377+
retry_with_default = True
378+
379+
# Update kw controller if a custom dataset type was set there
380+
if (kw.get('controller')
381+
and kw.get('controller') != 'dataset'):
382+
kw.update({'controller': 'dataset'})
383+
retry_with_default = True
384+
385+
if retry_with_default:
386+
return base_url_for(*args, **kw)
387+
else:
388+
raise
389+
390+
391+
@core_helper
392+
def base_url_for(*args: Any, **kw: Any) -> str:
328393
'''Return the URL for an endpoint given some parameters.
329394
330395
This is a wrapper for :py:func:`flask.url_for`

ckan/lib/search/index.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,9 @@ def index_package(self,
236236
except DateParserError:
237237
log.warning('%r: %r value of %r is not a valid date', pkg_dict['id'], key, value)
238238
continue
239+
if isinstance(value, dict):
240+
# Solr 8+ chokes on passing dict values unless doing an atomic update
241+
value = json.dumps(value)
239242
new_dict[key] = value
240243

241244
pkg_dict = new_dict

0 commit comments

Comments
 (0)