mobbdev 1.0.81 → 1.0.82
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/index.mjs +48 -12
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -891,11 +891,12 @@ var GitReferenceDocument = `
|
|
|
891
891
|
}
|
|
892
892
|
`;
|
|
893
893
|
var AutoPrAnalysisDocument = `
|
|
894
|
-
mutation autoPrAnalysis($analysisId: String!, $commitDirectly: Boolean, $prId: Int) {
|
|
894
|
+
mutation autoPrAnalysis($analysisId: String!, $commitDirectly: Boolean, $prId: Int, $prStrategy: PRStrategy) {
|
|
895
895
|
autoPrAnalysis(
|
|
896
896
|
analysisId: $analysisId
|
|
897
897
|
sameBranchCommit: $commitDirectly
|
|
898
898
|
prId: $prId
|
|
899
|
+
prStrategy: $prStrategy
|
|
899
900
|
) {
|
|
900
901
|
__typename
|
|
901
902
|
... on AutoPrSuccess {
|
|
@@ -7562,6 +7563,13 @@ var autoPrOption = {
|
|
|
7562
7563
|
type: "boolean",
|
|
7563
7564
|
default: false
|
|
7564
7565
|
};
|
|
7566
|
+
var createOnePrOption = {
|
|
7567
|
+
describe: chalk2.bold(
|
|
7568
|
+
"Create a single unified PR for all fixes (requires --auto-pr)"
|
|
7569
|
+
),
|
|
7570
|
+
type: "boolean",
|
|
7571
|
+
default: false
|
|
7572
|
+
};
|
|
7565
7573
|
var commitDirectlyOption = {
|
|
7566
7574
|
describe: chalk2.bold(
|
|
7567
7575
|
"Commit directly to the scanned branch instead of creating a pull request"
|
|
@@ -8242,7 +8250,14 @@ ${contextString}` : description;
|
|
|
8242
8250
|
import Debug9 from "debug";
|
|
8243
8251
|
var debug9 = Debug9("mobbdev:handleAutoPr");
|
|
8244
8252
|
async function handleAutoPr(params) {
|
|
8245
|
-
const {
|
|
8253
|
+
const {
|
|
8254
|
+
gqlClient,
|
|
8255
|
+
analysisId,
|
|
8256
|
+
commitDirectly,
|
|
8257
|
+
prId,
|
|
8258
|
+
createSpinner: createSpinner5,
|
|
8259
|
+
createOnePr
|
|
8260
|
+
} = params;
|
|
8246
8261
|
const createAutoPrSpinner = createSpinner5(
|
|
8247
8262
|
"\u{1F504} Waiting for the analysis to finish before initiating automatic pull request creation"
|
|
8248
8263
|
).start();
|
|
@@ -8251,11 +8266,12 @@ async function handleAutoPr(params) {
|
|
|
8251
8266
|
analysisId
|
|
8252
8267
|
},
|
|
8253
8268
|
callback: async (analysisId2) => {
|
|
8254
|
-
const autoPrAnalysisRes = await gqlClient.autoPrAnalysis(
|
|
8255
|
-
analysisId2,
|
|
8269
|
+
const autoPrAnalysisRes = await gqlClient.autoPrAnalysis({
|
|
8270
|
+
analysisId: analysisId2,
|
|
8256
8271
|
commitDirectly,
|
|
8257
|
-
prId
|
|
8258
|
-
|
|
8272
|
+
prId,
|
|
8273
|
+
prStrategy: createOnePr ? "CONDENSE" /* Condense */ : "SPREAD" /* Spread */
|
|
8274
|
+
});
|
|
8259
8275
|
debug9("auto pr analysis res %o", autoPrAnalysisRes);
|
|
8260
8276
|
if (autoPrAnalysisRes.autoPrAnalysis?.__typename === "AutoPrError") {
|
|
8261
8277
|
createAutoPrSpinner.error({
|
|
@@ -8804,11 +8820,17 @@ var GQLClient = class {
|
|
|
8804
8820
|
}
|
|
8805
8821
|
return res.analysis;
|
|
8806
8822
|
}
|
|
8807
|
-
async autoPrAnalysis(
|
|
8823
|
+
async autoPrAnalysis({
|
|
8824
|
+
analysisId,
|
|
8825
|
+
commitDirectly,
|
|
8826
|
+
prId,
|
|
8827
|
+
prStrategy
|
|
8828
|
+
}) {
|
|
8808
8829
|
return this._clientSdk.autoPrAnalysis({
|
|
8809
8830
|
analysisId,
|
|
8810
8831
|
commitDirectly,
|
|
8811
|
-
prId
|
|
8832
|
+
prId,
|
|
8833
|
+
prStrategy
|
|
8812
8834
|
});
|
|
8813
8835
|
}
|
|
8814
8836
|
async getFixes(fixIds) {
|
|
@@ -9486,6 +9508,7 @@ async function _scan(params, { skipPrompts = false } = {}) {
|
|
|
9486
9508
|
command,
|
|
9487
9509
|
organizationId: userOrganizationId,
|
|
9488
9510
|
autoPr,
|
|
9511
|
+
createOnePr,
|
|
9489
9512
|
commitDirectly,
|
|
9490
9513
|
pullRequest
|
|
9491
9514
|
} = params;
|
|
@@ -9629,7 +9652,8 @@ async function _scan(params, { skipPrompts = false } = {}) {
|
|
|
9629
9652
|
analysisId: reportUploadInfo.fixReportId,
|
|
9630
9653
|
commitDirectly,
|
|
9631
9654
|
prId: pullRequest,
|
|
9632
|
-
createSpinner: createSpinner5
|
|
9655
|
+
createSpinner: createSpinner5,
|
|
9656
|
+
createOnePr
|
|
9633
9657
|
});
|
|
9634
9658
|
}
|
|
9635
9659
|
await askToOpenAnalysis();
|
|
@@ -9792,7 +9816,8 @@ async function _scan(params, { skipPrompts = false } = {}) {
|
|
|
9792
9816
|
analysisId: reportUploadInfo.fixReportId,
|
|
9793
9817
|
commitDirectly,
|
|
9794
9818
|
prId: pullRequest,
|
|
9795
|
-
createSpinner: createSpinner5
|
|
9819
|
+
createSpinner: createSpinner5,
|
|
9820
|
+
createOnePr
|
|
9796
9821
|
});
|
|
9797
9822
|
}
|
|
9798
9823
|
await askToOpenAnalysis();
|
|
@@ -10192,7 +10217,7 @@ function analyzeBuilder(yargs2) {
|
|
|
10192
10217
|
alias: "commit-hash",
|
|
10193
10218
|
describe: chalk8.bold("Hash of the commit"),
|
|
10194
10219
|
type: "string"
|
|
10195
|
-
}).option("mobb-project-name", mobbProjectNameOption).option("y", yesOption).option("ci", ciOption).option("org", organizationIdOptions).option("api-key", apiKeyOption).option("commit-hash", commitHashOption).option("auto-pr", autoPrOption).option("commit-directly", commitDirectlyOption).option("pull-request", {
|
|
10220
|
+
}).option("mobb-project-name", mobbProjectNameOption).option("y", yesOption).option("ci", ciOption).option("org", organizationIdOptions).option("api-key", apiKeyOption).option("commit-hash", commitHashOption).option("auto-pr", autoPrOption).option("create-one-pr", createOnePrOption).option("commit-directly", commitDirectlyOption).option("pull-request", {
|
|
10196
10221
|
alias: ["pr", "pr-number", "pr-id"],
|
|
10197
10222
|
describe: chalk8.bold("Number of the pull request"),
|
|
10198
10223
|
type: "number",
|
|
@@ -10203,6 +10228,7 @@ function analyzeBuilder(yargs2) {
|
|
|
10203
10228
|
).help();
|
|
10204
10229
|
}
|
|
10205
10230
|
function validateAnalyzeOptions(argv) {
|
|
10231
|
+
console.log("argv", argv);
|
|
10206
10232
|
if (!fs7.existsSync(argv.f)) {
|
|
10207
10233
|
throw new CliError(`
|
|
10208
10234
|
Can't access ${chalk8.bold(argv.f)}`);
|
|
@@ -10222,7 +10248,17 @@ Can't access ${chalk8.bold(argv.f)}`);
|
|
|
10222
10248
|
"--commit-directly flag requires --auto-pr to be provided as well"
|
|
10223
10249
|
);
|
|
10224
10250
|
}
|
|
10225
|
-
if (argv
|
|
10251
|
+
if (argv["create-one-pr"] && !argv["auto-pr"]) {
|
|
10252
|
+
throw new CliError(
|
|
10253
|
+
"--create-one-pr flag requires --auto-pr to be provided as well"
|
|
10254
|
+
);
|
|
10255
|
+
}
|
|
10256
|
+
if (argv["create-one-pr"] && argv.commitDirectly) {
|
|
10257
|
+
throw new CliError(
|
|
10258
|
+
"--create-one-pr and --commit-directly cannot be provided at the same time"
|
|
10259
|
+
);
|
|
10260
|
+
}
|
|
10261
|
+
if (argv.pullRequest && !argv.commitDirectly) {
|
|
10226
10262
|
throw new CliError(
|
|
10227
10263
|
"--pull-request flag requires --commit-directly to be provided as well"
|
|
10228
10264
|
);
|