Skip to content

Conversation

@badal484
Copy link

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

Signed-off-by: badal484 <badal90603@gmail.com>
Signed-off-by: badal484 <badal90603@gmail.com>
Signed-off-by: badal484 <badal90603@gmail.com>
@badal484
Copy link
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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant