From 57f3ad1fe235dadbc1698973fa3f6c91ec711e45 Mon Sep 17 00:00:00 2001 From: Karl-Philipp Wulfert Date: Mon, 27 May 2019 12:44:05 +0200 Subject: [PATCH] refactor: extrac slack channel ID into configuration --- src/configuration.ts | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/src/configuration.ts b/src/configuration.ts index 1fd6f129..4fb2a8b8 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -14,41 +14,59 @@ */ import {Label} from '@openstapps/gitlab-api/lib/types'; -// list of school with their IDs +/** + * List of schools with their IDs + */ export const SCHOOLS: { [school: string]: number } = {}; -// list of group IDs to fetch issues for - 4088298 is openstapps main group +/** + * List of group IDs to fetch issues for + * + * 4088298 is openstapps main group + */ export const GROUPS: number[] = [4088298].concat(Object.keys(SCHOOLS).map((school) => { return SCHOOLS[school]; })); -// weight for labels to order issues by +/** + * + */ export const LABEL_WEIGHTS: any = { 'bug': 1, 'critical': 2, }; -// list of labels to print bold +/** + * List of labels to print bold in report + */ export const BOLD_LABELS: string[] = [ 'bug', 'critical', ]; -// GitLab API URL +/** + * GitLab API URL + */ export const GITLAB_API_URL = 'https://gitlab.com/api/v4/'; -// needed milestones +/** + * Milestones to add to projects + */ export const NEEDED_MILESTONES = [ 'Backlog', ]; -// branches to protect +/** + * Protected branches + */ export const PROTECTED_BRANCHES = [ 'develop', 'master', ]; -// needed labels +/** + * Labels to add to all projects + */ export const NEEDED_LABELS: Label[] = [ { color: '#FF0000', @@ -141,7 +159,7 @@ export const NEEDED_LABELS: Label[] = [ return { color: '#F0AD4E', description: 'An issue that specifically applies to this school', - name: 'school-' + school, + name: `school-${school}`, }; })).concat(['android', 'iOS', 'web', 'node'].map((platform) => { return { @@ -151,4 +169,12 @@ export const NEEDED_LABELS: Label[] = [ }; })); +/** + * Prefix for automatically created notes + */ export const NOTE_PREFIX = '`openstapps/projectmanagement`'; + +/** + * Slack channel to post messages to + */ +export const SLACK_CHANNEL = 'C762UG76Z';