Skip to content

Refactor and clean old code

Gaëtan Blond requested to merge clean_structure into main

Refactor and clean old code

New features

  • New CLI based on click, with auto-generated help text (--help to show it)
  • New mode dry-run to test the setup without updating the DB or sending notifications
  • Uses poetry as package manager, using the modern and standard way pyproject.toml; the project now provides the exact dependencies versions in the poetry.lock file
  • Added possibility to disable mail notification using the CLI toggle --no-email
  • Added possibility to disable Mattermost notification using the CLI toggle --no-mattermost
  • Added LICENSE file (MIT)
  • Added CI to automatically build and push a Python wheel and an container image to GitLab for each new tag
  • Splitted Mattermost notifications into multiple posts to not reach the maximum allowed length

Changes

  • Split the project in multiple modules, to make it modular and increase maintenability
  • Uses defusedxml as a replacement of standard CPython xml module to prevent attacks on its known witnesses and vulnerabilities
  • Fetchers configuration format is now YAML and uses a new structure, see below
  • Improved errors handling
  • Changed environment variable MM_SERVER_URL with MM_SERVER_HOST
  • Changed environment variable CONFIG_PATH with FETCHERS_CFG (docker only)

Compatibility with the previous project

Database

No changes were made in the SQLite database structure, so full compatibility is expected.

Feeds configuration

All fetchers configuration must be adapted to the new syntax. The config_sample.yaml shows the new structure for each fetcher type.

Notifiers

The only change is the environment var MM_SERVER_URL that has been removed in favor of MM_SERVER_HOST.

Edited by Gaëtan Blond

Merge request reports