install: handle failed module-map / resource catalog regeneration after a successful install #17

Open
opened 2026-10-16 18:02:28 +02:00 by michael · 3 comments
Owner

Goal

Revisit warnings and errors in the install flow once berhtjan-cli is
migrated: a failed follow-up step after a successful install must not
only be a warning.

Background

install() and install_local() call regen_module_map() after the package
is verified. If gen-module-map.sh fails, that is only a [WARN] and the
install is reported as successful. The resource catalogs
(DAW/daw-modul-berhtjan-core#13) will be regenerated at the same point;
a conflict introduced by a new module (resource_conflict) or an
incomplete default language would then also end up as a warning while
the old catalogs stay active and the new module's texts are missing.

Scope

  • decide how loud a failed regeneration step is (module-map and
    resource catalogs), and what the user is told about the state
    (module installed, catalogs/map not updated)
  • plain-string errors and [WARN]/[ERROR] output go through the
    error/i18n migration of this repo
  • hook for the resource catalog regeneration next to regen_module_map()
  • no command for removing a module exists today; check whether the
    module-map and catalogs need regenerating after a manual removal

Notes

Waits for the berhtjan-cli migration; adjust together.

DAW/daw-modul-berhtjan-core#13

## Goal Revisit warnings and errors in the install flow once berhtjan-cli is migrated: a failed follow-up step after a successful install must not only be a warning. ## Background install() and install_local() call regen_module_map() after the package is verified. If gen-module-map.sh fails, that is only a [WARN] and the install is reported as successful. The resource catalogs (DAW/daw-modul-berhtjan-core#13) will be regenerated at the same point; a conflict introduced by a new module (resource_conflict) or an incomplete default language would then also end up as a warning while the old catalogs stay active and the new module's texts are missing. ## Scope - decide how loud a failed regeneration step is (module-map and resource catalogs), and what the user is told about the state (module installed, catalogs/map not updated) - plain-string errors and [WARN]/[ERROR] output go through the error/i18n migration of this repo - hook for the resource catalog regeneration next to regen_module_map() - no command for removing a module exists today; check whether the module-map and catalogs need regenerating after a manual removal ## Notes Waits for the berhtjan-cli migration; adjust together. ## Related DAW/daw-modul-berhtjan-core#13
Author
Owner

Unblocked: berhtjan-cli 2.2.0 is released (DAW/daw-modul-berhtjan-cli#11
closed). berhtjan-cli now takes (catalogs, languages) from the host, so
the catalogs must be generated at install time.

Order: this repo is migrated to the 2.x conventions first (daw_error/v1,
resource_id, i18n/, common wrappers instead of direct io/os, no print),
then the catalog hook is added next to regen_module_map() in install()
and install_local().

Unblocked: berhtjan-cli 2.2.0 is released (DAW/daw-modul-berhtjan-cli#11 closed). berhtjan-cli now takes (catalogs, languages) from the host, so the catalogs must be generated at install time. Order: this repo is migrated to the 2.x conventions first (daw_error/v1, resource_id, i18n/, common wrappers instead of direct io/os, no print), then the catalog hook is added next to regen_module_map() in install() and install_local().
Author
Owner

Status after v2.0.0: a failed regeneration of the module map after install, update and remove is the warning 'module_map_failed' in result.warnings, and the operation stands. Open: the hook for the regeneration of the resource catalogs next to regen_module_map(), and the decision how loud a failure of it is (resource_conflict).

Status after v2.0.0: a failed regeneration of the module map after install, update and remove is the warning 'module_map_failed' in result.warnings, and the operation stands. Open: the hook for the regeneration of the resource catalogs next to regen_module_map(), and the decision how loud a failure of it is (resource_conflict).
Author
Owner

Decision (Michael): a module without texts is not a usable module, so a failed catalog build is a hard error, not a warning.

Flow for install and update (not for remove, where fewer sources cannot create a conflict):

  • Before the module is activated, the module-manager asks the host: can you build the resource catalog with this module? The answer is yes or no (no with the reason, e.g. resource_conflict or an incomplete default language).
  • No: the operation is aborted with a daw_error/v1 whose cause chain carries the host's reason. Nothing is changed: no new module directory, the old version stays active on update, the old catalogs stay.
  • Yes: the module is put in place, the catalog is generated and activated. Only then the installation counts as done.
  • The host gets the path of the texts of the staged module, so it can build with this additional source before the module is installed.
  • Interim: the question is a function in opts (provisional). It becomes an event once the delivery concept exists.

The warning module_map_failed for the module map is unchanged and is not part of this decision.
Related: DAW/fragjan#150 (which languages are built).

Decision (Michael): a module without texts is not a usable module, so a failed catalog build is a hard error, not a warning. Flow for install and update (not for remove, where fewer sources cannot create a conflict): - Before the module is activated, the module-manager asks the host: can you build the resource catalog with this module? The answer is yes or no (no with the reason, e.g. resource_conflict or an incomplete default language). - No: the operation is aborted with a daw_error/v1 whose cause chain carries the host's reason. Nothing is changed: no new module directory, the old version stays active on update, the old catalogs stay. - Yes: the module is put in place, the catalog is generated and activated. Only then the installation counts as done. - The host gets the path of the texts of the staged module, so it can build with this additional source before the module is installed. - Interim: the question is a function in opts (provisional). It becomes an event once the delivery concept exists. The warning module_map_failed for the module map is unchanged and is not part of this decision. Related: DAW/fragjan#150 (which languages are built).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DAW/daw-module-manager#17
No description provided.