Version 25.04.10
Overview
This release delivers major improvements across the database migration tooling, PostgreSQL adapter, Docker tooling, UI components (especially attachment and media handling), and the web server infrastructure. It also introduces a WSGI testing framework, endpoint handling for tables, fixes to ensure compatibility with various Python versions.
Enhancements
- General Code Improvements: * Introduced SQL comment decorators for better traceability in SQL execution. * Standardized decorator patterns across the codebase for clarity. * _documentation storage is now used for locally generated documentation files, improving file management. * Removed `httplib2`, replacing it with requests, which is more actively maintained. * Removed `future` dependency, since Python 3 is now the baseline. * Eliminated redundant runtime imports to reduce startup overhead. * Removed `simplejson`, since json is part of Python’s standard library. – Removed unused imports across multiple files.
- SQL Improvements: * Enhanced database migration logic by improving error handling for relation-based exceptions. * The GNR_GLOBAL_DEBUG flag was removed, and gnr db migrate now defaults to INFO log level instead of DEBUG. * Improved checkRelationIndex() to log more descriptive errors when an invalid relation is encountered. * Improved handling of deferred relations and indexing for tenant schemas. * New `#BETWEEN` syntax added for SQL queries, supporting rangefiltering (e.g., dates, integers), which include the upper bound by default.
- Excluded unique constraints that overlap with primary keys.
- Added support for PostgreSQL extensions in migrations, including: * Commands to create extensions. * Integration with the migration framework.
- Added event triggers to the migration structure.
- New `–inspect` flag for `gnr db migrate`. Outputs a zip file with SQL schema, DB structure in JSON, ORM state, and planned SQL changes.
- Added support to avoid table creation if columns are empty.
- Centralized UNIQUE constraint generation (addColumnUniqueConstraint() method).
- Improved diff and handler mechanism with default fallback for missing handlers.
- New test cases covering unique columns and empty tables.
- PostgreSQL Utilities: * Introduced new utilities for monitoring PostgreSQL performance:
- Queries for most-used indexes and sequential scans.
- Autovacuum status monitoring.
- Top and least-efficient queries statistics.
- Database Schema: * Added support for extension management in migration commands. * Introduced structured column grouping (colgroup_label, colgroup_name_long) for better schema organization. * Refactored column width estimation logic to use a lookup table for improved accuracy. * Enhanced column width calculations when handling empty tables. * Injected column group metadata into table models to improve attribute management.
- Database adapters: * Updated PostgreSQL adapter to handle DEFERRABLE and INITIALLY DEFERRED constraints. * Added support for capabilities declaration inside of databaseadapter, in order to conditionally execute specific tasks base on such specific capabilities.
- Introduced ‘postgres3’ database adapter which uses the psycopg3 driver.
- Aligned adapters inheritance method and added test coverage for it
- Improved FK detection with ordering preserved.
- Extended constraint introspection logic for better diff generation.
- Multikey sort support for foreign keys.
- Ordered foreign key extraction for better reproducibility.
- The gnr db migrate command recognizes adapter-specific capabilities, ensuring better database compatibility.
- Logging infrastructure: * Introduced a consistent usage of python logging inside the framework. * All CLI commands provide a –loglevel options to set the logging level. * Logging levels can be also defined using GNR_LOGLEVEL env var. * sys package provide a minimale UI to control levels for eachpackage of the framework.
- Logging captures all exceptions for model relation validation errors.
- Added ‘gnr dev bugreport <instance name>’ to create a report of the current environment the instance is using, for more complete bug reports – please see –help for possible usage
- Sphinx Export Enhancements * Improved error handling when exporting documentation to Sphinx. * Missing images will no longer break the export process. * Removed redundant configuration settings for handbook preferences. * Instead of spawning an external Sphinx process, the framework now calls the Sphinx build API directly.
- AttachManager Enhancements: – Supports inline preview for images with zoom-in feature. – Conditional PDF viewer usage based on file extension. – Reworked iframe viewer logic for better handling of images/videos/docs.
- Login Reload Fix: * Removed gnrtoken from reload URLs to avoid state duplication.
- PDF/Image Preview Detection Logic: – Refined JS detection of when to use PDF viewer vs inline display.
- GnrWsgiSite refactoring: – Safer fallback on bad URLs or missing packages. – Better modularity in UrlInfo routing logic. – Handles edge cases like ..//etc/passwd to harden path traversal.
- Werkzeug Compatibility Patch: – Fix for subcommand CLI trick used by gnr that breaks Python 3.8 autoreloader.
Docker Tooling
- Introducing a new docker image creation, based on the instance configuration
- Image creation and pushing towards registry
- Images are labeled with the details of all packages/repositoty involved.
Test Infrastructure
- Added a minimal `instanceconfig.xml` with framework-only packages for unit testing.
- Expanded SQL common tests by adding a new location table definition.
- Improved test suite structure to follow a package-based layout.
- Enhanced unit tests for SQL migration features and removed obsolete test cases.
- Introduced WSGITestClient and ExternalProcess for end-to-end daemon testing.
- Test coverage for API key management, storage paths, routing logic, and page serving.
- Test coverage on unique constraints, foreign keys, and empty table handling.
- Test for print endpoint and variant column handler behavior.
Bug Fixes
- Resolved issues with unused imports that caused linting errors.
- Fixed PostgreSQL unique constraint overlaps with primary keys.
- Eliminated runtime import artifacts and unused decorators.
- Removed deprecated mobile meta attributes.
- Corrected unique removal syntax from test fixtures.
- MDEditor Focus Issue * Fixed an issue where MDEditor would lose focus, leading to unsaved changes. * Implemented an event listener to save changes upon focus loss.
- SQL Query Fixes * Fixed incorrect column width calculations in ThResourceMaker. :contentReference[oaicite:33]{index=33} * Ensured #BETWEEN syntax correctly handles blank values. :contentReference[oaicite:34]{index=34} * SQL range comparisons now consistently include the upper bound. :contentReference[oaicite:35]{index=35}
Removed / Deprecated / Breaking changes
- Removed: legacy deepdiff in favor of dictdiffer. Update your environment accordingly.
- Removed: obsolete Closure Compiler support.
- Removed: redundant iframe/viewer JS logic, refactored AttachManager handlers.
Upgrade Instructions
- Recommended for every upgrade, to reinstall the framework using the original installation method in order to have dependencies working correctly.
- Update your SQL queries to properly utilize `#BETWEEN` syntax changes.
- Review migration logs, as error handling for relations has changed.
- Reconfigure handbook settings, as redundant preferences were removed.