Commit Graph
64 Commits
Author SHA1 Message Date
Abdessamad Derraz e146a8f349 refactor: move the review's glue to devtools 2026-11-22 00:58:05 +01:00
Abdessamad Derraz 48d88da168 refactor: move six command run modes to packages
generate_db, generate_games_index, download, romset_recipes, validate_pr and list_platforms keep only main and build_parser: the database build goes to collection.run, the games index run to games.run, the pack info and its no-pack message to release.packinfo, the capture and build runs to romrecipes.runs, the file selection to resolve.reviewfiles. Tests reach the moved code through those packages.
2026-11-21 15:47:20 +01:00
Abdessamad Derraz 9cb1e613b0 refactor: move review files and report to resolve 2026-11-21 14:59:21 +01:00
Abdessamad Derraz 036a6ebf29 refactor: reuse the shared helpers left copied
Copies of helpers the first pass created, replaced by the helper:
- source_yaml_file for our YAML sources (generate_db read them in the
  locale's encoding, a syntax error named no file);
- data_dir_registry_at in registry_bundles, platform_registry_at (new,
  beside load_platform_registry) in the manifest;
- DATA_DIRS_FILE for the registry path five modules spelled;
- load_optional_database, sha1_at, VERSIONS_FILE, installer_module;
- DerivedView where a cache was keyed by id() of a dict;
- count_text and series where a plural or a list was written by hand.
2026-11-21 10:31:29 +01:00
Abdessamad Derraz d3d82dd296 fix: resolve the --changed base in one place 2026-11-21 06:02:11 +01:00
Abdessamad Derraz 2f8f78b6b5 refactor: one git runner and main line fallback
core.gitclone gains required_git_lines, which raises GitRefused with
git's error, and fallback_lines, the remote lines tried when no remote
names the project. profile_sync and validate_pr use both.

profile_sync --changed without --base now also finds a clone whose main
line is upstream/master, upstream/v2, origin/master or origin/v2, as
validate_pr already did, before falling back to HEAD.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz cf03dcb2ef refactor: share CLI options and default paths
core.paths holds the default database, platforms, emulators and bios paths, core.cli declares the options built on them (add_repo_inputs) and the --emulator/--system modes verify and generate_pack share. model.targets.target_scope answers --target for a command line, model.profiles.no_profile_for_systems the system with no emulator. tests/sources.declared_options reads the options a script declares through either form.
2026-11-20 18:28:46 +01:00
Abdessamad Derraz 3853ca2f1c refactor: public names for cross-module reads 2026-11-18 22:59:51 +01:00
Abdessamad Derraz 27330be60a refactor: leave the commands their own code 2026-11-18 13:47:56 +01:00
Abdessamad Derraz 0b532366d0 refactor: move pack library code into packs/ 2026-11-18 13:47:31 +01:00
Abdessamad Derraz 18e91f8c07 refactor: read the repo root from core.paths 2026-11-18 13:46:15 +01:00
Abdessamad Derraz 83cfa6fd0f refactor: split common.py into three packages
core: cli (run_cli, input errors, name hints), github (token), paths.
model: sources, database, composition, registry, platforms,
declarations, targets, systems, profiles, cliargs. resolve: content,
ownership, datadirs, archives, localfile, directories, layout,
contentlayout, standalone, grouping, cores.

Definitions move verbatim; common.py and its re-exports are gone and
every importer, patch target and code-in-string names the new home. A
test that stubbed common.load_platform_config stubs each module that
reads the loader by its own name.
2026-11-18 11:09:13 +01:00
Abdessamad Derraz c784aef883 refactor: move leaf modules into packages
core: hashing, artifacts, ziptools, deterministic_zip, romdir, sect233r1,
crypto_verify, paths (REPO_ROOT). model: safeparse (needs yaml),
dumpcatalog, largefiles, alternatives. resolve: nativemode, validation,
launchers, slot, truth, gamedata, and exporter/baseline.py and
exporter/candidates.py as resolve/reconcile.py and resolve/categories.py,
which truth and gamedata read.

Every importer follows. Modules one level deeper read the repository
root from core.paths instead of __file__.
2026-11-18 10:50:45 +01:00
Abdessamad Derraz 89e186c18b refactor: split validate_file by stage 2026-11-17 08:25:19 +01:00
Abdessamad Derraz 6c03dd07ee chore: type the placement tables of validate_pr
The platform table mixes sets and dicts, so mypy read it as
Collection[Any] and rejected the setdefault and the folder argument
that b3a510995 added. The narrowed folder set is a name of its own,
since it can be None. Nine baseline entries go with it.
2026-11-13 20:47:25 +01:00
Abdessamad Derraz b3a5109955 fix: place hashless files by their own system
The wanted list puts firmware first, then game data, labels each row, and leaves out what no one can share (the profile's reason: user written, emulator written, per person). validate_pr.placement() takes a file known by name alone to its system's folder or the directory it declares, never beside a homonym held for another system.
2026-11-13 18:34:13 +01:00
Abdessamad Derraz b18e478db0 refactor: share the placement rule of validate_pr
placement() decides the folder and name of a file not under bios/ yet, so the wanted page and the gaps page send an upload where the review asks for it. A declared file whose name the collection holds now gets the .variants/ slot beside it.
2026-11-13 10:45:12 +01:00
Abdessamad Derraz b6129310e5 fix: let pinned executables through validate_pr
An executable is refused unless an emulator profile pins its exact bytes by sha1 or sha256. PICO-8's pico8.exe and SDL2.dll, from the official 0.2.7 archive, are pinned by the lexaloffle profile; md5 and crc32 never vouch for code.
2026-11-10 04:24:25 +01:00
Abdessamad Derraz 4d3f589ef4 refactor: drop the archived platform status
RetroPie was the only platform with status: archived, which kept it out
of verify --all, slots, the pipeline and list_platforms unless
--include-archived was typed. release_pack already decides which packs a
release publishes and the installer serves every platform, so the status
set nothing apart. The field, its schema entry and the flag are gone, and
RetroPie is covered by every full run like any other platform.
2026-11-06 11:52:34 +01:00
Abdessamad Derraz 5407eafe5b feat: validate_pr reads an undeclared ZIP's files
A card's BIOS folder zipped to upload it was hashed as one file and
reported not recognised, its contributor asked where the dump came from
and told to place it under bios/. A ZIP no list or profile declares as a
whole is now read member by member: each is named held, declared and not
held, or not recognised, and the contributor is asked for the files
unzipped. A declared archive (a MAME or FBNeo set) is never opened.
2026-11-06 08:57:15 +01:00
Abdessamad Derraz a343be0da1 fix: validate_pr json says failed, not new
The JSON report put "outcome": "new" on every file without another
outcome, so a path that does not exist, or a file that failed a check,
was listed as a new contribution. A failed file now reads "failed".
2026-11-06 08:54:23 +01:00
Abdessamad Derraz 19898cb6ea chore: merge site and docs fixes, third pass 2026-11-06 06:38:47 +01:00
Abdessamad Derraz f63a84a746 fix: check validate_pr platforms after git 2026-11-06 04:25:29 +01:00
Abdessamad Derraz 81acb00536 feat: fill the large file issue form
validate_pr linked the bare missing-bios form for a file too large for git
and then said to put it in the pull request and under bios/. The link now
carries filename, sha1, md5 and size, and the pull request advice is left
out for such a file.
2026-11-06 03:29:24 +01:00
Abdessamad Derraz 27991c84ba fix: refuse a missing platforms directory 2026-11-06 03:25:20 +01:00
Abdessamad Derraz 943add6df0 fix: align tests with the new help and messages
The --skip-packs help and the validate_pr fetch error were reworded, and a batocera page with no tab bar is plain Markdown that keeps the underscore entity, read here as a browser shows it.
2026-11-05 20:33:37 +01:00
Abdessamad Derraz f24b34c1ef feat: place recognised files with validate_pr
The report named the folder of each file and left the copy to the contributor, one file and one .variants/ name at a time. --place copies each recognised file from outside bios/ to its folder under the name the lists declare, or to the .variants/ slot of a name already held, never over a file. A hash with two names or two folders is not placed.
2026-11-05 19:25:47 +01:00
Abdessamad Derraz eaa7effa74 fix: mark held and unknown PR files for review
validate_pr said all checks passed for random bytes and for a copy of a held file, and sent the copy to the folder that already holds it. Each now reads REVIEW with its next step, the status line counts them, and a held copy gets no placement hint. A copy inside a tree kept out of dedup is still accepted.
2026-11-05 19:22:55 +01:00
Abdessamad Derraz a06f5ad2ba fix: fetch the project main an upstream lacks
A remote named upstream added as CONTRIBUTING said and never fetched made validate_pr --changed compare with the fork's main and exit 0 on nothing. It now fetches the project's main when the remote does not hold it. profile_sync names the fetch when --base is absent, and CONTRIBUTING adds git fetch upstream.
2026-11-05 19:20:50 +01:00
Abdessamad Derraz b90f8bb0b9 chore: merge tooling batch 2026-11-05 15:57:19 +01:00
Abdessamad Derraz 3f07924faf fix: validate_pr reads each platform's own check
A file was matched by its container sha1 or md5 alone. A zipped_file
member, a Recalbox member digest, a RetroDECK sha256 and a RomM size and
crc32 are now read the way verify reads them, and an identical copy's
folder is where its variants go.
2026-11-05 11:51:56 +01:00
Abdessamad Derraz f285c32d67 feat: validate every file of a folder 2026-11-05 11:48:31 +01:00
Abdessamad Derraz 7b6b22351a fix: show no digest for a file never read 2026-11-05 11:48:31 +01:00
Abdessamad Derraz 36d93c1750 feat: name the folder of a profile-only file
validate_pr.py built its folder advice from platform lists alone, so a
file only an emulator profile declares got the generic
bios/Manufacturer/Console/ advice. Profiles now feed the same table
through each entry's system, and the contributing guide says the
command answers where a file goes.
2026-10-21 10:13:09 +02:00
Abdessamad Derraz 746dee530f fix: compare a fork clone with the project main
A fork's clone has origin alone. Pushed to the fork's main, the commit
left origin/main...HEAD empty and --changed reported nothing with rc 0.
When no remote names the project, its main is fetched and compared, and
a fetch that fails is an error.
2026-10-21 10:10:41 +02:00
Abdessamad Derraz ec1001de95 fix: read validate_pr data from the repo root
Run from another directory, validate_pr.py read no database, platform or
profile and reported every file as referenced by no platform and outside
bios/. It now moves to the root as verify.py does, reading the files
named from where they were typed.
2026-10-21 10:08:23 +02:00
Abdessamad Derraz 621f4fcdee fix: give fork pull requests the hash report
A fork's GITHUB_TOKEN is read-only, so the comment never arrived and a
valid file turned red. The report now goes to the job summary for every
pull request, and the comment and labels run only where the token can
write. validate_pr points an oversized file to an issue instead of a
platform setting a contributor cannot use.
2026-10-21 04:25:25 +02:00
Abdessamad Derraz 8d295273a5 fix: validate_pr checks the size a name expects
1024 bytes named scph5501.bin, a name every declaration sizes at 524288, were reported "File size OK" and offered a .variants slot at the repository root. The review now warns when no declaration of the name accepts the size, and places a variant beside the folder that holds the name.
2026-10-20 04:48:07 +02:00
Abdessamad Derraz 23a999153d fix: read PR hashes the way the resolver does
load_profile_hashes and load_platform_hashes read hash fields by hand: crc32 was never indexed and a comma list of sha256 stayed one key. A contribution a profile names by crc32 alone (clk's Electron os.rom, among 626 entries) or by one of mesence's four sha256 was reported as referenced nowhere. Both indexes now read through parse_hash_list, and a crc32 counts where no stronger hash is declared, bounded by the declared size.
2026-10-20 02:12:54 +02:00
Abdessamad Derraz 4231902a6c docs: write prose without dashes or semicolons
Profiles, the wiki, comments, docstrings, command output and schema descriptions carried em-dashes, clause-joining semicolons, unicode arrows, box-drawing banners and check-mark glyphs. Each sentence was rewritten rather than having its character swapped. Hashes, paths, source_ref values and every cited file:line are unchanged, which a comparison of each parsed profile against the previous revision confirms.

validate_pr comments now say PASS and FAIL in words, and source_ref values in a profile's structured blocks render as code. test_prose_style fails if any of these comes back, in tracked files or in the generated site.
2026-10-19 06:47:31 +02:00
Abdessamad Derraz 04deb95a35 docs: give every command-line option a help text 2026-10-19 04:23:34 +02:00
Abdessamad Derraz 11cec0a2d0 fix: read uncommitted BIOS files in --changed 2026-10-18 16:31:25 +02:00
Abdessamad Derraz 89073f26fe fix: tell a contributor where a BIOS goes 2026-10-18 16:30:46 +02:00
Abdessamad Derraz 61b37408f1 feat: name the folder a PR's BIOS belongs in 2026-10-18 08:44:41 +02:00
Abdessamad Derraz 7bd2579022 fix: stop calling a held file its own duplicate 2026-10-18 08:41:32 +02:00
Abdessamad Derraz 4240c98359 fix: name a missing database in one error line 2026-10-18 08:34:09 +02:00
Abdessamad Derraz e1b6aad51b fix: refuse abbreviated flags in every script
argparse completed a prefix into the only flag starting with it:
slots.py --emulator read profiles from a directory named after the
emulator and reported nothing, and pipeline.py --all built every pack
variant. Every parser now refuses an abbreviation.
2026-10-18 05:30:58 +02:00
Abdessamad Derraz 32d32e5718 fix: refuse validate_pr flags it would drop
Named files beside --changed were replaced by the git diff, and the
run reported no changed files about files it never read; --json
beside --markdown dropped the markdown. Both combinations are now
refused, and an empty JSON run prints an empty list.
2026-10-18 05:20:03 +02:00
Abdessamad Derraz faa8af0800 refactor: annotate every remaining signature 2026-10-18 00:44:20 +02:00
Abdessamad Derraz 55631a2fbc fix: end listings quietly when the reader leaves 2026-10-17 20:50:22 +02:00