Commit graph

75 commits

Author SHA1 Message Date
e3dff44f73 Blacklist the libs section from package imports
Libraries never produce useful screenshots. Excluding by Debian
archive section instead of a lib* name pattern keeps applications
with lib-prefixed names (libreoffice, librecad, ...) importable.
With REMOVE_BLACKLISTED_PACKAGE set, the next import also removes
previously imported libs-section packages and their screenshots.
2026-08-23 11:03:05 +02:00
61b64fae25 Log the failing SQL statement in vectorization task
Unique violations on packages_name_key happen on a statement that
cannot logically touch name - log the exact query and a longer
backtrace to identify what really fails.
2026-08-23 00:31:04 +02:00
bada261841 Skip packages without description text in vectorization
Packages with neither description nor long description cannot be
embedded at all; they used to fail on every run. Exclude them from
the scope instead.
2026-08-23 00:20:30 +02:00
2b79470feb Simplify vectorization task to sequential processing
Drop the threaded worker pool (queue, mutexes, connection pooling).
The task now processes packages one by one via find_each - plenty
fast since the external embedding service dominates latency, and
much easier to reason about.
2026-08-23 00:13:50 +02:00
3550a4e2e2 Harden vectorization task against per-package failures
A single failing package used to kill its whole worker thread silently
because only Vectorizer::Error was rescued per package. Now every
StandardError is caught and logged with class and backtrace, and the
embedding write is narrowed to update_column(:embedding) so the task
only ever issues a minimal UPDATE - it cannot touch any other column
or fire model callbacks. Progress stats no longer serialize database
writes through the mutex.
2026-08-23 00:11:52 +02:00
4948fe50e3 Add semantic package search via pgvector embeddings
Package text search now combines several strategies: exact name match,
name prefix promotion, compound word splitting ("sqlite browser" finds
"sqlitebrowser") and semantic nearest neighbor search over description
embeddings computed by an external embedding service (all-MiniLM-L6-v2,
384 dims) stored with the pgvector extension. Classic PostgreSQL
full-text search remains as fallback when the vector service is
unreachable. Gibberish queries without lexical overlap with the package
data return empty results instead of random matches.

Embeddings can be backfilled with bin/rails debshots:compute_vectors.

Also drops the unused lograge gem from the Gemfile.
2026-08-22 22:07:56 +02:00
0bb09dbbd8 fix package comparison
All checks were successful
Build and Push Docker Image / build-and-push-image (push) Successful in 8m45s
2026-05-21 00:40:22 +02:00
5bdba5b6cc added job to purge old log files 2025-06-23 00:46:32 +02:00
e25441f548 add Rake task to create admin users 2025-05-21 00:23:51 +02:00
25672aabb0 Update to Rails 7.2 2025-02-25 21:57:16 +01:00
c235407378 reduce loglevel 2024-07-22 00:00:53 +02:00
48e3a8c67f bzip2 import fixed 2024-07-14 22:42:34 +02:00
5b624e6c30 Merge branch 'prod' 2023-12-26 01:21:15 +01:00
a26b5eaa23 Remove no-longer-needed migration scripts 2021-03-06 19:19:54 +01:00
0a5c64d17c Rake task fixed for Shring 2021-02-25 00:14:08 +01:00
c234ffec4f Ignore packages ending in -l10n 2021-02-21 15:57:56 +01:00
afba572dcd todo hint added 2021-02-13 22:16:03 +01:00
6a99a62ffa Added rake task to create derivates after migration 2020-11-12 22:28:29 +01:00
3a4f40b7e3 Cruft 2020-11-01 23:25:34 +01:00
c4f5741b0c Migration to Shrine attachment handling 2020-11-01 15:07:16 +01:00
d0057e490f Task added to precompute image variants 2020-10-30 18:27:58 +01:00
33086f9430 Merge branch 'master' of salsa.debian.org:debian/debshots 2020-04-20 20:29:06 +02:00
8adf682a0b Migrations and helpers to move from Paperclip to ActiveStorage
To migrate the application as of April 2020:

