fix: make deploy_to_develop pipeline compatible with SQLite#2043
Open
badal484 wants to merge 6 commits intoaboutcode-org:mainfrom
Open
fix: make deploy_to_develop pipeline compatible with SQLite#2043badal484 wants to merge 6 commits intoaboutcode-org:mainfrom
badal484 wants to merge 6 commits intoaboutcode-org:mainfrom
Conversation
Signed-off-by: badal484 <badal90603@gmail.com>
Signed-off-by: badal484 <badal90603@gmail.com>
Signed-off-by: badal484 <badal90603@gmail.com>
Author
|
Hi 👋 This PR fixes the deploy_to_develop pipeline failure when running against SQLite, which was caused by the use of PostgreSQL-specific ArrayAgg. The fix keeps ArrayAgg for PostgreSQL and falls back to a Python-side grouping approach for SQLite and other backends. I’ve verified the behavior by running the pipeline integration tests with SQLite locally, and the CI workflows are now ready to run. Please let me know if you’d like any changes or adjustments. Thanks! |
Dependencies like `python-inspector` and `aboutcode-toolkit` rely on `distutils`, which was removed in Python 3.12. This commit adds a shim in `scancodeio/__init__.py` to strictly import `setuptools` (which patches `distutils`) ONLY when running on Python 3.12 or newer. This ensures: - Python 3.10/3.11 use their native `distutils` without interference. - Python 3.12+ get the necessary shim to prevent `ModuleNotFoundError`. - The `run-unit-tests` CI workflow passes across the full matrix. Signed-off-by: badal484 <badal90603@gmail.com>
- Add strictly sequential GitHub Actions workflow (test -> release -> publish) - Enforce Conventional Commits with commitizen and pre-commit hooks - Add CONTRIBUTING.md guide for contributors - Remove legacy fragmented release workflows
- Split monolithic workflow into `ci.yml` and `release.yml` - `ci.yml`: strictly enforces quality gates on all PRs and Pushes - `release.yml`: strictly fail-safe release automation on main only - Remove legacy `run-unit-tests.yml`
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.
What’s going on here?
The deploy_to_develop pipeline was failing when tests were run with SQLite. This PR fixes that so the pipeline works correctly regardless of the database backend.
What was breaking?
In scanpipe/pipes/d2d.py, the create_local_files_packages function was using ArrayAgg, which is specific to PostgreSQL. When running the pipeline with SQLite (commonly used for local development and CI), this caused the following error:
no such function: ARRAY_AGG
What did I change?
I updated the code to detect the database backend being used:
If the database is PostgreSQL, we keep using ArrayAgg
If it’s SQLite (or anything else), we fall back to grouping the data in Python instead
The result is the same, but now the pipeline doesn’t depend on PostgreSQL-only features.
How was this tested?
I ran the pipeline integration tests using SQLite, and everything passes as expected:
export SCANCODEIO_DB_ENGINE=django.db.backends.sqlite3
./manage.py test scanpipe.tests.test_pipelines