Skip to content

Commit

Permalink
feat: add label automerge
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed Apr 1, 2019
1 parent 4597cc7 commit 7b18681
Show file tree
Hide file tree
Showing 62 changed files with 351 additions and 8 deletions.
13 changes: 13 additions & 0 deletions dist/context/initRepoLabels.d.ts
@@ -0,0 +1,13 @@
import { Context } from 'probot';
export interface LabelResponse {
id: number;
node_id: string;
url: string;
name: string;
description: string;
color: string;
default: boolean;
}
export declare type Labels = Record<string, LabelResponse>;
export declare const initRepoLabels: (context: Context<any>, config: import("../teamconfigs/types").Config<any>) => Promise<Record<string, LabelResponse>>;
//# sourceMappingURL=initRepoLabels.d.ts.map
1 change: 1 addition & 0 deletions dist/context/initRepoLabels.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions dist/context/initTeamSlack.d.ts
@@ -0,0 +1,7 @@
import { Context } from 'probot';
export interface TeamSlack {
mention: (githubLogin: string) => string;
postMessage: (githubLogin: string, text: string) => Promise<void>;
}
export declare const initTeamSlack: <GroupNames extends string>(context: Context<any>, config: import("../teamconfigs/types").Config<GroupNames>) => Promise<TeamSlack>;
//# sourceMappingURL=initTeamSlack.d.ts.map
1 change: 1 addition & 0 deletions dist/context/initTeamSlack.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions dist/context/repoContext.d.ts
@@ -0,0 +1,19 @@
import Webhooks from '@octokit/webhooks';
import { Context } from 'probot';
import { GroupLabels } from '../teamconfigs/types';
import { LabelResponse, Labels } from './initRepoLabels';
import { TeamContext } from './teamContext';
interface RepoContextWithoutTeamContext<GroupNames extends string = any> {
labels: Labels;
updateStatusCheckFromLabels<E>(context: Context<E>, labels?: LabelResponse[]): Promise<void>;
lockPR<E extends Webhooks.WebhookPayloadPullRequest>(context: Context<E>, callback: () => Promise<void> | void): Promise<void>;
updateReviewStatus<E extends Webhooks.WebhookPayloadPullRequest>(context: Context<E>, reviewGroup: GroupNames | undefined, { add: labelsToAdd, remove: labelsToRemove, }: {
add?: (GroupLabels | false | undefined)[];
remove?: (GroupLabels | false | undefined)[];
}): Promise<void>;
addStatusCheckToLatestCommit<E>(context: Context<E>): Promise<void>;
}
export declare type RepoContext<GroupNames extends string = any> = TeamContext<GroupNames> & RepoContextWithoutTeamContext<GroupNames>;
export declare const obtainRepoContext: (context: Context<any>) => RepoContext<any> | Promise<RepoContext<any>> | null;
export {};
//# sourceMappingURL=repoContext.d.ts.map
1 change: 1 addition & 0 deletions dist/context/repoContext.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions dist/context/teamContext.d.ts
@@ -0,0 +1,15 @@
import { Context } from 'probot';
import { Config } from '../teamconfigs';
import { TeamSlack } from './initTeamSlack';
export interface TeamContext<GroupNames extends string = any> {
config: Config<GroupNames>;
slack: TeamSlack;
getReviewerGroup: (githubLogin: string) => string | undefined;
getReviewerGroups: (githubLogins: string[]) => string[];
reviewShouldWait: (reviewerGroup: GroupNames | undefined, requestedReviewers: any[], { includesReviewerGroup, includesWaitForGroups, }: {
includesReviewerGroup?: boolean;
includesWaitForGroups?: boolean;
}) => boolean;
}
export declare const obtainTeamContext: (context: Context<any>, config: import("../teamconfigs/types").Config<any>) => Promise<TeamContext<any>>;
//# sourceMappingURL=teamContext.d.ts.map
1 change: 1 addition & 0 deletions dist/context/teamContext.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/context/utils.d.ts
@@ -0,0 +1,2 @@
export declare const getKeys: <T extends {}>(o: T) => (keyof T)[];
//# sourceMappingURL=utils.d.ts.map
1 change: 1 addition & 0 deletions dist/context/utils.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 43 additions & 1 deletion dist/index-node10-dev.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index-node10-dev.cjs.js.map

Large diffs are not rendered by default.

