diff --git a/DiffPalReviewDevV1/task.json b/DiffPalReviewDevV1/task.json index 25f866d..8cdbde2 100644 --- a/DiffPalReviewDevV1/task.json +++ b/DiffPalReviewDevV1/task.json @@ -10,7 +10,7 @@ "version": { "Major": 1, "Minor": 6, - "Patch": 13 + "Patch": 14 }, "minimumAgentVersion": "3.224.0", "instanceNameFormat": "DiffPal Review Dev", @@ -28,7 +28,7 @@ "type": "string", "label": "DiffPal version", "required": false, - "defaultValue": "0.1.34", + "defaultValue": "0.1.35", "helpMarkDown": "npm version or dist-tag for @diffpal/diffpal." }, { @@ -101,6 +101,14 @@ "defaultValue": "false", "helpMarkDown": "Print resolved Azure PR context, base/head revisions, merge-base, and redacted CLI arguments before running DiffPal." }, + { + "name": "debug", + "type": "boolean", + "label": "Enable DiffPal debug logging", + "required": false, + "defaultValue": "false", + "helpMarkDown": "Pass --debug to DiffPal so provider and runtime diagnostics are printed." + }, { "name": "mode", "type": "string", diff --git a/DiffPalReviewV1/task.json b/DiffPalReviewV1/task.json index 7f576d9..e0d7c15 100644 --- a/DiffPalReviewV1/task.json +++ b/DiffPalReviewV1/task.json @@ -10,7 +10,7 @@ "version": { "Major": 1, "Minor": 6, - "Patch": 13 + "Patch": 14 }, "minimumAgentVersion": "3.224.0", "instanceNameFormat": "DiffPal Review", @@ -28,7 +28,7 @@ "type": "string", "label": "DiffPal version", "required": false, - "defaultValue": "0.1.34", + "defaultValue": "0.1.35", "helpMarkDown": "npm version or dist-tag for @diffpal/diffpal." }, { @@ -101,6 +101,14 @@ "defaultValue": "false", "helpMarkDown": "Print resolved Azure PR context, base/head revisions, merge-base, and redacted CLI arguments before running DiffPal." }, + { + "name": "debug", + "type": "boolean", + "label": "Enable DiffPal debug logging", + "required": false, + "defaultValue": "false", + "helpMarkDown": "Pass --debug to DiffPal so provider and runtime diagnostics are printed." + }, { "name": "mode", "type": "string", diff --git a/README.md b/README.md index ea2a2e0..f32503e 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ VSIX packaging, and Marketplace release flow. The task installs `@diffpal/diffpal` by default and runs `diffpal review ado`. Bring the provider recipe you want to use; the Azure review flow stays the same. -By default it installs `@diffpal/diffpal@0.1.34`, the tested CLI release paired +By default it installs `@diffpal/diffpal@0.1.35`, the tested CLI release paired with this extension. Set `diffpalVersion` only when you need to override that default rollout. @@ -38,6 +38,9 @@ defaults are ignored, and explicit invalid paths fail with task-level messages. Set `explain: true` to print the resolved PR id, branches, commits, merge-base, base/head, and redacted CLI arguments before the review starts. +Set `debug: true` to pass `--debug` to DiffPal and enable provider/runtime +diagnostics. This is separate from Azure `System.Debug`. + With `feedback: balanced` or `feedback: inline`, DiffPal publishes Azure threads for all findings. Blocking findings stay active; non-blocking findings are published as closed immediately. Findings without canonical file/line mapping to @@ -67,7 +70,7 @@ steps: - task: DiffPalReview@1 displayName: DiffPal review inputs: - diffpalVersion: 0.1.34 + diffpalVersion: 0.1.35 profile: ci feedback: balanced env: diff --git a/package-lock.json b/package-lock.json index 1397d4c..8ed1f93 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@diffpal/azure-devops-extension", - "version": "0.1.35", + "version": "0.1.36", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@diffpal/azure-devops-extension", - "version": "0.1.35", + "version": "0.1.36", "license": "MIT", "dependencies": { "azure-pipelines-task-lib": "5.2.10" diff --git a/package.json b/package.json index 14fc11c..14c0c19 100644 --- a/package.json +++ b/package.json @@ -34,5 +34,5 @@ "publish:prod": "npm run build \u0026\u0026 tfx extension publish --manifest-globs vss-extension.json", "smoke": "npm run build \u0026\u0026 node scripts/smoke-test.js" }, - "version": "0.1.35" + "version": "0.1.36" } diff --git a/scripts/smoke-test.js b/scripts/smoke-test.js index 091a4e8..42d6695 100644 --- a/scripts/smoke-test.js +++ b/scripts/smoke-test.js @@ -155,10 +155,42 @@ function testDefaultPinnedVersionIsUsedWhenInputIsUnset() { PATH: `${fakeBin}${path.delimiter}${process.env.PATH || ""}` }); - assert(read(npmArgv).includes("@diffpal/diffpal@0.1.34"), "default install did not request the pinned DiffPal version"); + assert(read(npmArgv).includes("@diffpal/diffpal@0.1.35"), "default install did not request the pinned DiffPal version"); assert(read(diffpalArgv).includes("review\nado"), "default pinned version did not run diffpal review ado"); } +function testDebugInputForwardsDebugFlag() { + const dir = fs.mkdtempSync(path.join(os.tmpdir(), "diffpal-ado-debug-")); + const diffpalArgv = path.join(dir, "diffpal-argv"); + const customDiffPal = path.join(dir, "diffpal"); + makeFakeDiffPal(customDiffPal, diffpalArgv); + + runHandler("debug input", { + INPUT_INSTALL: "false", + INPUT_DIFFPALPATH: customDiffPal, + INPUT_DEBUG: "true" + }); + + const argv = read(diffpalArgv).split("\n").filter(Boolean); + assert(argv[0] === "--debug", `debug flag should be forwarded before subcommands, got ${JSON.stringify(argv)}`); + assert(argv.includes("review") && argv.includes("ado"), "debug input should still run diffpal review ado"); +} + +function testDebugDefaultsOff() { + const dir = fs.mkdtempSync(path.join(os.tmpdir(), "diffpal-ado-debug-default-")); + const diffpalArgv = path.join(dir, "diffpal-argv"); + const customDiffPal = path.join(dir, "diffpal"); + makeFakeDiffPal(customDiffPal, diffpalArgv); + + runHandler("debug default off", { + INPUT_INSTALL: "false", + INPUT_DIFFPALPATH: customDiffPal + }); + + const argv = read(diffpalArgv).split("\n").filter(Boolean); + assert(!argv.includes("--debug"), `debug flag should be omitted by default, got ${JSON.stringify(argv)}`); +} + function testCustomPathSkipsInstall() { const dir = fs.mkdtempSync(path.join(os.tmpdir(), "diffpal-ado-custom-")); const fakeBin = path.join(dir, "bin"); @@ -565,6 +597,8 @@ function testNonGateFailureStaysGeneric() { testDefaultInstall(); testDefaultPinnedVersionIsUsedWhenInputIsUnset(); +testDebugInputForwardsDebugFlag(); +testDebugDefaultsOff(); testCustomPathSkipsInstall(); testInstallDisabledUsesPath(); testDefaultInstructionsFileDirectoryIsIgnored(); diff --git a/src/index.ts b/src/index.ts index 1456665..74b7000 100644 --- a/src/index.ts +++ b/src/index.ts @@ -25,7 +25,7 @@ type ReviewRange = { pullRequest: PullRequestContext; }; -const DEFAULT_DIFFPAL_VERSION = "0.1.34"; +const DEFAULT_DIFFPAL_VERSION = "0.1.35"; const TRANSIENT_REVIEW_EXIT_CODE = 3; const REVIEW_BLOCKED_EXIT_CODE = 10; @@ -468,6 +468,9 @@ async function run(): Promise { const gate = tl.getBoolInput("gate", false); const args: string[] = []; + if (boolInput("debug", false)) { + args.push("--debug"); + } addOptional(args, "--config-dir", resolveConfigDir(input("configDir"))); addOptional(args, "--profile", input("profile")); args.push("review", "ado", "--base", base, "--head", head, "--block-on", blockOn); diff --git a/vss-extension.dev.json b/vss-extension.dev.json index 5e67e0b..cf4936b 100644 --- a/vss-extension.dev.json +++ b/vss-extension.dev.json @@ -46,5 +46,5 @@ "id": "Microsoft.VisualStudio.Services" } ], - "version": "0.1.35" + "version": "0.1.36" } diff --git a/vss-extension.json b/vss-extension.json index 46bee59..1352056 100644 --- a/vss-extension.json +++ b/vss-extension.json @@ -46,5 +46,5 @@ "id": "Microsoft.VisualStudio.Services" } ], - "version": "0.1.35" + "version": "0.1.36" }