4.1 KiB
4.1 KiB
Plan
1. Task Record
The work spans two local repositories:
/home/abel/src/gitlab.com/guardianproject-ops/pygea/home/abel/src/guardianproject/anynews/republisher-redux
Requested outcome:
- Refactor
pygeaso it no longer hardcodes feed inputs inpygea/main.py. - Make
pygeaaccept a TOML config file in the same general style asrepublisher-reduxinstead of pygea.ini - Replace tuple-based feed definitions such as
("Titulares", True, None)with proper keyed data shaped like:{"name": "Titulares", "only_newest": True, "content_type": None}. - Add a required user-provided
slugfield alongside each feed name inpygea. like:{"name": "Titulares", "only_newest": True, "content_type": None, "titulares"}. - Stop using the hash-based subdirectory name in
pygea; use the configured slug instead. - Create a
demo/directory inpygeawith an example config, similar torepublisher-redux. - Change
pygeaoutput frommanifest.jsontomanifest.toml. - Make
pygeawritemanifest.tomlin[[feeds]]format thatrepublisher-reduxcan consume directly. - Each generated manifest feed entry must include:
nameslugurl
- The manifest
urlmust be an absolutefile://URI pointing to that feed'srss.xml. - Extend
republisher-reduxso its runtime config can load additional feed definitions from a separate TOML file, specifically thepygea-generated manifest file. - Keep current
republisher-reduxfeatures intact while adding the extra feed-config source. - Update docs in both repos so the new workflow is discoverable.
- Add or update tests in both repos.
- Verify both projects are working.
- Stage the resulting changes.
- Draft a commit message, but do not commit.
Operational context and nuance to preserve:
- The intended deployment is two
systemdservices on the same machine, one forpygeaand one forrepublisher-redux. - The user will handle the
systemdunits; this task is only about application/config/docs/test changes. - The purpose of
slugis operational clarity and stable filesystem paths, especially for wiringpygeaoutput intorepublisher-redux. slugmust be user-supplied, not auto-generated.namemay remain human-facing, including strings that are awkward for filesystem paths.republisher-reduxshould be able to merge feeds declared directly in its own config with feeds loaded from the external TOML manifest.- Final validation should include formatter and flake checks, and work should be staged but not committed.
2. Execution Plan
-
Finish refactoring
pygearuntime configuration:- Introduce a TOML config loader and validation.
- Replace import-time config reads and hardcoded feed tuples.
- Make feed definitions explicit objects with
name,slug,only_newest, andcontent_type.
-
Finish refactoring
pygeaoutput behavior:- Write feed output under slug-based directories instead of hash-based directories.
- Emit
manifest.tomlin[[feeds]]format with absolutefile://URLs. - Add
demo/examples and update docs.
-
Add
pygeatests and packaging/check updates:- Cover config parsing, manifest generation, and slug-based output behavior.
- Update
pyproject.toml,flake.nix, and related files as needed so tests are part of normal validation.
-
Update
republisher-reduxconfig handling:- Extend feed definitions to include
slug. - Use
slugfor path/log/output naming while preservingnameas the user-facing label. - Add a config option for loading additional feed definitions from one or more external TOML files.
- Merge direct feeds and imported feeds with duplicate detection.
- Extend feed definitions to include
-
Update
republisher-reduxtests and docs:- Cover slug-aware feed config loading and external TOML feed imports.
- Document how to consume a
pygeamanifest.
-
Validate both repos:
- Run formatting where required.
- Run repo tests.
- Run
nix flake checkin both repos.
-
Finalize without committing:
- Review diffs.
- Stage the intended files only.
- Draft a commit message for user review.