Announcement Hooks

This hook allows the issues opened on your application repository to be displayed on the alliance auth front page to administrators.

app_announcement_hook_example

To register an AppAnnouncementHook class, you would do the following:

from allianceauth import hooks
from allianceauth.services.hooks import AppAnnouncementHook


@hooks.register('app_announcement_hook')
def announcement_hook():
    return AppAnnouncementHook("Your app name", "USERNAME/REPOSITORY_NAME", AppAnnouncementHook.Service.GITLAB)
class AppAnnouncementHook(app_name: str, repository_namespace: str, repository_kind: Service, label: str = 'announcement')[source]

AppAnnouncementHook shim to allianceauth.admin_status.hooks

Parameters:

AppAnnouncementHook (_type_) – _description_

__init__(app_name: str, repository_namespace: str, repository_kind: Service, label: str = 'announcement') None

Parameters

app_name

The name of your application.

repository_namespace

Here you should enter the namespace of your repository. The structure stays the same for both GitHub and GitLab repositories.
A repository with the url https://gitlab.com/username/appname will have a namespace of username/appname.

Service

This variable is an enumeration of the class AppAnnouncemementHook.Service

It is mandatory to specify this variable so alliance auth contacts the correct API when fetching your repository issues.

class Service(*values)

Simple enumeration to determine which api should be called to access issues

GITHUB = 'github'
GITLAB = 'gitlab'

label

The label that will determine if issues should be seen as an announcement. This value is case-sensitive and the default value is "announcement".