wrolpi/modules
lrnselfreliance 5cdb4aaac0
repos.yaml imports by diffing (#870)
* repos.yaml imports by diffing

repos.yaml declares one section, its Repos keyed by repo_url_key (another
URL of the same Repo is that Repo), comparing name, description,
directory, Tag, mode, branch, submodules, frequency and clone token (a
missing directory or clone token keeps the database's).  An unchanged
import writes nothing (every import rewrote every Repo and its
Download).

An invalid entry is skipped and counted, and its Repo is kept; before,
a Repo whose entry failed validation was deleted.  New Repos are created
inside the import's one write: recurring_download (via
get_or_create_download and _set_repository_download) takes commit=False,
and the URL is not looked up again for each new Repo (O(N^2)).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* repos.yaml: a branch URL is keyed by its Repo's URL

file_rows keyed the raw URL, but stores parse_repo_url's URL, which
turns a forge's branch URL (GitHub /tree/<branch>, GitLab
/-/tree/<branch>) into the repo URL and a branch.  The entry looked like
a new Repo: its insert hit the existing Repo's name (rolling back every
import of that file), and an invalid such entry did not protect its Repo
from deletion.  Rows and invalid keys now use the parsed URL; a URL that
cannot be parsed is skipped by its raw key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 10:36:12 -06:00
..
archive Database configs carry a version the database keeps too (#866) 2026-10-24 14:58:18 -06:00
docs Model reprs read only loaded state (#819) 2026-10-11 16:47:32 -06:00
flasher db: request-path library functions use the request's connection (#774) 2026-10-04 11:05:20 -06:00
inventory Strip whitespace from inventory item string values on save 2026-07-30 17:34:46 -06:00
map Channel and map subscription changes wait for a concurrent writer (#851) 2026-10-21 16:48:52 -06:00
repos repos.yaml imports by diffing (#870) 2026-10-25 10:36:12 -06:00
videos Database configs carry a version the database keeps too (#866) 2026-10-24 14:58:18 -06:00
zim Database configs carry a version the database keeps too (#866) 2026-10-24 14:58:18 -06:00
__init__.py Add a Repos module that mirrors git repositories (#783) 2026-10-07 15:16:58 -06:00