diff --git a/scripts/github/barnacle-auto-response.mjs b/scripts/github/barnacle-auto-response.mjs index 1381bd0b336..05cb481ad59 100644 --- a/scripts/github/barnacle-auto-response.mjs +++ b/scripts/github/barnacle-auto-response.mjs @@ -1,11 +1,11 @@ // Barnacle owns deterministic GitHub triage and auto-response behavior. -export const activePrLimit = 10; +const activePrLimit = 10; const thirdPartyExtensionMessage = "Please publish this as a third-party plugin on [ClawHub](https://clawhub.ai) instead of adding it to the core repo. Docs: https://docs.openclaw.ai/plugin and https://docs.openclaw.ai/tools/clawhub"; -export const rules = [ +const rules = [ { label: "r: skill", close: true, @@ -159,7 +159,7 @@ export const candidateLabels = { externalPluginCandidate: "triage: external-plugin-candidate", }; -export const bugSubtypeLabelSpecs = { +const bugSubtypeLabelSpecs = { regression: { color: "D93F0B", description: "Behavior that previously worked and now fails", @@ -251,7 +251,7 @@ const candidateActionRules = [ const normalizeLogin = (login) => login.toLowerCase(); const automationPrHeadPrefixes = ["clawsweeper/", "clownfish/"]; -export function isAutomationPullRequest(pullRequest) { +function isAutomationPullRequest(pullRequest) { const headRefName = pullRequest.headRefName ?? pullRequest.head?.ref ?? ""; return ( typeof headRefName === "string" && @@ -259,7 +259,7 @@ export function isAutomationPullRequest(pullRequest) { ); } -export function extractIssueFormValue(body, field) { +function extractIssueFormValue(body, field) { if (!body) { return ""; } @@ -281,17 +281,17 @@ export function extractIssueFormValue(body, field) { return ""; } -export function hasLinkedReference(text) { +function hasLinkedReference(text) { return /(?:#\d+|github\.com\/openclaw\/openclaw\/(?:issues|pull)\/\d+)/i.test(text); } -export function hasFilledTemplateLine(body, field) { +function hasFilledTemplateLine(body, field) { const escapedField = field.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); const regex = new RegExp(`^\\s*-\\s*${escapedField}:\\s*\\S`, "im"); return regex.test(body); } -export function hasMostlyBlankTemplate(body) { +function hasMostlyBlankTemplate(body) { if (!body) { return true; } @@ -332,7 +332,7 @@ function stripPullRequestTemplateBoilerplate(text) { ); } -export function hasConcreteBehaviorContext(body, text) { +function hasConcreteBehaviorContext(body, text) { if (hasLinkedReference(text)) { return true; } @@ -349,7 +349,7 @@ export function hasConcreteBehaviorContext(body, text) { ); } -export function hasClearDesignContext(body, text) { +function hasClearDesignContext(body, text) { if (hasConcreteBehaviorContext(body, text)) { return true; } @@ -359,7 +359,7 @@ export function hasClearDesignContext(body, text) { ); } -export function isMarkdownOrDocsFile(filename) { +function isMarkdownOrDocsFile(filename) { return ( filename.startsWith("docs/") || /\.mdx?$/i.test(filename) || @@ -367,7 +367,7 @@ export function isMarkdownOrDocsFile(filename) { ); } -export function isTestLikeFile(filename) { +function isTestLikeFile(filename) { return ( /(^|\/)(__tests__|fixtures?|snapshots?)(\/|$)/i.test(filename) || /(^|\/)test\/helpers\//i.test(filename) || @@ -377,7 +377,7 @@ export function isTestLikeFile(filename) { ); } -export function isInfraLikeFile(filename) { +function isInfraLikeFile(filename) { return ( /^\.github\/(?:workflows|actions)\//.test(filename) || filename.startsWith("scripts/") || @@ -390,7 +390,7 @@ export function isInfraLikeFile(filename) { ); } -export function surfacesForFile(filename) { +function surfacesForFile(filename) { const surfaces = new Set(); if (/\.generated\/|generated|\.snap$/i.test(filename)) { surfaces.add("generated");