You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 906c6e7
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: apps/hub/src/github/policy-file.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ function addBody(lead: string): string {
47
47
return[lead,"","Edit it here before merging. Once merged, triage reads its rules from this file, and you change them by editing it."].join("\n");
48
48
}
49
49
50
-
constSTARTER_BODY=addBody(`Adds \`${POLICY_FILE_PATH}\` with a few common rules: a size limit, no merge conflicts and passing CI.`);
50
+
constSTARTER_BODY=addBody(`Adds \`${POLICY_FILE_PATH}\` with a few common rules: a size limit, no merge conflicts, passing CI, and a maintainer asked about sensitive or risky changes.`);
constON_HOST="needs the pull request on its host";
188
188
189
-
/** Rules that read what only the host knows: its CI, mergeability, reviews, default-branch fix history, its other open pull requests and the pull request's own title and description. */
189
+
/** Rules that read what only the host knows: its CI, mergeability, reviews, default-branch fix history, its other open pull requests, the author's standing and the pull request's own title and description. */
/** Regression risk: fixes on one changed file in recent history that make it risky, and the paths that are migrations; absent is `DEFAULT_RISK`'s. */
169
212
hotFileFixes?: number;
170
213
migrationGlobs?: string[];
214
+
/** Sensitive paths: named groups of globs, each with its level; absent is `DEFAULT_SENSITIVE`. */
215
+
sensitiveGroups?: Record<string,SensitiveGroup>;
216
+
/**
217
+
* Risk: what reaches medium and high; sensitive paths and risk: the level each fails at, and the level from which one
218
+
* below that is labelled. Absent is `DEFAULT_RISK_LEVELS`'.
219
+
*/
220
+
medium?: RiskThreshold;
221
+
high?: RiskThreshold;
222
+
failAt?: RiskMark;
223
+
labelAt?: RiskMark;
171
224
};
172
225
173
226
/** Each size rule and the field its limit is stored in. */
@@ -184,10 +237,16 @@ export function isSizeRule(id: string): id is SizeRuleId {
184
237
returnObject.hasOwn(SIZE_RULES,id);
185
238
}
186
239
187
-
/** What a policy file's rule does on failure when the file does not say: features and refactors cross size limits and touch risky code, so those only label. */
if(!Number.isSafeInteger(value)||value<1||value>RISK_SIGNALS.length)thrownewError(`${where} must be a number of signals from 1 to ${RISK_SIGNALS.length}, or a list of signals.`);
0 commit comments