Draft
Conversation
- Add docker-compose.test.yml for local testing with CKAN 2.11 + Python 3.10 - Add setup-test-env.sh script to initialize test environment - Add run-docker-tests.sh script for running tests - Add Makefile with common development tasks - Update GitHub Actions workflow to CKAN 2.11 + Python 3.10
Remove git init that was destroying the host .git repository. Now only configures git to trust the mounted directory.
- Remove deprecated _request_ctx_stack import from Flask - Use Flask's g.current_user instead of _request_ctx_stack.top.current_user - Fixes ImportError in test_auth_logic.py - Collection errors reduced from 6 to 5
- Update pandas from 2.0.3 to 2.2.0 for numpy 2.x support - Add 'make rebuild' command to Makefile for container rebuilds - Fixes ValueError in test_blueprints.py - Collection errors reduced from 5 to 4
- Replace nose assertions with pytest in test_dataset_releases.py - assert_equals(a, b) -> assert a == b - assert_in(x, y) -> assert x in y - assert_not_in(x, y) -> assert x not in y - Remove deprecated before_request import from user_info_blueprint.py - CKAN 2.11 middleware handles user identification automatically - Add 'make rebuild' command to Makefile for container rebuilds
- Replace standalone mock with unittest.mock in 3 test files - test_dataset_transfer.py: import mock -> from unittest import mock - test_plugin.py: from mock import X -> from unittest.mock import X - test_validators.py: from mock import X -> from unittest.mock import X - Remove deprecated _identify_user_default from plugin.py - CKAN 2.11 middleware handles user identification automatically - Collection errors reduced from 3 to 1 (potentially 0)
- Remove deprecated ReclineViewBase import from ckanext.reclineview - Change UNAIDSReclineView to extend SingletonPlugin - Implement IResourceView interface with DataTables template - Add view_template() and setup_template_variables() methods - CKAN 2.11 removed Recline-based view plugins - Keep existing info() and can_view() for compatibility
- Update dataset_transfer model to use meta.engine for SQLAlchemy 2.0 - Replace deprecated Table.exists() with bind parameter approach - Reimplement package_activity_list as standalone action (removed in CKAN 2.11) - Query activities directly from database instead of chaining removed action - Test results: 24 passed, down to 134 errors from 161
- Add clean_db_with_migrations fixture to create permission_labels column - CKAN 2.11 activity plugin requires permission_labels text[] column - clean_db rebuilds database, so column must be added after it runs - Solution based on proven approach from ckanext-fork migration - All permission_labels errors eliminated - Test results: 102 passed, 18 errors (down from original), 41 failures
Issue 11: Activities not created by factories - Use factories.Dataset() then call package_patch to trigger activity - Added activity plugin to test class configurations - Pattern from PROGRESS_FORK.md Issue 12: NameConflict with activity plugin - Changed package_activity_list to @chained_action - Chains activity plugin's implementation instead of replacing it - Simplified - no more direct database queries Test results: - test_actions_dataset_lock: 3 tests now passing (TestDatasetLock) - 3 tests failing in TestDatasetUnlock (needs same fix) - Overall: Activity plugin integration working
- Add required plugins to test.ini (activity, scheming_datasets, authz_service, ytp_request) - Fix SQLAlchemy 2.0 compatibility in dataset_transfer model - Use inspector API instead of deprecated table.exists() - Add None check for meta.engine during early plugin initialization - Resolves chained action errors by ensuring base actions are available
- Use @chained_action for package_activity_list to extend activity plugin - Add activity plugin to test.ini and all test configurations - Fix auth.py to safely get package from context or fetch it - Update all test files to include activity in plugin configs
- Use getattr(toolkit.g, 'userobj', None) for safe access in identify() and after_saml2_login() methods to avoid AttributeError during early request processing - Keep @toolkit.chained_action for member_request_create (proper pattern) and add ytp_request plugin to test_helpers.py plugin config Test results: 123 passed, 36 failed, 2 errors (was 5+ errors before) - test_helpers.py: 3/3 PASSED (was erroring) - TestDatasetLockHelper tests now passing - TestMemberLists partial fix (some tests now passing)
Issue 20: ckanext_pages table missing
- Added SQL to create ckanext_pages table in clean_db_with_migrations fixture
- Follows established pattern from PROGRESS files (SQL after clean_db)
Issue 21: dataset.activity route deprecated in CKAN 2.11
- Changed 'dataset.activity' to 'activity.package_activity' in templates
- Updated templates/package/read_base.html
- Updated templates/package/releases/list.html
Issue 22: activity_id now in view_args instead of query params
- CKAN 2.11 redirects to /dataset/<id>/history/<activity_id> route
- Updated templates to use request.view_args.get('activity_id') or request.args.get('activity_id')
Result: test_dataset_releases.py now 18/18 PASSED (was 18 FAILED)
…r CKAN 2.11 - test_auth_logic: Replace HTTP API test with call_action pattern (API keys deprecated) - test_validators: Move fixture inside class, add scheming config markers - test_actions_dataset_lock: Add scheming config markers, provide user context for activities Total when run individually: - test_validators: 17 passed - test_actions_dataset_lock: 6 passed - test_auth_logic: 16 passed (10 failures need investigation)
… CKAN 2.11 - Added ckan_config markers for oauth2_required_scope to TestVerifyRequiredScope and TestAccessTokenPresentAndValidAndUserAuthorized classes - Added @patch decorators for AUTH0_DOMAIN and API_AUDIENCE module-level variables in TestValidateAndDecodeToken (5 test methods) - Module-level variables are set at import time, so pytest config markers don't work - must use @patch instead test_auth_logic.py: 26 passed (was 16 passed, 10 failed)
- Added scheming.dataset_schemas and scheming.presets config markers - Added clean_db_with_migrations fixture - Tests using type='test-schema' now work properly test_auth.py: 12 passed (was 4 passed, 8 failed)
…N 2.11 - Added scheming config markers to tests using factories.Resource/Dataset - Added proper user/org/dataset hierarchy for resource creation - Updated test_update_filename_in_upload_resource_url to check diacritic replacement case-insensitively (CKAN 2.11 may lowercase filenames in URLs) test_logic.py: 20 passed (was 13 passed, 7 failed)
… context - Added org/user hierarchy to TestGetTableSchema and TestPopulateDataDictionary - Added ckanext.unaids.schema_directory config marker - Added user context to TestPackageCreate tests for activity subscriptions - Updated format_guess test: CKAN 2.11 returns mimetype as format for .pjnz test_actions.py: 18 passed (was 12 passed, 6 failed)
…org transfer, and blob_storage config Batch 9: test_dataset_transfer.py - Blueprint and Config Fixes Issues Fixed: 1. test-schema type not recognized - Added scheming config markers 2. Collaborator cannot move dataset - Use site_user instead of empty/current user 3. Missing blob_storage config - Added config marker for template rendering Test file changes: - Added scheming.dataset_schemas and scheming.presets config markers - Added clean_db_with_migrations fixture - Added ckanext.blob_storage.storage_service_url config marker Blueprint source fix (unaids_dataset_transfer.py): - Changed package_update context to use site_user (sysadmin) instead of empty string - CKAN 2.11 validates org move permissions even with ignore_auth - Site user bypasses collaborator org-move restriction and satisfies activity plugin Result: 10 passed, 0 failed (was 5 passed, 5 failed)
… user fixtures - Move test_org_download fixture inside TestMemberLists class to inherit config markers - Use org_admin fixture directly instead of test_organization['users'][0] - Update email test to use actual factory-generated emails from fixtures - Use dropna() to handle site user NaN email - Use explicit org_editor fixture instead of relying on users[] ordering - Fix 403 test: use org_editor fixture directly All 7 tests now passing.
- Add scheming.dataset_schemas and scheming.presets config markers - Add clean_db fixture for test isolation - Add autouse setup_org fixture for user/org hierarchy - Pass owner_org and user to Dataset factory calls All 3 tests now passing.
…validate_package trigger Source code changes (plugin.py): - Renamed IResourceController methods for CKAN 2.11 compatibility: - before_create → before_resource_create - before_update → before_resource_update - before_show → before_resource_show - Added after_resource_update method for validate_package trigger (fix: was checking package_id in after_update but storing resource_id) - Cleaned up after_update to only handle package-level updates Test changes (test_plugin.py): - Added scheming.presets config to TestPlugin for plugin isolation - TestValidatePackage: use regular 'dataset' type, add user fixtures, pass user context to call_action for resource operations Requirements: - Added frictionless>=5.0.0 for validation plugin schema processing - Added tableschema>=1.21.0 as frictionless dependency All 14 tests in test_plugin.py now pass.
- TestResourceUrlEncoding: Added with_plugins, clean_db fixtures, user context - TestGiftlessBackend: Updated skip reason after investigation - Original issue #24 (context passing) was fixed in May 2021 - Test requires running giftless server (infrastructure issue) - Added scheming/authz config, changed six.StringIO to io.BytesIO - Updated PROGRESS.md with investigation findings Test status: 1 passed, 1 skipped
- Added schema_directory config to TestPopulateDataDictionary and TestAutoPopulateDataDictionaries - Changed Dataset factory to use type='test-schema' for proper scheming - Added manual schema field assignment (CKAN 2.11 extras handling) - Added schema field to test_schema.json resource_fields - Updated PROGRESS.md with Batch 14 and new migration pattern #7 All 160 tests passing, 1 skipped (giftless integration test)
PJNZ format is defined in resource_formats.json with format name 'PJNZ', not 'application/pjnz' (which is the mimetype). All 160 tests passing, 1 skipped (giftless integration test)
Comprehensive guide for enabling ckanext-unaids in a CKAN 2.11 docker stack: - Docker image requirements - Required dependencies and extensions - Database migrations - Configuration changes - Breaking changes and migration patterns - Troubleshooting guide
CKAN 2.11: datatables_view requires data in datastore. Changed requires_datastore to True and updated can_view to check datastore_active flag. The view will only appear for resources that have been successfully pushed to datastore.
CKAN 2.11 fix: The link_for tag double-encodes HTML for icons. Changed to use h.nav_link() helper which properly handles icon HTML.
Replace link_for with h.nav_link() helper to prevent icon HTML from being double-encoded. Affected templates: - group/edit_base.html: View button - group/index.html: Add Group button - group/manage_members.html: Add Member and CSV buttons - group/member_new.html: Back to all members button - organization/edit_base.html: View button - organization/manage_members.html: Add Member and CSV buttons - organization/member_new.html: Back to all members button - user/dashboard_organizations.html: Add Organization button
- Add home/index.html to restore custom homepage (CKAN 2.11 removed ckan.homepage_style config option, so layout1.html was not being loaded) - Update Bootstrap 3 classes to Bootstrap 5 in layout1.html: - col-xs-* → col-* - col-lg-offset-* → offset-lg-* - hidden-xs hidden-sm → d-none d-md-block - pull-right → float-end - Fix vertical spacing by restoring Bootstrap 3 heading margins - Add max-width constraints to partner logos
- Increase homepage section padding and heading margins to match CKAN 2.9 - Add spacing for .row2 elements on homepage - Remove duplicate Activity Stream tab from package nav (ckanext-activity already provides it in CKAN 2.11)
- Remove unnecessary assignment to 'response' in test_plugin.py - Add explanatory comment for empty except clause in actions.py
Change data-toggle to data-bs-toggle in dataset_selector.html template to work with Bootstrap 5 used in CKAN 2.11.
- Add .badge selectors alongside .label for format-based colors - Update GeoJSON color to #8d2932 (deep red) - Update PJNZ color to #aaa (light gray) - Add shp format color (#91318c) - Ensure default badge background is #aaa
- Remove datastore_active check from UNAIDSReclineView.can_view() - Add fallback template showing 'Data Preview Pending' when datastore not ready - Data Explorer now appears in view dropdown for CSV/XLS/XLSX/TSV/GeoJSON files
- Add missing CSRF token to user edit and registration forms - Add missing CSRF token to collaborator, releases, and bulk process forms - Fix icon double-encoding on collaborator page by using h.nav_link()
- Change data-toggle to data-bs-toggle for CKAN 2.11 compatibility - Add dropdown-item class to menu links - Add aria-expanded attribute for accessibility
- Add .hidden CSS class (removed in Bootstrap 5) - Update data-toggle/data-target to data-bs-toggle/data-bs-target - Update modal close button structure (btn-close, title before button) - Replace pull-right with float-end - Add dropdown-item class to dropdown menu links
- Use .get() for defensive access to resources list - Remove unnecessary try/except (check_access handles NotAuthorized)
Remove login_register_catch blueprint that unconditionally redirected /user/login to /user/saml2login, which is not needed when SAML2 is disabled.
Pages are now accessible via direct URLs, homepage help panel, and footer. The '2026 Instructions' link remains in the header template. This matches the expected behavior from CKAN 2.9 production.
- Change pandas from 2.2.0 to 2.0.3 to match main Pipfile - Resolves ImportError: No module named 'numpy.lib.histograms' - Ensures compatibility with Python 3.10 and numpy 1.26.4
- Add --force-reinstall --no-cache-dir for pandas installation - Ensures pandas is recompiled against the correct numpy version - Fixes: ValueError: numpy.dtype size changed, may indicate binary incompatibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I will update later