{"id":19176287,"url":"https://github.com/redhatqe/notify-service","last_synced_at":"2025-04-20T01:32:21.665Z","repository":{"id":37077058,"uuid":"318010850","full_name":"RedHatQE/notify-service","owner":"RedHatQE","description":"Notify service with multiple supported target","archived":true,"fork":false,"pushed_at":"2024-04-17T13:39:16.000Z","size":688,"stargazers_count":9,"open_issues_count":4,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-18T07:55:57.882Z","etag":null,"topics":["backend","fastapi","helm","jinja","k8s","mjml","notifications","openapi","openshift","podman","redoc"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RedHatQE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-02T22:41:43.000Z","updated_at":"2024-12-20T14:12:01.000Z","dependencies_parsed_at":"2024-11-09T10:28:46.451Z","dependency_job_id":"749eb597-9a11-4f52-921b-f2e5b01734dc","html_url":"https://github.com/RedHatQE/notify-service","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedHatQE%2Fnotify-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedHatQE%2Fnotify-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedHatQE%2Fnotify-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedHatQE%2Fnotify-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RedHatQE","download_url":"https://codeload.github.com/RedHatQE/notify-service/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249838128,"owners_count":21332561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","fastapi","helm","jinja","k8s","mjml","notifications","openapi","openshift","podman","redoc"],"created_at":"2024-11-09T10:27:56.367Z","updated_at":"2025-04-20T01:32:21.368Z","avatar_url":"https://github.com/RedHatQE.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"docs/static/notify-logo.svg\" height=\"75px\"\u003e\u003c/img\u003e\n\n[![Flake8 Status](https://github.com/RedHatQE/notify-service/workflows/Flake8/badge.svg)](https://github.com/RedHatQE/notify-service/actions)\n[![Helm Chart Lint and Test](https://github.com/RedHatQE/notify-service/workflows/Lint%20and%20Test%20Charts/badge.svg)](https://github.com/RedHatQE/notify-service/actions)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n# notify-service\n\nNotify service with multiple supported target\n\nThis is a backend service build with FastAPI.\n\n## Requirement\n\n  - Python 3.9\n  - Pipenv\n  - Podman, buildah on Linux host\n  - Helm 3\n  - Redis\n\nCheck Pipfile for python packages.\n\n## Deploy with Helm\n\n[![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/S0Vn9BM3iMA/0.jpg)](https://youtu.be/S0Vn9BM3iMA)\n\n\n### Update Helm chart value\n\nMake a copy of the `chart/values.yaml`, e.g. dev.value.yaml and update.\n\nUpdate api key:\n\n    apiKeyValue: The API key to authenticate and access the apis, you could generate one with cmd `$openssl rand -hex 32`\n\nSMTP related config:\n\n    smtp.endpoint.enableTls: default to True\n    smtp.endpoint.port: int, required\n    smtp.endpoint.host: str, required\n    smtp.endpoint.user: str, optional\n    smtp.endpoint.password: str, optional\n\nEmail related config:\n\n    fromName: str, service name, e.g. Notify Service\n    fromEmail: str, the email from\n\nChat Webhook URL:\n\n    chatWebhook.enabled: boolen, enable or disable chat webhook\n    chatWebhook.gchat: str, Google Chat room webhook\n    chatWebhook.slack: str, Slack room webhook\n\nActiveMQ message bus:\n\n    activeMQ.enabled: boolen, enable or disable ActiveMQ message bus config\n    activeMQ.cert_mount_path: str, specify where the certs will be mounted in the container\n    activeMQ.ca_certs: multiline str, the CA server certificate\n    activeMQ.client_cert: multiline str, the message bus client certificate\n    activeMQ.client_key: multiline str, the message bus client key\n    activeMQ.msg_bus_host_1: str, the message bus host name\n    activeMQ.msg_bus_host_1: int, the message bus host port\n    activeMQ.msg_bus_host_2: str, optional, the second message bus host name\n    activeMQ.msg_bus_host_2: int, optional, the second message bus host port\n\nIRC config:\n\n    irc.enabled: boolen, enable or disable IRC config\n    irc.server: str, IRC host name\n    irc.port: int, the IRC host port\n    irc.ssl: boolen, enable or disable ssl, make sure set the right port if is enabled\n    irc.nickname: str, IRC username\n    irc.password: str, set if password exist\n    irc.default_target: str, the default channel name start with '#' or username\n\nJira config:\n\n    jira.enabled: boolen, enable or disable Jira config\n    jira.issue_type_list: list of str, include all the available Jira issue types\n    jira.url: str, the Jira instance url\n    jira.token: str, the user's personal Jira token\n\nBugzilla config:\n\n    bugzilla.enabled: boolen, enable or disable Bugzilla config\n    bugzilla.url: str, the Bugzilla instance url\n    bugzilla.api_key: str, the user's personal Bugzilla API key\n\nPersistent volume config:\n\n    persistence.enabled: boolen, true or false\n    persistence.subPath: str, sub path\n    persistence.existingClaim, str, using existing pvc\n    persistence.accessMode: str, ReadWriteOnce, ReadWriteMany or ReadOnlyOnce\n    persistence.size: str, volume size, e.g. 1G\n    persistence.storageClass: str, storage class name\n    persistence.VolumeName: str, volume name\n\nIf deploy to Openshift (default) update OpenShift route url:\n\n    openshift.enabled: boolen, true or false\n    openshift.hosts: str, the full app host name\n\nor else update the ingress part.\n\n### Run helm install\n\nMake sure you have login your cluster.\n\n#### Install latest from helm repo\n\nAdd helm repo with:\n\n    $ helm repo add notify https://RedHatQE.github.io/notify-service/\n\nCheck the latest release on the project with:\n\n    $ helm search repo notify-service\n\nThen install with:\n\n    $ helm install ns notify-service -f dev.value.yaml\n\n#### Install from current repo:\n\n    $ helm install ns chart/ -f dev.value.yaml\n\n## Access the service and API docs\n\nThe API docs are automatically generated on Swagger UI and Redoc UI.\n\n### Swagger UI\n\nAfter deployment is done access the app Swagger UI:\n\n    http://${ openshift.hosts }:8080/docs\n\nYou could try the apis on Swagger UI and check parameters and request body samples in description.\n\n### Redoc\n\nAfter the deployment is done, Redoc UI could be accessed at:\n\n    http://${ openshift.hosts }:8080/redoc\n\nThe Redoc UI is more developer friendly with detail on descriptins, parameters, schemas, payload, code samples, etc.\n\n### Request body template and samples\n\nFor each API, both Swagger UI and Redoc UI provide request body schema, while Redoc UI with more details and provide drop list with different supported schemas and details.\n\nCheck [sample](docs/sample) dir under doc for some request body with the matching template names under [app/templates/build](app/templates/build) or [app/templates/src](app/templates/src).\n\n## Templates\n\nThe repo have provided few templates under `app/templates/`, which includes templates for email, Google Chat, Slack, and Jira.\n\nAll templates are Jinja templates. Check following for how each target templates are generated, remember to add new request body sample under [sample](docs/sample) dir for each templates.\n\n### Email MJML template\n\nThe email templates are generated with [MJML](https://mjml.io/documentation/), you could create a mjml template online with [try-it-live](https://mjml.io/try-it-live/).\n\nAfter edit done, you could save the mjml file with suffix `.mjml` under [app/templates/src](app/templates/src), and SAVE THE HTML file with suffix '.html' under [app/templates/build](app/templates/build), the `HTML` file will be directly used as email template.\nThen you could raise PR for adding new templates, make sure your template is unique.\n\n**Note:** Use Jinja semantic for templating.\n\n### Google Chat template\n\nGoogle chat message support simple text and cards:\n\n- [Simple text](https://developers.google.com/hangouts/chat/reference/message-formats/basic) contains plain text content with limited text formatting.\n- [Cards](https://developers.google.com/hangouts/chat/reference/message-formats/cards) define the format, content, and behavior of cards to be displayed in the target space.\n\nFollow the docs and create your own google chat templates and save the template file with suffix '.jinja' under [app/templates/build](app/templates/build).\nThen you could raise PR for adding new templates, make sure your template is unique.\n\n**Note:** Use Jinja semantic for templating.\n\n### Slack template\n\nSlack message use mrkdwn formatting syntax and support layouts, check:\n\n- [Formatting text](https://api.slack.com/messaging/composing/formatting) in messages\n- [Composing layouts](https://api.slack.com/messaging/composing/layouts) for layouts\n\nFollow the docs and create your own slack templates and save the template file with suffix '.jinja' under [app/templates/build](app/templates/build).\nThen you could raise PR for adding new templates, make sure your template is unique.\n\n**Note:** Use Jinja semantic for templating.\n\n### Jira template\n\nJira issues and comments use *wikimarkup* formatting syntax check:\n\n- [Formatting text](https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all) in tickets and comments\n\nFollow the docs and create your own Jira templates and save the template file with suffix '.jinja' under [app/templates/build](app/templates/build).\nThen you could raise PR for adding new templates, make sure your template is unique.\n\n**Note:** Use Jinja semantic for templating.\n***Advanced Fields (Creating a new issue):*** In order to specify Components, Labels, Affect Versions, and Fix Versions when you create a new issue on Jira, please check under [app/templates/sample](app/templates/sample) the file jira_new_issue_extra_fields.jinja. Adding the fields to any Jira sample will allow you to specify Components, Labels, Affect Versions, and Fix Versions under your new issue.\n\n### Bugzilla template\n\nBugzilla comments templates (in the current Bugzilla version) only support basic text and hyper-links:\n\nFollow the docs and create your own Bugzilla templates and save the template file with suffix '.jinja' under [app/templates/build](app/templates/build).\nThen you could raise PR for adding new templates, make sure your template is unique.\n\n**Note:** Use Jinja semantic for templating.\n\n### Upload templates\n\nNo need to raise PRs for each template, if the template is not for common use for all users, user could choose upload templates to a running instance use the Update Tempalte API.\nCheck on the Swagger UI or Redoc UI with PUT method under template APIs on a running instance.\n\nThe templates are saved on a volume mounted to dir specified as `templateMountDir` in helm chart, make sure `persistence.enabled` is true. Then the templates will be saved in a persistent volumn on your OCP cluster.\n\nTODO: Supprt S3 storage\n\n### Remote url templates\n\nUser could also store templates on a github repo or other places which could be accessed by url, then could specify the template url in email, gchat, slack target apis.\n\nFor remote urls, cache with default 300 secs timeout will be enabled, so no fetching if request same template between 300 secs.\n\n**Note:** Make sure you have matching request body for Jinja templating.\n\n## Development\n\nFor develop, build, test and debug, please check [Development Doc](docs/development.md) for more info.\n\n## Helm Chart Release\n\nFor update and release the Helm chart of the repo to github webpage, please check [Helm Chart Release Doc](docs/chart_release.md) for more info.\n\n## Container Images\n\nThe latest build images are published on:\nhttps://quay.io/repository/waynesun09/notify-service\n\n## Contributing\nYou can contribute by:\n\n- Raising any issues you find using notify-service\n- Fixing issues by opening [Pull Requests](https://github.com/RedHatQE/notify-service/pulls)\n- Submitting a patch or opening a PR\n- Improving documentation\n- Talking about notify-service\n\nAll bugs, tasks or enhancements are tracked as [GitHub issues](https://github.com/RedHatQE/notify-service/issues).\n\n## CI\nThe Github Action will run flake8 against .py files, pytest and helm chart test.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhatqe%2Fnotify-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredhatqe%2Fnotify-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhatqe%2Fnotify-service/lists"}