-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Problem Description
The CI pipeline has several PostgreSQL compatibility issues that cause test failures:
1. Database Connection Error
FATAL: role "root" does not exist
The PostgreSQL test jobs are trying to connect using the "root" user, but PostgreSQL uses "debug_toolbar" user as configured in the service definition.
2. SQL Profiling Compatibility Error
unrecognized configuration parameter "profiling"
The SQL panel's profiling feature uses MySQL-specific commands (SET PROFILING=1/0
and information_schema.profiling
) that don't exist in PostgreSQL.
3. User Creation Constraint Violations
duplicate key value violates unique constraint "auth_user_username_key"
Test isolation issues causing duplicate user creation attempts.
Environment
- CI Environment: GitHub Actions
- Database: PostgreSQL 14 with PostGIS
- Affected Test Jobs: All PostgreSQL matrix variants
- Python Versions: 3.9, 3.10, 3.11, 3.12, 3.13
Root Causes
- Missing Environment Variables: PostgreSQL CI jobs don't set
DB_NAME
,DB_USER
,DB_PASSWORD
environment variables, unlike MySQL jobs - Database-Specific Code: SQL profiling assumes MySQL without vendor detection
- CI Configuration: Lint job has malformed strategy configuration
Proposed Solution
1. Fix CI Configuration
- Add missing PostgreSQL environment variables to
.github/workflows/test.yml
- Fix lint job strategy configuration
2. Fix SQL Profiling
- Add vendor detection to
debug_toolbar.panels.sql.forms.SQLSelectForm.profile()
- Raise clear error message for non-MySQL databases
- Update error handling in views
3. Add Tests
- Add PostgreSQL compatibility tests to verify fixes
- Test that profiling correctly rejects non-MySQL databases
Impact
- High: Blocks all PostgreSQL CI jobs
- Scope: Affects testing reliability and PostgreSQL users
- Regression Risk: Low - changes are defensive and add proper error handling
Implementation Plan
- ✅ Identify root causes
- ✅ Fix SQL profiling vendor detection
- ✅ Update CI configuration
- ✅ Add comprehensive tests
- 🔄 Create PR with fixes
The fix maintains backward compatibility while providing proper error messages for unsupported database operations.
Metadata
Metadata
Assignees
Labels
No labels