This is a plugin to create tickets in Github from Argus
-
TICKET_PLUGIN:"argus_ticket_github.GithubPlugin" -
TICKET_ENDPOINT:"https://github.com/"or link to self-hosted instance, absolute URL -
TICKET_AUTHENTICATION_SECRET: Create a personal access token with the scoperepo:{ "token": token }It is recommended to create a Github API user and to ensure that that user has the necessary authorization for creating issues in the relevant repository.
-
TICKET_INFORMATION:Project namespace and name (obligatory)
{ "project_namespace_and_name": project_namespace_and_name }To know which project to create the ticket in the Github API needs to know the owner and name of it. The owner is the user or organization the Github repository belongs to and the name is the name of the Github project.
For the Github project Hello Git World the dictionary would look like this:
{ "project_namespace_and_name": "githubtraining/hellogitworld", }Labels (optional)
There are two ways of automatically filling labels:
-
Labels that are always the same, independent of the incident. These will be set in
labels_set.{ "labels_set" : [ label1, label2, label3, ] } -
Labels that are filled by attributes of the Argus incident. These are set in
labels_mappingwhich is a list of the names of the attributes as they are returned by the API (e.g.start_time). If the information can be found in the tags the it has to be a dictionary withtagas the key and the name of the tag as the value (e.g. {"tag": "host"}).{ "labels_mapping" : [ attribute_of_incident, {"tag": name_of_tag}, ] }
-
argus_ticket_github uses ruff as a Python source code formatter and linter. Ruff can be installed by running
$ pip install ruffA pre-commit hook will format new code automatically before committing. To enable this pre-commit hook, run
$ pre-commit installIf you have installed tox, the following command will
test argus_ticket_rt code against several Django versions, several Python versions, and
automatically compute code coverage.
$ toxAn HTML coverage report will be generated. Refer to the tox.ini file for further options.