mobbdev 1.4.29 → 1.4.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/args/commands/upload_ai_blame.mjs +35 -1
- package/dist/index.mjs +135 -14
- package/package.json +1 -1
|
@@ -144,10 +144,13 @@ function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
144
144
|
},
|
|
145
145
|
getMvsProject(variables, requestHeaders, signal) {
|
|
146
146
|
return withWrapper((wrappedRequestHeaders) => client.request({ document: GetMvsProjectDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "getMvsProject", "mutation", variables);
|
|
147
|
+
},
|
|
148
|
+
IssueTypes(variables, requestHeaders, signal) {
|
|
149
|
+
return withWrapper((wrappedRequestHeaders) => client.request({ document: IssueTypesDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "IssueTypes", "query", variables);
|
|
147
150
|
}
|
|
148
151
|
};
|
|
149
152
|
}
|
|
150
|
-
var AiBlameInferenceType, FixQuestionInputType, Language, ManifestAction, Effort_To_Apply_Fix_Enum, Fix_Rating_Tag_Enum, Fix_Report_State_Enum, Fix_State_Enum, IssueLanguage_Enum, IssueType_Enum, Pr_Status_Enum, Project_Role_Type_Enum, Vulnerability_Report_Issue_Category_Enum, Vulnerability_Report_Issue_State_Enum, Vulnerability_Report_Issue_Tag_Enum, Vulnerability_Report_Vendor_Enum, Vulnerability_Severity_Enum, FixDetailsFragmentDoc, FixReportSummaryFieldsFragmentDoc, MeDocument, GetLastOrgAndNamedProjectDocument, GetLastOrgDocument, GetEncryptedApiTokenDocument, FixReportStateDocument, GetVulnerabilityReportPathsDocument, GetAnalysisSubscriptionDocument, GetAnalysisDocument, GetFixesDocument, GetVulByNodesMetadataDocument, GetFalsePositiveDocument, UpdateScmTokenDocument, UploadS3BucketInfoDocument, GetTracyDiffUploadUrlDocument, AnalyzeCommitForExtensionAiBlameDocument, GetAiBlameInferenceDocument, GetAiBlameAttributionPromptDocument, GetPromptSummaryDocument, UploadAiBlameInferencesInitDocument, FinalizeAiBlameInferencesUploadDocument, UploadTracyRecordsDocument, GetTracyRawDataUploadUrlDocument, DigestVulnerabilityReportDocument, SubmitVulnerabilityReportDocument, CreateCommunityUserDocument, CreateCliLoginDocument, PerformCliLoginDocument, SetQuarantineEnabledDocument, CreateProjectDocument, ValidateRepoUrlDocument, GitReferenceDocument, AutoPrAnalysisDocument, GetFixWithAnswersDocument, GetFixReportsByRepoUrlDocument, GetReportFixesDocument, GetLatestReportByRepoUrlDocument, UpdateDownloadedFixDataDocument, GetUserMvsAutoFixDocument, StreamBlameAiAnalysisRequestsDocument, StreamCommitBlameRequestsDocument, ScanSkillDocument, SkillVerdictsByMd5Document, LogMvsEventDocument, GetMvsProjectDocument, defaultWrapper;
|
|
153
|
+
var AiBlameInferenceType, FixQuestionInputType, Language, ManifestAction, Effort_To_Apply_Fix_Enum, Fix_Rating_Tag_Enum, Fix_Report_State_Enum, Fix_State_Enum, IssueLanguage_Enum, IssueType_Enum, Pr_Status_Enum, Project_Role_Type_Enum, Vulnerability_Report_Issue_Category_Enum, Vulnerability_Report_Issue_State_Enum, Vulnerability_Report_Issue_Tag_Enum, Vulnerability_Report_Vendor_Enum, Vulnerability_Severity_Enum, FixDetailsFragmentDoc, FixReportSummaryFieldsFragmentDoc, MeDocument, GetLastOrgAndNamedProjectDocument, GetLastOrgDocument, GetEncryptedApiTokenDocument, FixReportStateDocument, GetVulnerabilityReportPathsDocument, GetAnalysisSubscriptionDocument, GetAnalysisDocument, GetFixesDocument, GetVulByNodesMetadataDocument, GetFalsePositiveDocument, UpdateScmTokenDocument, UploadS3BucketInfoDocument, GetTracyDiffUploadUrlDocument, AnalyzeCommitForExtensionAiBlameDocument, GetAiBlameInferenceDocument, GetAiBlameAttributionPromptDocument, GetPromptSummaryDocument, UploadAiBlameInferencesInitDocument, FinalizeAiBlameInferencesUploadDocument, UploadTracyRecordsDocument, GetTracyRawDataUploadUrlDocument, DigestVulnerabilityReportDocument, SubmitVulnerabilityReportDocument, CreateCommunityUserDocument, CreateCliLoginDocument, PerformCliLoginDocument, SetQuarantineEnabledDocument, CreateProjectDocument, ValidateRepoUrlDocument, GitReferenceDocument, AutoPrAnalysisDocument, GetFixWithAnswersDocument, GetFixReportsByRepoUrlDocument, GetReportFixesDocument, GetLatestReportByRepoUrlDocument, UpdateDownloadedFixDataDocument, GetUserMvsAutoFixDocument, StreamBlameAiAnalysisRequestsDocument, StreamCommitBlameRequestsDocument, ScanSkillDocument, SkillVerdictsByMd5Document, LogMvsEventDocument, GetMvsProjectDocument, IssueTypesDocument, defaultWrapper;
|
|
151
154
|
var init_client_generates = __esm({
|
|
152
155
|
"src/features/analysis/scm/generates/client_generates.ts"() {
|
|
153
156
|
"use strict";
|
|
@@ -1399,6 +1402,16 @@ var init_client_generates = __esm({
|
|
|
1399
1402
|
getMvsProject(organizationId: $organizationId) {
|
|
1400
1403
|
projectId
|
|
1401
1404
|
}
|
|
1405
|
+
}
|
|
1406
|
+
`;
|
|
1407
|
+
IssueTypesDocument = `
|
|
1408
|
+
query IssueTypes {
|
|
1409
|
+
issueTypes {
|
|
1410
|
+
value
|
|
1411
|
+
label
|
|
1412
|
+
issueDescription
|
|
1413
|
+
fixInstructions
|
|
1414
|
+
}
|
|
1402
1415
|
}
|
|
1403
1416
|
`;
|
|
1404
1417
|
defaultWrapper = (action, _operationName, _operationType, _variables) => action();
|
|
@@ -1776,6 +1789,21 @@ var init_issue = __esm({
|
|
|
1776
1789
|
}
|
|
1777
1790
|
});
|
|
1778
1791
|
|
|
1792
|
+
// src/features/analysis/scm/shared/src/issueTypeCatalog.ts
|
|
1793
|
+
function getIssueTypeCatalogEntry(value) {
|
|
1794
|
+
if (!catalog || !value) {
|
|
1795
|
+
return void 0;
|
|
1796
|
+
}
|
|
1797
|
+
return catalog.get(value);
|
|
1798
|
+
}
|
|
1799
|
+
var catalog;
|
|
1800
|
+
var init_issueTypeCatalog = __esm({
|
|
1801
|
+
"src/features/analysis/scm/shared/src/issueTypeCatalog.ts"() {
|
|
1802
|
+
"use strict";
|
|
1803
|
+
catalog = null;
|
|
1804
|
+
}
|
|
1805
|
+
});
|
|
1806
|
+
|
|
1779
1807
|
// src/features/analysis/scm/shared/src/getIssueType.ts
|
|
1780
1808
|
import { z as z5 } from "zod";
|
|
1781
1809
|
var issueTypeMap, issueTypeZ, getIssueTypeFriendlyString, statusMap, statusZ, issueDescription;
|
|
@@ -1783,6 +1811,7 @@ var init_getIssueType = __esm({
|
|
|
1783
1811
|
"src/features/analysis/scm/shared/src/getIssueType.ts"() {
|
|
1784
1812
|
"use strict";
|
|
1785
1813
|
init_client_generates();
|
|
1814
|
+
init_issueTypeCatalog();
|
|
1786
1815
|
issueTypeMap = {
|
|
1787
1816
|
["NO_LIMITS_OR_THROTTLING" /* NoLimitsOrThrottling */]: "Missing Rate Limiting",
|
|
1788
1817
|
["SQL_Injection" /* SqlInjection */]: "SQL Injection",
|
|
@@ -1938,6 +1967,10 @@ var init_getIssueType = __esm({
|
|
|
1938
1967
|
};
|
|
1939
1968
|
issueTypeZ = z5.nativeEnum(IssueType_Enum);
|
|
1940
1969
|
getIssueTypeFriendlyString = (issueType) => {
|
|
1970
|
+
const fromCatalog = getIssueTypeCatalogEntry(issueType)?.label;
|
|
1971
|
+
if (fromCatalog) {
|
|
1972
|
+
return fromCatalog;
|
|
1973
|
+
}
|
|
1941
1974
|
const issueTypeZParseRes = issueTypeZ.safeParse(issueType);
|
|
1942
1975
|
if (!issueTypeZParseRes.success) {
|
|
1943
1976
|
return issueType ? issueType.replaceAll("_", " ") : "Other";
|
|
@@ -6895,6 +6928,7 @@ var IssueTypeAndLanguageZ = z12.object({
|
|
|
6895
6928
|
});
|
|
6896
6929
|
|
|
6897
6930
|
// src/features/analysis/scm/shared/src/index.ts
|
|
6931
|
+
init_issueTypeCatalog();
|
|
6898
6932
|
init_types2();
|
|
6899
6933
|
init_urlParser2();
|
|
6900
6934
|
init_validations();
|
package/dist/index.mjs
CHANGED
|
@@ -144,10 +144,13 @@ function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
144
144
|
},
|
|
145
145
|
getMvsProject(variables, requestHeaders, signal) {
|
|
146
146
|
return withWrapper((wrappedRequestHeaders) => client.request({ document: GetMvsProjectDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "getMvsProject", "mutation", variables);
|
|
147
|
+
},
|
|
148
|
+
IssueTypes(variables, requestHeaders, signal) {
|
|
149
|
+
return withWrapper((wrappedRequestHeaders) => client.request({ document: IssueTypesDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "IssueTypes", "query", variables);
|
|
147
150
|
}
|
|
148
151
|
};
|
|
149
152
|
}
|
|
150
|
-
var AiBlameInferenceType, FixQuestionInputType, Language, ManifestAction, Effort_To_Apply_Fix_Enum, Fix_Rating_Tag_Enum, Fix_Report_State_Enum, Fix_State_Enum, IssueLanguage_Enum, IssueType_Enum, Pr_Status_Enum, Project_Role_Type_Enum, Vulnerability_Report_Issue_Category_Enum, Vulnerability_Report_Issue_State_Enum, Vulnerability_Report_Issue_Tag_Enum, Vulnerability_Report_Vendor_Enum, Vulnerability_Severity_Enum, FixDetailsFragmentDoc, FixReportSummaryFieldsFragmentDoc, MeDocument, GetLastOrgAndNamedProjectDocument, GetLastOrgDocument, GetEncryptedApiTokenDocument, FixReportStateDocument, GetVulnerabilityReportPathsDocument, GetAnalysisSubscriptionDocument, GetAnalysisDocument, GetFixesDocument, GetVulByNodesMetadataDocument, GetFalsePositiveDocument, UpdateScmTokenDocument, UploadS3BucketInfoDocument, GetTracyDiffUploadUrlDocument, AnalyzeCommitForExtensionAiBlameDocument, GetAiBlameInferenceDocument, GetAiBlameAttributionPromptDocument, GetPromptSummaryDocument, UploadAiBlameInferencesInitDocument, FinalizeAiBlameInferencesUploadDocument, UploadTracyRecordsDocument, GetTracyRawDataUploadUrlDocument, DigestVulnerabilityReportDocument, SubmitVulnerabilityReportDocument, CreateCommunityUserDocument, CreateCliLoginDocument, PerformCliLoginDocument, SetQuarantineEnabledDocument, CreateProjectDocument, ValidateRepoUrlDocument, GitReferenceDocument, AutoPrAnalysisDocument, GetFixWithAnswersDocument, GetFixReportsByRepoUrlDocument, GetReportFixesDocument, GetLatestReportByRepoUrlDocument, UpdateDownloadedFixDataDocument, GetUserMvsAutoFixDocument, StreamBlameAiAnalysisRequestsDocument, StreamCommitBlameRequestsDocument, ScanSkillDocument, SkillVerdictsByMd5Document, LogMvsEventDocument, GetMvsProjectDocument, defaultWrapper;
|
|
153
|
+
var AiBlameInferenceType, FixQuestionInputType, Language, ManifestAction, Effort_To_Apply_Fix_Enum, Fix_Rating_Tag_Enum, Fix_Report_State_Enum, Fix_State_Enum, IssueLanguage_Enum, IssueType_Enum, Pr_Status_Enum, Project_Role_Type_Enum, Vulnerability_Report_Issue_Category_Enum, Vulnerability_Report_Issue_State_Enum, Vulnerability_Report_Issue_Tag_Enum, Vulnerability_Report_Vendor_Enum, Vulnerability_Severity_Enum, FixDetailsFragmentDoc, FixReportSummaryFieldsFragmentDoc, MeDocument, GetLastOrgAndNamedProjectDocument, GetLastOrgDocument, GetEncryptedApiTokenDocument, FixReportStateDocument, GetVulnerabilityReportPathsDocument, GetAnalysisSubscriptionDocument, GetAnalysisDocument, GetFixesDocument, GetVulByNodesMetadataDocument, GetFalsePositiveDocument, UpdateScmTokenDocument, UploadS3BucketInfoDocument, GetTracyDiffUploadUrlDocument, AnalyzeCommitForExtensionAiBlameDocument, GetAiBlameInferenceDocument, GetAiBlameAttributionPromptDocument, GetPromptSummaryDocument, UploadAiBlameInferencesInitDocument, FinalizeAiBlameInferencesUploadDocument, UploadTracyRecordsDocument, GetTracyRawDataUploadUrlDocument, DigestVulnerabilityReportDocument, SubmitVulnerabilityReportDocument, CreateCommunityUserDocument, CreateCliLoginDocument, PerformCliLoginDocument, SetQuarantineEnabledDocument, CreateProjectDocument, ValidateRepoUrlDocument, GitReferenceDocument, AutoPrAnalysisDocument, GetFixWithAnswersDocument, GetFixReportsByRepoUrlDocument, GetReportFixesDocument, GetLatestReportByRepoUrlDocument, UpdateDownloadedFixDataDocument, GetUserMvsAutoFixDocument, StreamBlameAiAnalysisRequestsDocument, StreamCommitBlameRequestsDocument, ScanSkillDocument, SkillVerdictsByMd5Document, LogMvsEventDocument, GetMvsProjectDocument, IssueTypesDocument, defaultWrapper;
|
|
151
154
|
var init_client_generates = __esm({
|
|
152
155
|
"src/features/analysis/scm/generates/client_generates.ts"() {
|
|
153
156
|
"use strict";
|
|
@@ -1399,12 +1402,37 @@ var init_client_generates = __esm({
|
|
|
1399
1402
|
getMvsProject(organizationId: $organizationId) {
|
|
1400
1403
|
projectId
|
|
1401
1404
|
}
|
|
1405
|
+
}
|
|
1406
|
+
`;
|
|
1407
|
+
IssueTypesDocument = `
|
|
1408
|
+
query IssueTypes {
|
|
1409
|
+
issueTypes {
|
|
1410
|
+
value
|
|
1411
|
+
label
|
|
1412
|
+
issueDescription
|
|
1413
|
+
fixInstructions
|
|
1414
|
+
}
|
|
1402
1415
|
}
|
|
1403
1416
|
`;
|
|
1404
1417
|
defaultWrapper = (action, _operationName, _operationType, _variables) => action();
|
|
1405
1418
|
}
|
|
1406
1419
|
});
|
|
1407
1420
|
|
|
1421
|
+
// src/features/analysis/scm/shared/src/issueTypeCatalog.ts
|
|
1422
|
+
function getIssueTypeCatalogEntry(value) {
|
|
1423
|
+
if (!catalog || !value) {
|
|
1424
|
+
return void 0;
|
|
1425
|
+
}
|
|
1426
|
+
return catalog.get(value);
|
|
1427
|
+
}
|
|
1428
|
+
var catalog;
|
|
1429
|
+
var init_issueTypeCatalog = __esm({
|
|
1430
|
+
"src/features/analysis/scm/shared/src/issueTypeCatalog.ts"() {
|
|
1431
|
+
"use strict";
|
|
1432
|
+
catalog = null;
|
|
1433
|
+
}
|
|
1434
|
+
});
|
|
1435
|
+
|
|
1408
1436
|
// src/features/analysis/scm/shared/src/getIssueType.ts
|
|
1409
1437
|
import { z } from "zod";
|
|
1410
1438
|
function getTagTooltip(tag2) {
|
|
@@ -1448,6 +1476,7 @@ var init_getIssueType = __esm({
|
|
|
1448
1476
|
"src/features/analysis/scm/shared/src/getIssueType.ts"() {
|
|
1449
1477
|
"use strict";
|
|
1450
1478
|
init_client_generates();
|
|
1479
|
+
init_issueTypeCatalog();
|
|
1451
1480
|
issueTypeMap = {
|
|
1452
1481
|
["NO_LIMITS_OR_THROTTLING" /* NoLimitsOrThrottling */]: "Missing Rate Limiting",
|
|
1453
1482
|
["SQL_Injection" /* SqlInjection */]: "SQL Injection",
|
|
@@ -1603,6 +1632,10 @@ var init_getIssueType = __esm({
|
|
|
1603
1632
|
};
|
|
1604
1633
|
issueTypeZ = z.nativeEnum(IssueType_Enum);
|
|
1605
1634
|
getIssueTypeFriendlyString = (issueType) => {
|
|
1635
|
+
const fromCatalog = getIssueTypeCatalogEntry(issueType)?.label;
|
|
1636
|
+
if (fromCatalog) {
|
|
1637
|
+
return fromCatalog;
|
|
1638
|
+
}
|
|
1606
1639
|
const issueTypeZParseRes = issueTypeZ.safeParse(issueType);
|
|
1607
1640
|
if (!issueTypeZParseRes.success) {
|
|
1608
1641
|
return issueType ? issueType.replaceAll("_", " ") : "Other";
|
|
@@ -6805,6 +6838,7 @@ function getGuidances(args) {
|
|
|
6805
6838
|
}
|
|
6806
6839
|
|
|
6807
6840
|
// src/features/analysis/scm/shared/src/index.ts
|
|
6841
|
+
init_issueTypeCatalog();
|
|
6808
6842
|
init_types2();
|
|
6809
6843
|
init_urlParser2();
|
|
6810
6844
|
|
|
@@ -8780,6 +8814,35 @@ function getBitbucketSdk(params) {
|
|
|
8780
8814
|
return { accountId: null, email: null };
|
|
8781
8815
|
}
|
|
8782
8816
|
},
|
|
8817
|
+
async listRecentCommits(params2) {
|
|
8818
|
+
const sinceDate = new Date(params2.since);
|
|
8819
|
+
const commits = [];
|
|
8820
|
+
const MAX_PAGES = 100;
|
|
8821
|
+
let page = 1;
|
|
8822
|
+
let done = false;
|
|
8823
|
+
while (!done && page <= MAX_PAGES) {
|
|
8824
|
+
const res = await bitbucketClient.repositories.listCommits({
|
|
8825
|
+
repo_slug: params2.repo_slug,
|
|
8826
|
+
workspace: params2.workspace,
|
|
8827
|
+
page: String(page),
|
|
8828
|
+
pagelen: 100
|
|
8829
|
+
});
|
|
8830
|
+
const data = res.data;
|
|
8831
|
+
const values = data?.values ?? [];
|
|
8832
|
+
if (values.length === 0) break;
|
|
8833
|
+
for (const commit of values) {
|
|
8834
|
+
const date = commit?.["date"];
|
|
8835
|
+
if (date && new Date(date) < sinceDate) {
|
|
8836
|
+
done = true;
|
|
8837
|
+
continue;
|
|
8838
|
+
}
|
|
8839
|
+
commits.push(commit);
|
|
8840
|
+
}
|
|
8841
|
+
if (!data?.next) break;
|
|
8842
|
+
page++;
|
|
8843
|
+
}
|
|
8844
|
+
return commits;
|
|
8845
|
+
},
|
|
8783
8846
|
async getRepoCommitAuthors(params2) {
|
|
8784
8847
|
try {
|
|
8785
8848
|
const res = await bitbucketClient.repositories.listCommits({
|
|
@@ -9123,8 +9186,33 @@ var BitbucketSCMLib = class extends SCMLib {
|
|
|
9123
9186
|
async getPullRequestMetrics(_prNumber) {
|
|
9124
9187
|
throw new Error("getPullRequestMetrics not implemented for Bitbucket");
|
|
9125
9188
|
}
|
|
9126
|
-
async getRecentCommits(
|
|
9127
|
-
|
|
9189
|
+
async getRecentCommits(since) {
|
|
9190
|
+
this._validateAccessTokenAndUrl();
|
|
9191
|
+
const { workspace, repo_slug } = parseBitbucketOrganizationAndRepo(this.url);
|
|
9192
|
+
const bitbucketSdk = createBitbucketSdk(this.accessToken);
|
|
9193
|
+
const rawCommits = await bitbucketSdk.listRecentCommits({
|
|
9194
|
+
workspace,
|
|
9195
|
+
repo_slug,
|
|
9196
|
+
since
|
|
9197
|
+
});
|
|
9198
|
+
return {
|
|
9199
|
+
data: rawCommits.map((commit) => {
|
|
9200
|
+
const c = commit;
|
|
9201
|
+
const author = c["author"];
|
|
9202
|
+
const match = author?.raw?.match(/^(.+?)\s*<([^>]+)>/);
|
|
9203
|
+
return {
|
|
9204
|
+
sha: c["hash"] ?? "",
|
|
9205
|
+
commit: {
|
|
9206
|
+
committer: c["date"] ? { date: c["date"] } : void 0,
|
|
9207
|
+
author: match ? { name: match[1]?.trim(), email: match[2] } : void 0,
|
|
9208
|
+
message: c["message"] ?? ""
|
|
9209
|
+
},
|
|
9210
|
+
// Bitbucket resolves the commit to an account when it can; account_id
|
|
9211
|
+
// matches repo_contributor.external_id for Bitbucket rows.
|
|
9212
|
+
authorExternalId: author?.user?.account_id ?? null
|
|
9213
|
+
};
|
|
9214
|
+
})
|
|
9215
|
+
};
|
|
9128
9216
|
}
|
|
9129
9217
|
async getRateLimitStatus() {
|
|
9130
9218
|
return null;
|
|
@@ -9389,7 +9477,7 @@ function getOctoKit(options) {
|
|
|
9389
9477
|
octokit.log.warn(
|
|
9390
9478
|
`Request quota exhausted for request ${options2.method} ${options2.url}`
|
|
9391
9479
|
);
|
|
9392
|
-
if (retryCount
|
|
9480
|
+
if (retryCount < 3) {
|
|
9393
9481
|
octokit.log.info(`Retrying after ${retryAfter} seconds!`);
|
|
9394
9482
|
return true;
|
|
9395
9483
|
}
|
|
@@ -9399,7 +9487,7 @@ function getOctoKit(options) {
|
|
|
9399
9487
|
octokit.log.warn(
|
|
9400
9488
|
`SecondaryRateLimit detected for request ${options2.method} ${options2.url}`
|
|
9401
9489
|
);
|
|
9402
|
-
if (retryCount
|
|
9490
|
+
if (retryCount < 3) {
|
|
9403
9491
|
octokit.log.info(`Retrying after ${retryAfter} seconds!`);
|
|
9404
9492
|
return true;
|
|
9405
9493
|
}
|
|
@@ -10164,10 +10252,16 @@ function getGithubSdk(params = {}) {
|
|
|
10164
10252
|
});
|
|
10165
10253
|
return members;
|
|
10166
10254
|
},
|
|
10167
|
-
async getUserProfile(
|
|
10255
|
+
async getUserProfile(getProfileParams) {
|
|
10256
|
+
const cache = params.userProfileCache;
|
|
10257
|
+
const cached = cache?.get(getProfileParams.username);
|
|
10258
|
+
if (cached) {
|
|
10259
|
+
return cached;
|
|
10260
|
+
}
|
|
10168
10261
|
const { data } = await octokit.rest.users.getByUsername({
|
|
10169
|
-
username:
|
|
10262
|
+
username: getProfileParams.username
|
|
10170
10263
|
});
|
|
10264
|
+
cache?.set(getProfileParams.username, data);
|
|
10171
10265
|
return data;
|
|
10172
10266
|
},
|
|
10173
10267
|
async getLatestRepoCommitByAuthor(params2) {
|
|
@@ -10260,12 +10354,16 @@ function determinePrStatus(state, isDraft) {
|
|
|
10260
10354
|
}
|
|
10261
10355
|
var GithubSCMLib = class extends SCMLib {
|
|
10262
10356
|
// we don't always need a url, what's important is that we have an access token
|
|
10263
|
-
constructor(url, accessToken, scmOrg) {
|
|
10357
|
+
constructor(url, accessToken, scmOrg, options) {
|
|
10264
10358
|
super(url, accessToken, scmOrg);
|
|
10265
10359
|
__publicField(this, "githubSdk");
|
|
10266
10360
|
this.githubSdk = getGithubSdk({
|
|
10267
10361
|
auth: accessToken,
|
|
10268
|
-
url
|
|
10362
|
+
url,
|
|
10363
|
+
// Honor GitHub's rate-limit/Retry-After backoff for bulk callers
|
|
10364
|
+
// (e.g. the contributor sync) instead of failing fast.
|
|
10365
|
+
isEnableRetries: options?.enableThrottling,
|
|
10366
|
+
userProfileCache: options?.userProfileCache
|
|
10269
10367
|
});
|
|
10270
10368
|
}
|
|
10271
10369
|
async createSubmitRequest(params) {
|
|
@@ -10395,7 +10493,13 @@ var GithubSCMLib = class extends SCMLib {
|
|
|
10395
10493
|
author: c.commit.author ? { email: c.commit.author.email, name: c.commit.author.name } : void 0,
|
|
10396
10494
|
message: c.commit.message
|
|
10397
10495
|
},
|
|
10398
|
-
parents: c.parents?.map((p) => ({ sha: p.sha }))
|
|
10496
|
+
parents: c.parents?.map((p) => ({ sha: p.sha })),
|
|
10497
|
+
// Top-level `author` is GitHub's resolution of the commit to an account
|
|
10498
|
+
// (null when GitHub can't tie the commit email to a user). Its numeric
|
|
10499
|
+
// id matches repo_contributor.external_id (stored as String(id)), and
|
|
10500
|
+
// its type marks GitHub App / bot accounts authoritatively.
|
|
10501
|
+
authorExternalId: c.author?.id != null ? String(c.author.id) : null,
|
|
10502
|
+
authorIsBot: c.author?.type === "Bot"
|
|
10399
10503
|
}))
|
|
10400
10504
|
};
|
|
10401
10505
|
}
|
|
@@ -10464,7 +10568,11 @@ var GithubSCMLib = class extends SCMLib {
|
|
|
10464
10568
|
author: c.login
|
|
10465
10569
|
}
|
|
10466
10570
|
);
|
|
10467
|
-
const
|
|
10571
|
+
const commitAuthor = commit?.commit?.author;
|
|
10572
|
+
const commitEmail = commitAuthor?.email;
|
|
10573
|
+
if (commitAuthor?.name && displayName === c.login) {
|
|
10574
|
+
displayName = commitAuthor.name;
|
|
10575
|
+
}
|
|
10468
10576
|
if (commitEmail) {
|
|
10469
10577
|
if (isRealEmail(commitEmail)) {
|
|
10470
10578
|
profileEmail = commitEmail;
|
|
@@ -10543,6 +10651,11 @@ var GithubSCMLib = class extends SCMLib {
|
|
|
10543
10651
|
username: c.login
|
|
10544
10652
|
});
|
|
10545
10653
|
}
|
|
10654
|
+
contextLogger.info("[GitHub] Contributor resolved", {
|
|
10655
|
+
username: c.login,
|
|
10656
|
+
profileName: displayName,
|
|
10657
|
+
displayNameIsNull: displayName === null
|
|
10658
|
+
});
|
|
10546
10659
|
return {
|
|
10547
10660
|
externalId: String(c.id),
|
|
10548
10661
|
username: c.login ?? null,
|
|
@@ -12321,12 +12434,20 @@ var StubSCMLib = class extends SCMLib {
|
|
|
12321
12434
|
};
|
|
12322
12435
|
|
|
12323
12436
|
// src/features/analysis/scm/scmFactory.ts
|
|
12324
|
-
async function createScmLib({ url, accessToken, scmType, scmOrg }, {
|
|
12437
|
+
async function createScmLib({ url, accessToken, scmType, scmOrg }, {
|
|
12438
|
+
propagateExceptions = false,
|
|
12439
|
+
skipValidation = false,
|
|
12440
|
+
enableThrottling = false,
|
|
12441
|
+
githubUserProfileCache
|
|
12442
|
+
} = {}) {
|
|
12325
12443
|
const trimmedUrl = url ? url.trim().replace(/\/$/, "").replace(/.git$/i, "") : void 0;
|
|
12326
12444
|
try {
|
|
12327
12445
|
switch (scmType) {
|
|
12328
12446
|
case "GITHUB" /* GITHUB */: {
|
|
12329
|
-
const scm = new GithubSCMLib(trimmedUrl, accessToken, scmOrg
|
|
12447
|
+
const scm = new GithubSCMLib(trimmedUrl, accessToken, scmOrg, {
|
|
12448
|
+
enableThrottling,
|
|
12449
|
+
userProfileCache: githubUserProfileCache
|
|
12450
|
+
});
|
|
12330
12451
|
if (!skipValidation) await scm.validateParams();
|
|
12331
12452
|
return scm;
|
|
12332
12453
|
}
|
|
@@ -19943,7 +20064,7 @@ function createLogger(config2) {
|
|
|
19943
20064
|
|
|
19944
20065
|
// src/features/claude_code/hook_logger.ts
|
|
19945
20066
|
var DD_RUM_TOKEN = true ? "pubf59c0182545bfb4c299175119f1abf9b" : "";
|
|
19946
|
-
var CLI_VERSION = true ? "1.4.
|
|
20067
|
+
var CLI_VERSION = true ? "1.4.31" : "unknown";
|
|
19947
20068
|
var NAMESPACE = "mobbdev-claude-code-hook-logs";
|
|
19948
20069
|
var claudeCodeVersion;
|
|
19949
20070
|
function buildDdTags() {
|