44 changes: 43 additions & 1 deletion dist/index-node10.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index-node10.cjs.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/index.d.ts
@@ -0,0 +1,2 @@
import 'dotenv/config';
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions dist/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/pr-handlers/actions/autoAssignPRToCreator.d.ts
@@ -0,0 +1,4 @@
import Webhooks from '@octokit/webhooks';
import { Handler } from '../utils';
export declare const autoAssignPRToCreator: Handler<Webhooks.WebhookPayloadPullRequest>;
//# sourceMappingURL=autoAssignPRToCreator.d.ts.map
1 change: 1 addition & 0 deletions dist/pr-handlers/actions/autoAssignPRToCreator.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/pr-handlers/actions/autoMergeIfPossible.d.ts
@@ -0,0 +1,4 @@
import Webhooks from '@octokit/webhooks';
import { Handler } from '../utils';
export declare const autoMergeIfPossible: Handler<Webhooks.WebhookPayloadPullRequest>;
//# sourceMappingURL=autoMergeIfPossible.d.ts.map
1 change: 1 addition & 0 deletions dist/pr-handlers/actions/autoMergeIfPossible.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions dist/pr-handlers/actions/editOpenedPR.d.ts
@@ -0,0 +1,5 @@
import Webhooks from '@octokit/webhooks';
import { Context } from 'probot';
import { RepoContext } from '../../context/repoContext';
export declare const editOpenedPR: (context: Context<Webhooks.WebhookPayloadPullRequest>, repoContext: RepoContext<any>) => void;
//# sourceMappingURL=editOpenedPR.d.ts.map
1 change: 1 addition & 0 deletions dist/pr-handlers/actions/editOpenedPR.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/pr-handlers/actions/lintPR.d.ts
@@ -0,0 +1,4 @@
import { Context } from 'probot';
import { RepoContext } from '../../context/repoContext';
export declare const lintPR: (context: Context<any>, repoContext: RepoContext<any>) => Promise<void>;
//# sourceMappingURL=lintPR.d.ts.map
1 change: 1 addition & 0 deletions dist/pr-handlers/actions/lintPR.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/pr-handlers/actions/utils/cleanTitle.d.ts
@@ -0,0 +1,2 @@
export declare const cleanTitle: (title: string) => string;
//# sourceMappingURL=cleanTitle.d.ts.map
1 change: 1 addition & 0 deletions dist/pr-handlers/actions/utils/cleanTitle.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/pr-handlers/edited.d.ts
@@ -0,0 +1,4 @@
import { Application } from 'probot';
declare const _default: (app: Application) => void;
export default _default;
//# sourceMappingURL=edited.d.ts.map
1 change: 1 addition & 0 deletions dist/pr-handlers/edited.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/pr-handlers/labelsChanged.d.ts
@@ -0,0 +1,4 @@
import { Application } from 'probot';
declare const _default: (app: Application) => void;
export default _default;
//# sourceMappingURL=labelsChanged.d.ts.map
1 change: 1 addition & 0 deletions dist/pr-handlers/labelsChanged.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/pr-handlers/opened.d.ts
@@ -0,0 +1,4 @@
import { Application } from 'probot';
declare const _default: (app: Application) => void;
export default _default;
//# sourceMappingURL=opened.d.ts.map
1 change: 1 addition & 0 deletions dist/pr-handlers/opened.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/pr-handlers/reviewDismissed.d.ts
@@ -0,0 +1,4 @@
import { Application } from 'probot';
declare const _default: (app: Application) => void;
export default _default;
//# sourceMappingURL=reviewDismissed.d.ts.map
1 change: 1 addition & 0 deletions dist/pr-handlers/reviewDismissed.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/pr-handlers/reviewRequestRemoved.d.ts
@@ -0,0 +1,4 @@
import { Application } from 'probot';
declare const _default: (app: Application) => void;
export default _default;
//# sourceMappingURL=reviewRequestRemoved.d.ts.map
1 change: 1 addition & 0 deletions dist/pr-handlers/reviewRequestRemoved.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/pr-handlers/reviewRequested.d.ts
@@ -0,0 +1,4 @@
import { Application } from 'probot';
declare const _default: (app: Application) => void;
export default _default;
//# sourceMappingURL=reviewRequested.d.ts.map
1 change: 1 addition & 0 deletions dist/pr-handlers/reviewRequested.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/pr-handlers/reviewSubmitted.d.ts
@@ -0,0 +1,4 @@
import { Application } from 'probot';
declare const _default: (app: Application) => void;
export default _default;
//# sourceMappingURL=reviewSubmitted.d.ts.map
1 change: 1 addition & 0 deletions dist/pr-handlers/reviewSubmitted.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/pr-handlers/synchronize.d.ts
@@ -0,0 +1,4 @@
import { Application } from 'probot';
declare const _default: (app: Application) => void;
export default _default;
//# sourceMappingURL=synchronize.d.ts.map
1 change: 1 addition & 0 deletions dist/pr-handlers/synchronize.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions dist/pr-handlers/utils.d.ts
@@ -0,0 +1,8 @@
import Webhooks from '@octokit/webhooks';
import { Context } from 'probot';
import { RepoContext } from '../context/repoContext';
export declare type CallbackWithRepoContext = (repoContext: RepoContext) => void | Promise<void>;
export declare const handlerPullRequestChange: <T extends Webhooks.WebhookPayloadPullRequest>(context: Context<T>, callback: CallbackWithRepoContext) => Promise<void>;
export declare const createHandlerPullRequestChange: <T extends Webhooks.WebhookPayloadPullRequest>(callback: (context: Context<T>, repoContext: RepoContext<any>) => void | Promise<void>) => (context: Context<T>) => Promise<void>;
export declare type Handler<T = any> = (context: Context<T>, repoContext: RepoContext, ...args: any[]) => Promise<void>;
//# sourceMappingURL=utils.d.ts.map
1 change: 1 addition & 0 deletions dist/pr-handlers/utils.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/teamconfigs/christophehurpeau.d.ts
@@ -0,0 +1,4 @@
import { Config } from './types';
declare const config: Config<'dev'>;
export default config;
//# sourceMappingURL=christophehurpeau.d.ts.map

0 comments on commit 7b18681

Please sign in to comment.