Skip to content
This repository was archived by the owner on Jan 19, 2024. It is now read-only.

Add disabled config to triage #1

Merged
merged 1 commit into from
Apr 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion functions/src/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ Please help to unblock it by resolving these conflicts. Thanks!`,
If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.`
},

triage: {
triage: {
// set to true to disable
disabled: false,
// number of the milestone to apply when the issue has not been triaged yet
needsTriageMilestone: 83,
// number of the milestone to apply when the issue is triaged
Expand Down Expand Up @@ -114,6 +116,7 @@ export interface MergeConfig {
}

export interface TriageConfig {
disabled: boolean;
needsTriageMilestone: number;
defaultMilestone: number;
l1TriageLabels: string[][];
Expand Down
3 changes: 3 additions & 0 deletions functions/src/plugins/triage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ export class TriageTask extends Task {
async checkTriage(context: Context): Promise<any> {
const issue: any = context.payload.issue;
const config = await this.getConfig(context);
if (config.disabled) {
return;
}
const {owner, repo} = context.repo();
// getting labels from Github because we might be adding multiple labels at once
const labels = await getGhLabels(context.github, owner, repo, issue.number);
Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/angular-robot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ merge:

# options for the triage plugin
triage:
# set to true to disable
disabled: false
# number of the milestone to apply when the issue has not been triaged yet
needsTriageMilestone: 83,
# number of the milestone to apply when the issue is triaged
Expand Down