• leave models/screenshot.rb with “has_attached_file”
• bundle exec rake db:migrate
• bin/move_paperclip_to_activestorage
• set models/screenshot.rb to “has_one_attached”
2020-04-20 20:24:59 +02:00
Christoph Haas
e1b1ca4c60 Docstring fixed 2018-08-22 13:13:14 +02:00
Christoph Haas
4a9fe8772e Use package upstream version. Skip revision. Improve regexp parsing. 2018-08-22 13:11:28 +02:00
Christoph Haas
0a7559f9a4 Custom will_paginate render fails with new version. Removed. 2018-08-07 18:41:44 +02:00
3fb8b3ab17 Ruby 2.4 compatibility fix 2017-04-23 22:56:26 +02:00
7ff36f1c5c More relaxed blacklist for importing packages 2016-10-30 13:03:04 +01:00
046897f1c6 Rake task to clean up broken screenshots works now 2016-08-17 09:27:50 +02:00
b7e82757eb Speed improvement in updating database
Instead of querying the database one package at a time I am now querying
all packages and just update those who have a visits count.
2016-08-11 11:20:37 +02:00
2edae8fbc2 Progress counter in 5% steps added. Comments added. 2016-08-11 09:26:27 +02:00
e895e931fc Regexp now correctly matches empty referers and user agents 2016-08-11 09:25:49 +02:00
04baeb73e7 Added rake task to count package visits from Nginx log files
Example call:
rake debshots:accesslog2visits['cache-access-example.log']
2016-08-10 18:59:59 +02:00
88728c0bba Keep leading spacesd when parsing the long description 2016-06-29 21:50:29 +02:00
670df2f277 Fixed bug that parsed description fields incorrectly
Example:

Description-en: 389 Directory Server suite - server
Based on the Lightweight Directory Access Protocol (LDAP), the 389
Directory Server is designed to manage large directories of users and
resources robustly and scalably.
.
Its key features include:
* four-way multi-master replication;
* great scalability;
* extensive documentation;
* Active Directory user and group synchronization;
* secure authentication and transport;
* support for LDAPv3;
* graphical management console;
* on-line, zero downtime update of schema, configuration, and
    in-tree Access Control Information.

The "Its key features include:" was mistaken as a key.
2016-06-29 10:43:01 +02:00
4d65c071f9 Cruft removed 2016-06-29 10:42:22 +02:00
ff254f8e00 Typo fixed 2016-06-22 18:10:43 +02:00
7914d09676 Dealing with empty/nil version/description fields properly. 2016-06-22 18:09:41 +02:00
b947de24f3 Rake task set_empty_screenshot_version_to_zero added 2016-06-21 17:23:24 +02:00
3eeb9a63dc Using created_at instead of legacy 'uploaddatetime' field 2016-03-04 15:41:50 +01:00
28e4f8e705 Using own custom Foundation 6 paginator 2016-03-03 17:11:54 +01:00
c67f3062dc Package importer fixed 2016-03-02 14:13:44 +01:00
332e8f4b01 version comparison fixed 2016-03-01 12:57:25 +01:00
39149c26ad Adding :uploaddatetime because it is mentioned in the default scope 2016-02-29 15:14:28 +01:00
99059f54df Typo fixed 2016-02-29 15:05:25 +01:00
0d10c8ef0a Cruft removed 2016-02-26 17:33:40 +01:00
26c8605256 Function to compare package versions added 2016-02-26 17:32:04 +01:00
06f09c0486 Count updates/additions correctly. Add fields correctly. Various other fixes. 2015-06-28 15:12:43 +02:00
dade32145e Using .new instead of .create
Otherwise .create() would fail instantly because it does not
populate the fields during the creation and can't create a
valid object.
2015-06-28 15:11:39 +02:00
0ea7f96495 Parse keywords from Debian control file in a non-greedy way
Previously this:
Description: foo: bar
had been parsed into
"Description: foo" -> "bar"

Now it properly parses into
"Description" -> "foo: bar"
2015-06-28 15:09:39 +02:00