Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3e7c467
REKDAT-262: Upgrade to CKAN 2.11.4
bzar Nov 24, 2025
c632b29
REKDAT-262: Add database preparation to test workflow
bzar Nov 24, 2025
4f5e621
REKDAT-262: Use test.ini for database init to include test SECRET_KEY
bzar Nov 24, 2025
0d1a69a
REKDAT-262: Remove ckanext-harvest db init from test workflow
bzar Nov 24, 2025
52491e5
REKDAT-262: Database initialization should not be needed in tests
bzar Nov 25, 2025
f9c0373
REKDAT-262: Update CKAN and postgres in unit tests
bzar Nov 25, 2025
cd11110
ckan-dev image requires root user
Zharktas Nov 25, 2025
193d428
REKDAT-262: Try to fix unit test workflow
bzar Nov 25, 2025
f40beb1
REKDAT-262: Update apt cache before install
bzar Nov 25, 2025
1b6ed9b
REKDAT-262: Use binary package for geos
bzar Nov 25, 2025
f3be881
REKDAT-262: Add -y to apt-get installs
bzar Nov 25, 2025
1c0038b
REKDAT-262: Add ckan database init to unit tests
bzar Nov 25, 2025
b2ace15
REKDAT-262: Init plugin databases in tests
bzar Nov 25, 2025
800dd6c
REKDAT-262: Ensure activity database tables are initialized in tests
bzar Nov 26, 2025
652f8d6
REKDAT-262: Ensure pages database tables are initialized in tests
bzar Nov 26, 2025
f9868ad
REKDAT-262: Ensure user/organization ids are valid uuid4 in tests
bzar Nov 26, 2025
a542961
REKDAT-262: Fix uuid4 serialization
bzar Nov 26, 2025
27c22e3
REKDAT-262: Disable uuid validation instead of hacking at tests
bzar Nov 26, 2025
5331e5f
REKDAT-262: Fix typos
bzar Nov 26, 2025
e5776f2
REKDAT-262: Add curl to test image
bzar Nov 26, 2025
30f3f02
REKDAT-262: PAHA IDs are valid UUID4 strings, fix tests instead of re…
bzar Dec 2, 2025
72924d1
REKDAT-262: Fix invalid organization id in test
bzar Dec 2, 2025
86bf317
REKDAT-262: Avoid installing CKAN with pip for now
bzar Dec 8, 2025
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
29 changes: 16 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,13 @@ jobs:
- detect-changes
if: ${{ needs.detect-changes.outputs.ckan == 'true' }}
container:
image: ckan/ckan-dev:2.10.3
image: ckan/ckan-dev:2.11.4
options: --user root
services:
solr:
image: ckan/ckan-solr:2.10-solr9
image: ckan/ckan-solr:2.11-solr9
postgres:
image: postgres:12
image: ckan/ckan-postgres-dev:2.11
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
Expand All @@ -153,16 +154,10 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- name: Create Database
run: |
psql --host=postgres --username=postgres --command="CREATE USER ckan_default WITH PASSWORD 'pass' NOSUPERUSER NOCREATEDB NOCREATEROLE;"
createdb --encoding=utf-8 --host=postgres --username=postgres --owner=ckan_default ckan_test
psql --host=postgres --username=postgres --command="CREATE USER datastore_write WITH PASSWORD 'pass' NOSUPERUSER NOCREATEDB NOCREATEROLE;"
psql --host=postgres --username=postgres --command="CREATE USER datastore_read WITH PASSWORD 'pass' NOSUPERUSER NOCREATEDB NOCREATEROLE;"
createdb --encoding=utf-8 --host=postgres --username=postgres --owner=datastore_write datastore_test
- name: Install requirements
run: |
apk add proj proj-dev proj-util geos
apt-get update
apt-get install -y proj-bin geos-bin
cd ckan/ckanext/ckanext-restricteddata
pip install -r dev-requirements.txt
pip install -r requirements.txt
Expand All @@ -183,18 +178,26 @@ jobs:
cd ../ckanext-markdown_editor
pip install -r requirements.txt
pip install -e .

- name: Initialize database
run: |
ckan -c ckan/ckanext/ckanext-restricteddata/test.ini db init
ckan -c ckan/ckanext/ckanext-restricteddata/test.ini db upgrade
ckan -c ckan/ckanext/ckanext-restricteddata/test.ini db upgrade -p restricteddata
ckan -c ckan/ckanext/ckanext-restricteddata/test.ini db upgrade -p pages
ckan -c ckan/ckanext/ckanext-restricteddata/test.ini db upgrade -p activity
- name: Run tests
run: pytest --ckan-ini=ckan/ckanext/ckanext-restricteddata/test.ini --cov=ckanext.restricteddata --disable-warnings ckan/ckanext/ckanext-restricteddata/ckanext/restricteddata/tests

- name: install codecov requirements
run: |
apk add gpg gpg-agent
apt-get install -y gpg gpg-agent curl

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
flags: ckan
os: alpine
os: debian
token: ${{ secrets.CODECOV_TOKEN }}

test-e2e:
Expand Down
2 changes: 1 addition & 1 deletion cdk/lib/ckan-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class CkanStack extends Stack {

const ckanContainerSecrets: { [key: string]: aws_ecs.Secret; } = {
// .env.ckan
CKAN_BEAKER_SESSION_SECRET: aws_ecs.Secret.fromSecretsManager(beakerSecret),
CKAN_SESSION_SECRET: aws_ecs.Secret.fromSecretsManager(beakerSecret),
CKAN_APP_INSTANCE_UUID: aws_ecs.Secret.fromSecretsManager(appUUIDSecret),
CKAN_BEAKER_SESSION_VALIDATE_KEY: aws_ecs.Secret.fromSecretsManager(beakerValidateKeySecret),
CKAN_PAHA_JWT_KEY: aws_ecs.Secret.fromSecretsManager(pahaJwtKeySecret),
Expand Down
5 changes: 3 additions & 2 deletions ckan/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,10 @@ RUN \
mkdir -p ${DATA_DIR} && \
# Install CKAN and requirements
pip install --find-links=/srv/app/wheels -r ${SRC_DIR}/ckan-requirements.txt && \
pip install -e git+https://github.com/ckan/ckan.git@ckan-2.10.9#egg=ckan && \
pip install -e git+https://github.com/ckan/ckan.git@ckan-2.11.4#egg=ckan && \
# Configure environment
addgroup -g 92 ckan && \
adduser -u 92 -h ${APP_DIR} -H -D -G ckan ckan && \
cp ${CKAN_DIR}/who.ini ${APP_DIR} && \
# Set timezone
echo "UTC" > /etc/timezone && \
# Change ownership to app user
Expand Down Expand Up @@ -189,6 +188,8 @@ RUN \
addgroup sudo && \
adduser ckan sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
# Add development packages required by pip-compile
apk add --no-cache postgresql-dev && \
# fix permissions
chown -R ckan:ckan ${APP_DIR}

Expand Down
2 changes: 1 addition & 1 deletion ckan/ckan-requirements.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file defines the used CKAN version and any overrides
# Compile with pip-compile to produce the ckan-requirements.txt used in build

ckan[requirements]==2.10.9
ckan[requirements]==2.11.4

# Runtime requirements
uWSGI==2.0.30
130 changes: 59 additions & 71 deletions ckan/ckan-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,70 +6,72 @@
#
--extra-index-url https://alpine-wheels.github.io/index

alembic==1.8.1
alembic==1.13.2
# via ckan
async-timeout==5.0.1
# via redis
babel==2.10.3
async-timeout==4.0.3
# via
# ckan
# redis
babel==2.15.0
# via
# ckan
# flask-babel
beaker==1.11.0
# via ckan
bleach==5.0.1
# via ckan
blinker==1.5
bleach==6.1.0
# via ckan
blinker==1.8.2
# via
# ckan
# flask
cachelib==0.13.0
# via
# ckan
# flask-session
certifi==2024.7.4
# via
# ckan
# requests
charset-normalizer==2.0.12
charset-normalizer==3.3.2
# via
# ckan
# requests
# Removed manually for installing editable separately
# ckan[requirements]==2.10.9
# ckan[requirements]==2.11.4
# via -r ckan-requirements.in
click==8.1.3
click==8.1.7
# via
# ckan
# flask
# rq
deprecated==1.2.13
dominate==2.9.1
# via ckan
dominate==2.7.0
feedgen==1.0.0
# via ckan
feedgen==0.9.0
# via ckan
flask==2.0.3
flask==3.0.3
# via
# ckan
# flask-babel
# flask-login
# flask-multistatic
# flask-session
# flask-wtf
flask-babel==1.0.0
flask-babel==4.0.0
# via ckan
flask-login==0.6.1
flask-login==0.6.3
# via ckan
flask-multistatic==1.0
flask-session==0.8.0
# via ckan
flask-wtf==1.0.1
flask-wtf==1.2.1
# via ckan
greenlet==2.0.2
greenlet==3.0.3
# via
# ckan
# sqlalchemy
idna==3.7
# via
# ckan
# requests
importlib-metadata==4.11.4
# via ckan
importlib-resources==6.4.0
importlib-metadata==8.0.0
# via ckan
itsdangerous==2.1.1
itsdangerous==2.2.0
# via
# ckan
# flask
Expand All @@ -79,90 +81,83 @@ jinja2==3.1.6
# ckan
# flask
# flask-babel
lxml==4.9.1
lxml==5.2.2
# via
# ckan
# feedgen
mako==1.2.2
mako==1.3.5
# via
# alembic
# ckan
markdown==3.4.1
markdown==3.6
# via ckan
markupsafe==2.1.1
markupsafe==2.1.5
# via
# ckan
# jinja2
# mako
# werkzeug
# wtforms
mypy==0.971
msgspec==0.18.6
# via
# ckan
# sqlalchemy
mypy-extensions==0.4.3
# flask-session
mypy==1.10.1
# via
# ckan
# mypy
nose==1.3.7
# sqlalchemy
mypy-extensions==1.0.0
# via
# ckan
# pyutilib
# mypy
packaging==24.1
# via ckan
passlib==1.7.4
# via ckan
polib==1.1.1
polib==1.2.0
# via ckan
psycopg2==2.9.3
psycopg2==2.9.9
# via ckan
pyjwt==2.4.0
pyjwt==2.8.0
# via ckan
pyparsing==3.1.2
# via ckan
pysolr==3.9.0
# via ckan
python-dateutil==2.8.2
python-dateutil==2.9.0.post0
# via
# ckan
# feedgen
python-magic==0.4.27
# via ckan
pytz==2021.3
pytz==2024.1
# via
# babel
# ckan
# flask-babel
pytz-deprecation-shim==0.1.0.post0
# via
# ckan
# tzlocal
pyutilib==6.0.0
# via ckan
pyyaml==6.0.1
# via ckan
redis==4.6.0
redis==5.0.7
# via
# ckan
# rq
requests==2.32.4
# via
# ckan
# pysolr
rq==1.11.0
rq==1.16.2
# via ckan
simplejson==3.17.6
simplejson==3.19.2
# via ckan
six==1.16.0
# via
# bleach
# ckan
# python-dateutil
# pyutilib
sqlalchemy[mypy]==1.4.41
sqlalchemy[mypy]==1.4.52
# via
# alembic
# ckan
sqlalchemy2-stubs==0.0.2a27
sqlalchemy2-stubs==0.0.2a38
# via
# ckan
# sqlalchemy
Expand All @@ -172,24 +167,21 @@ tomli==2.0.1
# via
# ckan
# mypy
typing-extensions==4.3.0
typing-extensions==4.12.2
# via
# alembic
# ckan
# mypy
# sqlalchemy2-stubs
tzdata==2022.1
# via
# ckan
# pytz-deprecation-shim
tzlocal==4.2
tzlocal==5.2
# via ckan
urllib3==1.26.19
urllib3==2.2.2
# via
# ckan
# requests
uwsgi==2.0.30
# via -r ckan-requirements.in
watchdog==2.1.6
watchdog==4.0.1
# via
# ckan
# werkzeug
Expand All @@ -199,24 +191,20 @@ webencodings==0.5.1
# via
# bleach
# ckan
werkzeug[watchdog]==2.0.3
werkzeug[watchdog]==3.0.6
# via
# ckan
# flask
# flask-login
wrapt==1.14.0
# via
# ckan
# deprecated
wtforms==3.0.1
wtforms==3.1.2
# via
# ckan
# flask-wtf
zipp==3.19.1
zipp==3.19.2
# via
# ckan
# importlib-metadata
zope-interface==5.4.0
zope-interface==6.4.post2
# via ckan

# The following packages are considered to be unsafe in a requirements file:
Expand Down
2 changes: 1 addition & 1 deletion ckan/ckanext/ckanext-harvest
Submodule ckanext-harvest updated 64 files
+4 −10 .github/workflows/test.yml
+93 −2 CHANGELOG.rst
+1 −1 MANIFEST.in
+11 −99 README.rst
+0 −0 ckanext/harvest/assets/styles/harvest.css
+0 −0 ckanext/harvest/assets/styles/harvest.less
+0 −0 ckanext/harvest/assets/styles/less
+0 −0 ckanext/harvest/assets/styles/mixins.less
+0 −0 ckanext/harvest/assets/styles/variables.less
+0 −0 ckanext/harvest/assets/webassets.yml
+0 −9 ckanext/harvest/cli.py
+0 −8 ckanext/harvest/commands/__init__.py
+0 −447 ckanext/harvest/commands/harvester.py
+1 −20 ckanext/harvest/harvesters/base.py
+3 −5 ckanext/harvest/harvesters/ckanharvester.py
+3 −13 ckanext/harvest/helpers.py
+3 −2 ckanext/harvest/logic/action/get.py
+10 −9 ckanext/harvest/logic/action/update.py
+1 −1 ckanext/harvest/logic/auth/create.py
+10 −2 ckanext/harvest/logic/dictization.py
+0 −5 ckanext/harvest/logic/schema.py
+3 −7 ckanext/harvest/logic/validators.py
+1 −0 ckanext/harvest/migration/harvest/README
+74 −0 ckanext/harvest/migration/harvest/alembic.ini
+81 −0 ckanext/harvest/migration/harvest/env.py
+24 −0 ckanext/harvest/migration/harvest/script.py.mako
+187 −0 ckanext/harvest/migration/harvest/versions/3b4894672727_create_harvest_tables.py
+102 −0 ckanext/harvest/migration/harvest/versions/75d650dfd519_add_cascade_to_harvest_tables.py
+285 −355 ckanext/harvest/model/__init__.py
+86 −106 ckanext/harvest/plugin.py
+0 −20 ckanext/harvest/plugin/flask_plugin.py
+0 −88 ckanext/harvest/plugin/pylons_plugin.py
+1 −4 ckanext/harvest/templates/base.html
+0 −1 ckanext/harvest/templates/harvest/snippets/harvest_asset.html
+0 −1 ckanext/harvest/templates/harvest/snippets/harvest_extra_field_asset.html
+0 −1 ckanext/harvest/templates/harvest/snippets/harvest_extra_field_resource.html
+0 −1 ckanext/harvest/templates/harvest/snippets/harvest_resource.html
+1 −1 ckanext/harvest/templates/snippets/add_source_button.html
+3 −3 ckanext/harvest/templates/snippets/job_error_summary.html
+2 −2 ckanext/harvest/templates/snippets/source_item.html
+1 −1 ckanext/harvest/templates/source/admin.html
+9 −35 ckanext/harvest/templates/source/admin_base.html
+1 −6 ckanext/harvest/templates/source/edit.html
+1 −1 ckanext/harvest/templates/source/job/list.html
+2 −2 ckanext/harvest/templates/source/job/read.html
+1 −6 ckanext/harvest/templates/source/new.html
+4 −6 ckanext/harvest/templates/source/new_source_form.html
+8 −26 ckanext/harvest/templates/source/read_base.html
+3 −21 ckanext/harvest/templates/source/search.html
+7 −0 ckanext/harvest/tests/conftest.py
+0 −6 ckanext/harvest/tests/fixtures.py
+4 −12 ckanext/harvest/tests/harvesters/mock_ckan.py
+2 −2 ckanext/harvest/tests/harvesters/test_base.py
+1 −1 ckanext/harvest/tests/harvesters/test_ckanharvester.py
+34 −2 ckanext/harvest/tests/test_action.py
+20 −28 ckanext/harvest/tests/test_blueprint.py
+1 −1 ckanext/harvest/tests/test_queue.py
+1 −1 ckanext/harvest/tests/test_queue2.py
+1 −1 ckanext/harvest/tests/test_timeouts.py
+24 −41 ckanext/harvest/utils.py
+2 −0 ckanext/harvest/views.py
+0 −2 requirements.txt
+1 −3 setup.py
+9 −0 transifex.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% ckan_extends %}

{% block secondary_content %}
{% snippet 'snippets/organization.html', organization=organization %}
{{ super () }}
<div class="module module-narrow module-shallow">
<h2 class="module-heading">
<i class="fa fa-lg fa-info-circle"></i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
def clean_db(reset_db, migrate_db_for):
reset_db()
migrate_db_for("restricteddata")
migrate_db_for("activity") # https://github.com/ckan/ckan/issues/8540
migrate_db_for("pages") # probably the same issue?
Loading
Loading