-
Notifications
You must be signed in to change notification settings - Fork 0
Module
Stéphane Brunner edited this page Feb 23, 2024
·
9 revisions
To create a module you should implement the interface github_app_geo_project.module.Module
Then provide it as a ghci.module
entry point, if you use Poetry with something like:
[tool.poetry.plugins."ghci.module"]
changelog = "github_app_geo_project.module.changelog:Changelog"
To use it, it should be adder in the application module, in the production.ini
file in the key application.<application>.modules
Then some configuration should be added in the application configuration profiles or in the repositories in the configuration file, using the main key as the module entrypoint name.
The module can interact with his own part of the dashboard, for that, you should write something like:
from github_app_geo_project.module import Module, utils
class MyModule(Module[dict]):
def required_issue_dashboard(self) -> bool:
return True
def process(self, context: ProcessContext[dict]) -> Optional[str]:
dashboard = utils.DashboardIssue(context.issue_data)
todo = dashboard.is_checked('<name>')
if todo:
...
dashboard.set_check('<name>', False)
return dashboard.to_string()
return None