Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,6 +16,7 @@ export interface AtxPlanStep {
Status: PlanStepStatus
Children: AtxPlanStep[]
HasCheckpoint?: boolean
IsStatusOnly?: boolean
}

/**
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -512,6 +512,7 @@ export class ATXTransformHandler {
jobName?: string
targetFramework?: string
interactiveMode?: InteractiveMode
generateUnitTests?: boolean
}): Promise<{ jobId: string; status: string } | null> {
try {
this.logging.log(`ATX: Starting CreateJob for workspace: ${request.workspaceId}`)
Expand All@@ -534,6 +535,13 @@ export class ATXTransformHandler {
interactive_mode: interactiveModeValue,
}

// The customer's up-front unit-test choice. Only a real boolean counts as a choice:
// clients that cannot express one omit the field, and the backend keeps legacy behavior.
// Do NOT default this to false here - an explicit false is a decline, not "no choice".
if (typeof request.generateUnitTests === 'boolean') {
objective.generate_unit_tests = request.generateUnitTests
}

const orchestratorAgent = getAtxOrchestratorAgent()
if (process.env.ATX_ORCHESTRATOR_AGENT) {
this.logging.log(
Expand DownExpand Up@@ -1163,6 +1171,7 @@ export class ATXTransformHandler {
jobName: request.jobName || 'Transform Job',
targetFramework: (request.startTransformRequest as any).TargetFramework,
interactiveMode: request.interactiveMode,
generateUnitTests: (request.startTransformRequest as any).GenerateUnitTests,
})

if (!createJobResponse?.jobId) {
Expand DownExpand Up@@ -3653,6 +3662,14 @@ export class ATXTransformHandler {
const parent = stepMap.get(step.ParentStepId)
if (parent) {
parent.Children.push(step)
// Substeps of the unit-test-generation step render status-only in the IDE
// (no checkpoint toggle / "View Results" button / checkpoint checkbox); the
// parent keeps its normal affordance. The service does not send a machine
// label, so we key off the parent's name. Only direct children are marked,
// so the parent "Generate Unit Tests" step itself stays interactive.
if (this.isUnitTestGenerationStep(parent.StepName)) {
step.IsStatusOnly = true
}
} else {
// Orphan step - treat as root level
rootChildren.push(step)
Expand All@@ -3675,6 +3692,15 @@ export class ATXTransformHandler {
* Maps an API step response to AtxPlanStep.
* Converts from FES camelCase to C#-compatible PascalCase.
*/
/**
* True when a step's name identifies it as the unit-test-generation parent step, whose
* direct substeps (plan / generate / merge / coverage) should render status-only in the IDE.
* Matches on normalized name because the service sends no machine-readable step label.
*/
private isUnitTestGenerationStep(stepName: string | undefined): boolean {
return typeof stepName === 'string' && stepName.trim().toLowerCase() === 'generate unit tests'
}

private mapApiStepToNode(apiStep: any): AtxPlanStep & { score?: number } {
return {
StepId: apiStep.stepId || '',
Expand All@@ -3683,6 +3709,12 @@ export class ATXTransformHandler {
Description: apiStep.description || '',
Status: this.mapApiStatus(apiStep.status),
Children: [],
// Defaults false here; the value is assigned structurally during tree assembly
// (buildTreeFromFlatList) for substeps of the unit-test-generation step. The service
// does not send a machine-readable step label, so parent identity — not a label —
// drives this. PascalCase matches the other fields (StepId/HasCheckpoint/...) so it
// binds onto the C# AtxPlanStep.IsStatusOnly.
IsStatusOnly: false,
// Keep score for sorting (not sent to C#)
score: apiStep.score || 0,
}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,6 +23,9 @@ export interface StartTransformRequest extends ExecuteCommandParams {
TransformNetStandardProjects: boolean
EnableRazorViewTransform: boolean
EnableWebFormsTransform: boolean
// Customer's up-front unit-test choice, forwarded to the ATX job objective as
// `generate_unit_tests`. Optional: absent means "no choice sent" (legacy behavior).
GenerateUnitTests?: boolean
PackageReferences?: PackageReferenceMetadata[]
DmsArn?: string
DatabaseSettings?: DatabaseSettings
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -778,6 +778,58 @@ describe('ATXTransformHandler - getTransformationPlan & helpers', () => {
expect(node.Status).to.equal('NOT_STARTED')
expect(node.score).to.equal(0)
})

it('mapApiStepToNode defaults IsStatusOnly to false (structural pass assigns it)', () => {
// The service sends no machine-readable step label, so the per-node mapper never
// sets IsStatusOnly; it is assigned during tree assembly based on parent identity.
const node = (handler as any).mapApiStepToNode({
stepId: 's1',
stepName: 'Merge Tests',
status: 'IN_PROGRESS',
})
expect(node.IsStatusOnly).to.equal(false)
})
})

describe('buildTreeFromFlatList - IsStatusOnly (unit-test-generation substeps)', () => {
// A realistic flat plan: a "Generate Unit Tests" parent with 4 substeps, plus a
// sibling "Transform Projects" parent with its own substep, all under root.
const flatPlan = () => [
{ stepId: 'gut', parentStepId: 'root', stepName: 'Generate Unit Tests', status: 'NOT_STARTED' },
{ stepId: 'plan', parentStepId: 'gut', stepName: 'Plan Unit Test Generation', status: 'NOT_STARTED' },
{ stepId: 'gen', parentStepId: 'gut', stepName: 'Generate Unit Tests', status: 'NOT_STARTED' },
{ stepId: 'merge', parentStepId: 'gut', stepName: 'Merge Tests', status: 'NOT_STARTED' },
{ stepId: 'cov', parentStepId: 'gut', stepName: 'Get Coverage', status: 'NOT_STARTED' },
{ stepId: 'tp', parentStepId: 'root', stepName: 'Transform Projects', status: 'NOT_STARTED' },
{ stepId: 'build', parentStepId: 'tp', stepName: 'Solution Build', status: 'NOT_STARTED' },
]

const findById = (nodes: any[], id: string): any => {
for (const n of nodes) {
if (n.StepId === id) return n
const hit = findById(n.Children || [], id)
if (hit) return hit
}
return null
}

it('marks direct substeps of "Generate Unit Tests" as IsStatusOnly=true', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
for (const id of ['plan', 'gen', 'merge', 'cov']) {
expect(findById(roots, id).IsStatusOnly, id).to.equal(true)
}
})

it('leaves the parent "Generate Unit Tests" step interactive (IsStatusOnly=false)', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
expect(findById(roots, 'gut').IsStatusOnly).to.equal(false)
})

it('does not mark transformation substeps (different parent)', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
expect(findById(roots, 'tp').IsStatusOnly).to.equal(false)
expect(findById(roots, 'build').IsStatusOnly).to.equal(false)
})
})

describe('findCompletedSteps', () => {
Expand DownExpand Up@@ -2027,6 +2079,47 @@ describe('ATXTransformHandler - lifecycle (startTransform & helpers)', () => {
const objective = JSON.parse(command.input.objective)
expect(objective.interactive_mode).to.equal('auto')
})

it('should include generate_unit_tests:true in objective when opted in', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: true })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective.generate_unit_tests).to.equal(true)
})

it('should include generate_unit_tests:false in objective on explicit decline', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: false })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective.generate_unit_tests).to.equal(false)
})

it('should omit generate_unit_tests from objective when no choice is sent', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1' })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective).to.not.have.property('generate_unit_tests')
})

it('should omit generate_unit_tests when the value is not a real boolean', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

// A mistyped/non-boolean value must read as "no choice sent", not a decision.
await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: 'true' as any })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective).to.not.have.property('generate_unit_tests')
})
})

describe('createArtifactUploadUrl', () => {
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,6 +16,7 @@ export interface AtxPlanStep {
Status: PlanStepStatus
Children: AtxPlanStep[]
HasCheckpoint?: boolean
IsStatusOnly?: boolean
}

/**
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -512,6 +512,7 @@ export class ATXTransformHandler {
jobName?: string
targetFramework?: string
interactiveMode?: InteractiveMode
generateUnitTests?: boolean
}): Promise<{ jobId: string; status: string } | null> {
try {
this.logging.log(`ATX: Starting CreateJob for workspace: ${request.workspaceId}`)
Expand All@@ -534,6 +535,13 @@ export class ATXTransformHandler {
interactive_mode: interactiveModeValue,
}

// The customer's up-front unit-test choice. Only a real boolean counts as a choice:
// clients that cannot express one omit the field, and the backend keeps legacy behavior.
// Do NOT default this to false here - an explicit false is a decline, not "no choice".
if (typeof request.generateUnitTests === 'boolean') {
objective.generate_unit_tests = request.generateUnitTests
}

const orchestratorAgent = getAtxOrchestratorAgent()
if (process.env.ATX_ORCHESTRATOR_AGENT) {
this.logging.log(
Expand DownExpand Up@@ -1163,6 +1171,7 @@ export class ATXTransformHandler {
jobName: request.jobName || 'Transform Job',
targetFramework: (request.startTransformRequest as any).TargetFramework,
interactiveMode: request.interactiveMode,
generateUnitTests: (request.startTransformRequest as any).GenerateUnitTests,
})

if (!createJobResponse?.jobId) {
Expand DownExpand Up@@ -3653,6 +3662,14 @@ export class ATXTransformHandler {
const parent = stepMap.get(step.ParentStepId)
if (parent) {
parent.Children.push(step)
// Substeps of the unit-test-generation step render status-only in the IDE
// (no checkpoint toggle / "View Results" button / checkpoint checkbox); the
// parent keeps its normal affordance. The service does not send a machine
// label, so we key off the parent's name. Only direct children are marked,
// so the parent "Generate Unit Tests" step itself stays interactive.
if (this.isUnitTestGenerationStep(parent.StepName)) {
step.IsStatusOnly = true
}
} else {
// Orphan step - treat as root level
rootChildren.push(step)
Expand All@@ -3675,6 +3692,15 @@ export class ATXTransformHandler {
* Maps an API step response to AtxPlanStep.
* Converts from FES camelCase to C#-compatible PascalCase.
*/
/**
* True when a step's name identifies it as the unit-test-generation parent step, whose
* direct substeps (plan / generate / merge / coverage) should render status-only in the IDE.
* Matches on normalized name because the service sends no machine-readable step label.
*/
private isUnitTestGenerationStep(stepName: string | undefined): boolean {
return typeof stepName === 'string' && stepName.trim().toLowerCase() === 'generate unit tests'
}

private mapApiStepToNode(apiStep: any): AtxPlanStep & { score?: number } {
return {
StepId: apiStep.stepId || '',
Expand All@@ -3683,6 +3709,12 @@ export class ATXTransformHandler {
Description: apiStep.description || '',
Status: this.mapApiStatus(apiStep.status),
Children: [],
// Defaults false here; the value is assigned structurally during tree assembly
// (buildTreeFromFlatList) for substeps of the unit-test-generation step. The service
// does not send a machine-readable step label, so parent identity — not a label —
// drives this. PascalCase matches the other fields (StepId/HasCheckpoint/...) so it
// binds onto the C# AtxPlanStep.IsStatusOnly.
IsStatusOnly: false,
// Keep score for sorting (not sent to C#)
score: apiStep.score || 0,
}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,6 +23,9 @@ export interface StartTransformRequest extends ExecuteCommandParams {
TransformNetStandardProjects: boolean
EnableRazorViewTransform: boolean
EnableWebFormsTransform: boolean
// Customer's up-front unit-test choice, forwarded to the ATX job objective as
// `generate_unit_tests`. Optional: absent means "no choice sent" (legacy behavior).
GenerateUnitTests?: boolean
PackageReferences?: PackageReferenceMetadata[]
DmsArn?: string
DatabaseSettings?: DatabaseSettings
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -778,6 +778,58 @@ describe('ATXTransformHandler - getTransformationPlan & helpers', () => {
expect(node.Status).to.equal('NOT_STARTED')
expect(node.score).to.equal(0)
})

it('mapApiStepToNode defaults IsStatusOnly to false (structural pass assigns it)', () => {
// The service sends no machine-readable step label, so the per-node mapper never
// sets IsStatusOnly; it is assigned during tree assembly based on parent identity.
const node = (handler as any).mapApiStepToNode({
stepId: 's1',
stepName: 'Merge Tests',
status: 'IN_PROGRESS',
})
expect(node.IsStatusOnly).to.equal(false)
})
})

describe('buildTreeFromFlatList - IsStatusOnly (unit-test-generation substeps)', () => {
// A realistic flat plan: a "Generate Unit Tests" parent with 4 substeps, plus a
// sibling "Transform Projects" parent with its own substep, all under root.
const flatPlan = () => [
{ stepId: 'gut', parentStepId: 'root', stepName: 'Generate Unit Tests', status: 'NOT_STARTED' },
{ stepId: 'plan', parentStepId: 'gut', stepName: 'Plan Unit Test Generation', status: 'NOT_STARTED' },
{ stepId: 'gen', parentStepId: 'gut', stepName: 'Generate Unit Tests', status: 'NOT_STARTED' },
{ stepId: 'merge', parentStepId: 'gut', stepName: 'Merge Tests', status: 'NOT_STARTED' },
{ stepId: 'cov', parentStepId: 'gut', stepName: 'Get Coverage', status: 'NOT_STARTED' },
{ stepId: 'tp', parentStepId: 'root', stepName: 'Transform Projects', status: 'NOT_STARTED' },
{ stepId: 'build', parentStepId: 'tp', stepName: 'Solution Build', status: 'NOT_STARTED' },
]

const findById = (nodes: any[], id: string): any => {
for (const n of nodes) {
if (n.StepId === id) return n
const hit = findById(n.Children || [], id)
if (hit) return hit
}
return null
}

it('marks direct substeps of "Generate Unit Tests" as IsStatusOnly=true', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
for (const id of ['plan', 'gen', 'merge', 'cov']) {
expect(findById(roots, id).IsStatusOnly, id).to.equal(true)
}
})

it('leaves the parent "Generate Unit Tests" step interactive (IsStatusOnly=false)', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
expect(findById(roots, 'gut').IsStatusOnly).to.equal(false)
})

it('does not mark transformation substeps (different parent)', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
expect(findById(roots, 'tp').IsStatusOnly).to.equal(false)
expect(findById(roots, 'build').IsStatusOnly).to.equal(false)
})
})

describe('findCompletedSteps', () => {
Expand DownExpand Up@@ -2027,6 +2079,47 @@ describe('ATXTransformHandler - lifecycle (startTransform & helpers)', () => {
const objective = JSON.parse(command.input.objective)
expect(objective.interactive_mode).to.equal('auto')
})

it('should include generate_unit_tests:true in objective when opted in', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: true })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective.generate_unit_tests).to.equal(true)
})

it('should include generate_unit_tests:false in objective on explicit decline', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: false })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective.generate_unit_tests).to.equal(false)
})

it('should omit generate_unit_tests from objective when no choice is sent', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1' })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective).to.not.have.property('generate_unit_tests')
})

it('should omit generate_unit_tests when the value is not a real boolean', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

// A mistyped/non-boolean value must read as "no choice sent", not a decision.
await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: 'true' as any })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective).to.not.have.property('generate_unit_tests')
})
})

describe('createArtifactUploadUrl', () => {
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,6 +16,7 @@ export interface AtxPlanStep {
Status: PlanStepStatus
Children: AtxPlanStep[]
HasCheckpoint?: boolean
IsStatusOnly?: boolean
}

/**
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -512,6 +512,7 @@ export class ATXTransformHandler {
jobName?: string
targetFramework?: string
interactiveMode?: InteractiveMode
generateUnitTests?: boolean
}): Promise<{ jobId: string; status: string } | null> {
try {
this.logging.log(`ATX: Starting CreateJob for workspace: ${request.workspaceId}`)
Expand All@@ -534,6 +535,13 @@ export class ATXTransformHandler {
interactive_mode: interactiveModeValue,
}

// The customer's up-front unit-test choice. Only a real boolean counts as a choice:
// clients that cannot express one omit the field, and the backend keeps legacy behavior.
// Do NOT default this to false here - an explicit false is a decline, not "no choice".
if (typeof request.generateUnitTests === 'boolean') {
objective.generate_unit_tests = request.generateUnitTests
}

const orchestratorAgent = getAtxOrchestratorAgent()
if (process.env.ATX_ORCHESTRATOR_AGENT) {
this.logging.log(
Expand DownExpand Up@@ -1163,6 +1171,7 @@ export class ATXTransformHandler {
jobName: request.jobName || 'Transform Job',
targetFramework: (request.startTransformRequest as any).TargetFramework,
interactiveMode: request.interactiveMode,
generateUnitTests: (request.startTransformRequest as any).GenerateUnitTests,
})

if (!createJobResponse?.jobId) {
Expand DownExpand Up@@ -3653,6 +3662,14 @@ export class ATXTransformHandler {
const parent = stepMap.get(step.ParentStepId)
if (parent) {
parent.Children.push(step)
// Substeps of the unit-test-generation step render status-only in the IDE
// (no checkpoint toggle / "View Results" button / checkpoint checkbox); the
// parent keeps its normal affordance. The service does not send a machine
// label, so we key off the parent's name. Only direct children are marked,
// so the parent "Generate Unit Tests" step itself stays interactive.
if (this.isUnitTestGenerationStep(parent.StepName)) {
step.IsStatusOnly = true
}
} else {
// Orphan step - treat as root level
rootChildren.push(step)
Expand All@@ -3675,6 +3692,15 @@ export class ATXTransformHandler {
* Maps an API step response to AtxPlanStep.
* Converts from FES camelCase to C#-compatible PascalCase.
*/
/**
* True when a step's name identifies it as the unit-test-generation parent step, whose
* direct substeps (plan / generate / merge / coverage) should render status-only in the IDE.
* Matches on normalized name because the service sends no machine-readable step label.
*/
private isUnitTestGenerationStep(stepName: string | undefined): boolean {
return typeof stepName === 'string' && stepName.trim().toLowerCase() === 'generate unit tests'
}

private mapApiStepToNode(apiStep: any): AtxPlanStep & { score?: number } {
return {
StepId: apiStep.stepId || '',
Expand All@@ -3683,6 +3709,12 @@ export class ATXTransformHandler {
Description: apiStep.description || '',
Status: this.mapApiStatus(apiStep.status),
Children: [],
// Defaults false here; the value is assigned structurally during tree assembly
// (buildTreeFromFlatList) for substeps of the unit-test-generation step. The service
// does not send a machine-readable step label, so parent identity — not a label —
// drives this. PascalCase matches the other fields (StepId/HasCheckpoint/...) so it
// binds onto the C# AtxPlanStep.IsStatusOnly.
IsStatusOnly: false,
// Keep score for sorting (not sent to C#)
score: apiStep.score || 0,
}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,6 +23,9 @@ export interface StartTransformRequest extends ExecuteCommandParams {
TransformNetStandardProjects: boolean
EnableRazorViewTransform: boolean
EnableWebFormsTransform: boolean
// Customer's up-front unit-test choice, forwarded to the ATX job objective as
// `generate_unit_tests`. Optional: absent means "no choice sent" (legacy behavior).
GenerateUnitTests?: boolean
PackageReferences?: PackageReferenceMetadata[]
DmsArn?: string
DatabaseSettings?: DatabaseSettings
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -778,6 +778,58 @@ describe('ATXTransformHandler - getTransformationPlan & helpers', () => {
expect(node.Status).to.equal('NOT_STARTED')
expect(node.score).to.equal(0)
})

it('mapApiStepToNode defaults IsStatusOnly to false (structural pass assigns it)', () => {
// The service sends no machine-readable step label, so the per-node mapper never
// sets IsStatusOnly; it is assigned during tree assembly based on parent identity.
const node = (handler as any).mapApiStepToNode({
stepId: 's1',
stepName: 'Merge Tests',
status: 'IN_PROGRESS',
})
expect(node.IsStatusOnly).to.equal(false)
})
})

describe('buildTreeFromFlatList - IsStatusOnly (unit-test-generation substeps)', () => {
// A realistic flat plan: a "Generate Unit Tests" parent with 4 substeps, plus a
// sibling "Transform Projects" parent with its own substep, all under root.
const flatPlan = () => [
{ stepId: 'gut', parentStepId: 'root', stepName: 'Generate Unit Tests', status: 'NOT_STARTED' },
{ stepId: 'plan', parentStepId: 'gut', stepName: 'Plan Unit Test Generation', status: 'NOT_STARTED' },
{ stepId: 'gen', parentStepId: 'gut', stepName: 'Generate Unit Tests', status: 'NOT_STARTED' },
{ stepId: 'merge', parentStepId: 'gut', stepName: 'Merge Tests', status: 'NOT_STARTED' },
{ stepId: 'cov', parentStepId: 'gut', stepName: 'Get Coverage', status: 'NOT_STARTED' },
{ stepId: 'tp', parentStepId: 'root', stepName: 'Transform Projects', status: 'NOT_STARTED' },
{ stepId: 'build', parentStepId: 'tp', stepName: 'Solution Build', status: 'NOT_STARTED' },
]

const findById = (nodes: any[], id: string): any => {
for (const n of nodes) {
if (n.StepId === id) return n
const hit = findById(n.Children || [], id)
if (hit) return hit
}
return null
}

it('marks direct substeps of "Generate Unit Tests" as IsStatusOnly=true', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
for (const id of ['plan', 'gen', 'merge', 'cov']) {
expect(findById(roots, id).IsStatusOnly, id).to.equal(true)
}
})

it('leaves the parent "Generate Unit Tests" step interactive (IsStatusOnly=false)', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
expect(findById(roots, 'gut').IsStatusOnly).to.equal(false)
})

it('does not mark transformation substeps (different parent)', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
expect(findById(roots, 'tp').IsStatusOnly).to.equal(false)
expect(findById(roots, 'build').IsStatusOnly).to.equal(false)
})
})

describe('findCompletedSteps', () => {
Expand DownExpand Up@@ -2027,6 +2079,47 @@ describe('ATXTransformHandler - lifecycle (startTransform & helpers)', () => {
const objective = JSON.parse(command.input.objective)
expect(objective.interactive_mode).to.equal('auto')
})

it('should include generate_unit_tests:true in objective when opted in', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: true })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective.generate_unit_tests).to.equal(true)
})

it('should include generate_unit_tests:false in objective on explicit decline', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: false })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective.generate_unit_tests).to.equal(false)
})

it('should omit generate_unit_tests from objective when no choice is sent', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1' })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective).to.not.have.property('generate_unit_tests')
})

it('should omit generate_unit_tests when the value is not a real boolean', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

// A mistyped/non-boolean value must read as "no choice sent", not a decision.
await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: 'true' as any })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective).to.not.have.property('generate_unit_tests')
})
})

describe('createArtifactUploadUrl', () => {
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,6 +16,7 @@ export interface AtxPlanStep {
Status: PlanStepStatus
Children: AtxPlanStep[]
HasCheckpoint?: boolean
IsStatusOnly?: boolean
}

/**
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -512,6 +512,7 @@ export class ATXTransformHandler {
jobName?: string
targetFramework?: string
interactiveMode?: InteractiveMode
generateUnitTests?: boolean
}): Promise<{ jobId: string; status: string } | null> {
try {
this.logging.log(`ATX: Starting CreateJob for workspace: ${request.workspaceId}`)
Expand All@@ -534,6 +535,13 @@ export class ATXTransformHandler {
interactive_mode: interactiveModeValue,
}

// The customer's up-front unit-test choice. Only a real boolean counts as a choice:
// clients that cannot express one omit the field, and the backend keeps legacy behavior.
// Do NOT default this to false here - an explicit false is a decline, not "no choice".
if (typeof request.generateUnitTests === 'boolean') {
objective.generate_unit_tests = request.generateUnitTests
}

const orchestratorAgent = getAtxOrchestratorAgent()
if (process.env.ATX_ORCHESTRATOR_AGENT) {
this.logging.log(
Expand DownExpand Up@@ -1163,6 +1171,7 @@ export class ATXTransformHandler {
jobName: request.jobName || 'Transform Job',
targetFramework: (request.startTransformRequest as any).TargetFramework,
interactiveMode: request.interactiveMode,
generateUnitTests: (request.startTransformRequest as any).GenerateUnitTests,
})

if (!createJobResponse?.jobId) {
Expand DownExpand Up@@ -3653,6 +3662,14 @@ export class ATXTransformHandler {
const parent = stepMap.get(step.ParentStepId)
if (parent) {
parent.Children.push(step)
// Substeps of the unit-test-generation step render status-only in the IDE
// (no checkpoint toggle / "View Results" button / checkpoint checkbox); the
// parent keeps its normal affordance. The service does not send a machine
// label, so we key off the parent's name. Only direct children are marked,
// so the parent "Generate Unit Tests" step itself stays interactive.
if (this.isUnitTestGenerationStep(parent.StepName)) {
step.IsStatusOnly = true
}
} else {
// Orphan step - treat as root level
rootChildren.push(step)
Expand All@@ -3675,6 +3692,15 @@ export class ATXTransformHandler {
* Maps an API step response to AtxPlanStep.
* Converts from FES camelCase to C#-compatible PascalCase.
*/
/**
* True when a step's name identifies it as the unit-test-generation parent step, whose
* direct substeps (plan / generate / merge / coverage) should render status-only in the IDE.
* Matches on normalized name because the service sends no machine-readable step label.
*/
private isUnitTestGenerationStep(stepName: string | undefined): boolean {
return typeof stepName === 'string' && stepName.trim().toLowerCase() === 'generate unit tests'
}

private mapApiStepToNode(apiStep: any): AtxPlanStep & { score?: number } {
return {
StepId: apiStep.stepId || '',
Expand All@@ -3683,6 +3709,12 @@ export class ATXTransformHandler {
Description: apiStep.description || '',
Status: this.mapApiStatus(apiStep.status),
Children: [],
// Defaults false here; the value is assigned structurally during tree assembly
// (buildTreeFromFlatList) for substeps of the unit-test-generation step. The service
// does not send a machine-readable step label, so parent identity — not a label —
// drives this. PascalCase matches the other fields (StepId/HasCheckpoint/...) so it
// binds onto the C# AtxPlanStep.IsStatusOnly.
IsStatusOnly: false,
// Keep score for sorting (not sent to C#)
score: apiStep.score || 0,
}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,6 +23,9 @@ export interface StartTransformRequest extends ExecuteCommandParams {
TransformNetStandardProjects: boolean
EnableRazorViewTransform: boolean
EnableWebFormsTransform: boolean
// Customer's up-front unit-test choice, forwarded to the ATX job objective as
// `generate_unit_tests`. Optional: absent means "no choice sent" (legacy behavior).
GenerateUnitTests?: boolean
PackageReferences?: PackageReferenceMetadata[]
DmsArn?: string
DatabaseSettings?: DatabaseSettings
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -778,6 +778,58 @@ describe('ATXTransformHandler - getTransformationPlan & helpers', () => {
expect(node.Status).to.equal('NOT_STARTED')
expect(node.score).to.equal(0)
})

it('mapApiStepToNode defaults IsStatusOnly to false (structural pass assigns it)', () => {
// The service sends no machine-readable step label, so the per-node mapper never
// sets IsStatusOnly; it is assigned during tree assembly based on parent identity.
const node = (handler as any).mapApiStepToNode({
stepId: 's1',
stepName: 'Merge Tests',
status: 'IN_PROGRESS',
})
expect(node.IsStatusOnly).to.equal(false)
})
})

describe('buildTreeFromFlatList - IsStatusOnly (unit-test-generation substeps)', () => {
// A realistic flat plan: a "Generate Unit Tests" parent with 4 substeps, plus a
// sibling "Transform Projects" parent with its own substep, all under root.
const flatPlan = () => [
{ stepId: 'gut', parentStepId: 'root', stepName: 'Generate Unit Tests', status: 'NOT_STARTED' },
{ stepId: 'plan', parentStepId: 'gut', stepName: 'Plan Unit Test Generation', status: 'NOT_STARTED' },
{ stepId: 'gen', parentStepId: 'gut', stepName: 'Generate Unit Tests', status: 'NOT_STARTED' },
{ stepId: 'merge', parentStepId: 'gut', stepName: 'Merge Tests', status: 'NOT_STARTED' },
{ stepId: 'cov', parentStepId: 'gut', stepName: 'Get Coverage', status: 'NOT_STARTED' },
{ stepId: 'tp', parentStepId: 'root', stepName: 'Transform Projects', status: 'NOT_STARTED' },
{ stepId: 'build', parentStepId: 'tp', stepName: 'Solution Build', status: 'NOT_STARTED' },
]

const findById = (nodes: any[], id: string): any => {
for (const n of nodes) {
if (n.StepId === id) return n
const hit = findById(n.Children || [], id)
if (hit) return hit
}
return null
}

it('marks direct substeps of "Generate Unit Tests" as IsStatusOnly=true', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
for (const id of ['plan', 'gen', 'merge', 'cov']) {
expect(findById(roots, id).IsStatusOnly, id).to.equal(true)
}
})

it('leaves the parent "Generate Unit Tests" step interactive (IsStatusOnly=false)', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
expect(findById(roots, 'gut').IsStatusOnly).to.equal(false)
})

it('does not mark transformation substeps (different parent)', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
expect(findById(roots, 'tp').IsStatusOnly).to.equal(false)
expect(findById(roots, 'build').IsStatusOnly).to.equal(false)
})
})

describe('findCompletedSteps', () => {
Expand DownExpand Up@@ -2027,6 +2079,47 @@ describe('ATXTransformHandler - lifecycle (startTransform & helpers)', () => {
const objective = JSON.parse(command.input.objective)
expect(objective.interactive_mode).to.equal('auto')
})

it('should include generate_unit_tests:true in objective when opted in', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: true })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective.generate_unit_tests).to.equal(true)
})

it('should include generate_unit_tests:false in objective on explicit decline', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: false })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective.generate_unit_tests).to.equal(false)
})

it('should omit generate_unit_tests from objective when no choice is sent', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1' })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective).to.not.have.property('generate_unit_tests')
})

it('should omit generate_unit_tests when the value is not a real boolean', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

// A mistyped/non-boolean value must read as "no choice sent", not a decision.
await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: 'true' as any })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective).to.not.have.property('generate_unit_tests')
})
})

describe('createArtifactUploadUrl', () => {
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,6 +16,7 @@ export interface AtxPlanStep {
Status: PlanStepStatus
Children: AtxPlanStep[]
HasCheckpoint?: boolean
IsStatusOnly?: boolean
}

/**
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -512,6 +512,7 @@ export class ATXTransformHandler {
jobName?: string
targetFramework?: string
interactiveMode?: InteractiveMode
generateUnitTests?: boolean
}): Promise<{ jobId: string; status: string } | null> {
try {
this.logging.log(`ATX: Starting CreateJob for workspace: ${request.workspaceId}`)
Expand All@@ -534,6 +535,13 @@ export class ATXTransformHandler {
interactive_mode: interactiveModeValue,
}

// The customer's up-front unit-test choice. Only a real boolean counts as a choice:
// clients that cannot express one omit the field, and the backend keeps legacy behavior.
// Do NOT default this to false here - an explicit false is a decline, not "no choice".
if (typeof request.generateUnitTests === 'boolean') {
objective.generate_unit_tests = request.generateUnitTests
}

const orchestratorAgent = getAtxOrchestratorAgent()
if (process.env.ATX_ORCHESTRATOR_AGENT) {
this.logging.log(
Expand DownExpand Up@@ -1163,6 +1171,7 @@ export class ATXTransformHandler {
jobName: request.jobName || 'Transform Job',
targetFramework: (request.startTransformRequest as any).TargetFramework,
interactiveMode: request.interactiveMode,
generateUnitTests: (request.startTransformRequest as any).GenerateUnitTests,
})

if (!createJobResponse?.jobId) {
Expand DownExpand Up@@ -3653,6 +3662,14 @@ export class ATXTransformHandler {
const parent = stepMap.get(step.ParentStepId)
if (parent) {
parent.Children.push(step)
// Substeps of the unit-test-generation step render status-only in the IDE
// (no checkpoint toggle / "View Results" button / checkpoint checkbox); the
// parent keeps its normal affordance. The service does not send a machine
// label, so we key off the parent's name. Only direct children are marked,
// so the parent "Generate Unit Tests" step itself stays interactive.
if (this.isUnitTestGenerationStep(parent.StepName)) {
step.IsStatusOnly = true
}
} else {
// Orphan step - treat as root level
rootChildren.push(step)
Expand All@@ -3675,6 +3692,15 @@ export class ATXTransformHandler {
* Maps an API step response to AtxPlanStep.
* Converts from FES camelCase to C#-compatible PascalCase.
*/
/**
* True when a step's name identifies it as the unit-test-generation parent step, whose
* direct substeps (plan / generate / merge / coverage) should render status-only in the IDE.
* Matches on normalized name because the service sends no machine-readable step label.
*/
private isUnitTestGenerationStep(stepName: string | undefined): boolean {
return typeof stepName === 'string' && stepName.trim().toLowerCase() === 'generate unit tests'
}

private mapApiStepToNode(apiStep: any): AtxPlanStep & { score?: number } {
return {
StepId: apiStep.stepId || '',
Expand All@@ -3683,6 +3709,12 @@ export class ATXTransformHandler {
Description: apiStep.description || '',
Status: this.mapApiStatus(apiStep.status),
Children: [],
// Defaults false here; the value is assigned structurally during tree assembly
// (buildTreeFromFlatList) for substeps of the unit-test-generation step. The service
// does not send a machine-readable step label, so parent identity — not a label —
// drives this. PascalCase matches the other fields (StepId/HasCheckpoint/...) so it
// binds onto the C# AtxPlanStep.IsStatusOnly.
IsStatusOnly: false,
// Keep score for sorting (not sent to C#)
score: apiStep.score || 0,
}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,6 +23,9 @@ export interface StartTransformRequest extends ExecuteCommandParams {
TransformNetStandardProjects: boolean
EnableRazorViewTransform: boolean
EnableWebFormsTransform: boolean
// Customer's up-front unit-test choice, forwarded to the ATX job objective as
// `generate_unit_tests`. Optional: absent means "no choice sent" (legacy behavior).
GenerateUnitTests?: boolean
PackageReferences?: PackageReferenceMetadata[]
DmsArn?: string
DatabaseSettings?: DatabaseSettings
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -778,6 +778,58 @@ describe('ATXTransformHandler - getTransformationPlan & helpers', () => {
expect(node.Status).to.equal('NOT_STARTED')
expect(node.score).to.equal(0)
})

it('mapApiStepToNode defaults IsStatusOnly to false (structural pass assigns it)', () => {
// The service sends no machine-readable step label, so the per-node mapper never
// sets IsStatusOnly; it is assigned during tree assembly based on parent identity.
const node = (handler as any).mapApiStepToNode({
stepId: 's1',
stepName: 'Merge Tests',
status: 'IN_PROGRESS',
})
expect(node.IsStatusOnly).to.equal(false)
})
})

describe('buildTreeFromFlatList - IsStatusOnly (unit-test-generation substeps)', () => {
// A realistic flat plan: a "Generate Unit Tests" parent with 4 substeps, plus a
// sibling "Transform Projects" parent with its own substep, all under root.
const flatPlan = () => [
{ stepId: 'gut', parentStepId: 'root', stepName: 'Generate Unit Tests', status: 'NOT_STARTED' },
{ stepId: 'plan', parentStepId: 'gut', stepName: 'Plan Unit Test Generation', status: 'NOT_STARTED' },
{ stepId: 'gen', parentStepId: 'gut', stepName: 'Generate Unit Tests', status: 'NOT_STARTED' },
{ stepId: 'merge', parentStepId: 'gut', stepName: 'Merge Tests', status: 'NOT_STARTED' },
{ stepId: 'cov', parentStepId: 'gut', stepName: 'Get Coverage', status: 'NOT_STARTED' },
{ stepId: 'tp', parentStepId: 'root', stepName: 'Transform Projects', status: 'NOT_STARTED' },
{ stepId: 'build', parentStepId: 'tp', stepName: 'Solution Build', status: 'NOT_STARTED' },
]

const findById = (nodes: any[], id: string): any => {
for (const n of nodes) {
if (n.StepId === id) return n
const hit = findById(n.Children || [], id)
if (hit) return hit
}
return null
}

it('marks direct substeps of "Generate Unit Tests" as IsStatusOnly=true', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
for (const id of ['plan', 'gen', 'merge', 'cov']) {
expect(findById(roots, id).IsStatusOnly, id).to.equal(true)
}
})

it('leaves the parent "Generate Unit Tests" step interactive (IsStatusOnly=false)', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
expect(findById(roots, 'gut').IsStatusOnly).to.equal(false)
})

it('does not mark transformation substeps (different parent)', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
expect(findById(roots, 'tp').IsStatusOnly).to.equal(false)
expect(findById(roots, 'build').IsStatusOnly).to.equal(false)
})
})

describe('findCompletedSteps', () => {
Expand DownExpand Up@@ -2027,6 +2079,47 @@ describe('ATXTransformHandler - lifecycle (startTransform & helpers)', () => {
const objective = JSON.parse(command.input.objective)
expect(objective.interactive_mode).to.equal('auto')
})

it('should include generate_unit_tests:true in objective when opted in', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: true })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective.generate_unit_tests).to.equal(true)
})

it('should include generate_unit_tests:false in objective on explicit decline', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: false })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective.generate_unit_tests).to.equal(false)
})

it('should omit generate_unit_tests from objective when no choice is sent', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1' })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective).to.not.have.property('generate_unit_tests')
})

it('should omit generate_unit_tests when the value is not a real boolean', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

// A mistyped/non-boolean value must read as "no choice sent", not a decision.
await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: 'true' as any })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective).to.not.have.property('generate_unit_tests')
})
})

describe('createArtifactUploadUrl', () => {
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,6 +16,7 @@ export interface AtxPlanStep {
Status: PlanStepStatus
Children: AtxPlanStep[]
HasCheckpoint?: boolean
IsStatusOnly?: boolean
}

/**
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -512,6 +512,7 @@ export class ATXTransformHandler {
jobName?: string
targetFramework?: string
interactiveMode?: InteractiveMode
generateUnitTests?: boolean
}): Promise<{ jobId: string; status: string } | null> {
try {
this.logging.log(`ATX: Starting CreateJob for workspace: ${request.workspaceId}`)
Expand All@@ -534,6 +535,13 @@ export class ATXTransformHandler {
interactive_mode: interactiveModeValue,
}

// The customer's up-front unit-test choice. Only a real boolean counts as a choice:
// clients that cannot express one omit the field, and the backend keeps legacy behavior.
// Do NOT default this to false here - an explicit false is a decline, not "no choice".
if (typeof request.generateUnitTests === 'boolean') {
objective.generate_unit_tests = request.generateUnitTests
}

const orchestratorAgent = getAtxOrchestratorAgent()
if (process.env.ATX_ORCHESTRATOR_AGENT) {
this.logging.log(
Expand DownExpand Up@@ -1163,6 +1171,7 @@ export class ATXTransformHandler {
jobName: request.jobName || 'Transform Job',
targetFramework: (request.startTransformRequest as any).TargetFramework,
interactiveMode: request.interactiveMode,
generateUnitTests: (request.startTransformRequest as any).GenerateUnitTests,
})

if (!createJobResponse?.jobId) {
Expand DownExpand Up@@ -3653,6 +3662,14 @@ export class ATXTransformHandler {
const parent = stepMap.get(step.ParentStepId)
if (parent) {
parent.Children.push(step)
// Substeps of the unit-test-generation step render status-only in the IDE
// (no checkpoint toggle / "View Results" button / checkpoint checkbox); the
// parent keeps its normal affordance. The service does not send a machine
// label, so we key off the parent's name. Only direct children are marked,
// so the parent "Generate Unit Tests" step itself stays interactive.
if (this.isUnitTestGenerationStep(parent.StepName)) {
step.IsStatusOnly = true
}
} else {
// Orphan step - treat as root level
rootChildren.push(step)
Expand All@@ -3675,6 +3692,15 @@ export class ATXTransformHandler {
* Maps an API step response to AtxPlanStep.
* Converts from FES camelCase to C#-compatible PascalCase.
*/
/**
* True when a step's name identifies it as the unit-test-generation parent step, whose
* direct substeps (plan / generate / merge / coverage) should render status-only in the IDE.
* Matches on normalized name because the service sends no machine-readable step label.
*/
private isUnitTestGenerationStep(stepName: string | undefined): boolean {
return typeof stepName === 'string' && stepName.trim().toLowerCase() === 'generate unit tests'
}

private mapApiStepToNode(apiStep: any): AtxPlanStep & { score?: number } {
return {
StepId: apiStep.stepId || '',
Expand All@@ -3683,6 +3709,12 @@ export class ATXTransformHandler {
Description: apiStep.description || '',
Status: this.mapApiStatus(apiStep.status),
Children: [],
// Defaults false here; the value is assigned structurally during tree assembly
// (buildTreeFromFlatList) for substeps of the unit-test-generation step. The service
// does not send a machine-readable step label, so parent identity — not a label —
// drives this. PascalCase matches the other fields (StepId/HasCheckpoint/...) so it
// binds onto the C# AtxPlanStep.IsStatusOnly.
IsStatusOnly: false,
// Keep score for sorting (not sent to C#)
score: apiStep.score || 0,
}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,6 +23,9 @@ export interface StartTransformRequest extends ExecuteCommandParams {
TransformNetStandardProjects: boolean
EnableRazorViewTransform: boolean
EnableWebFormsTransform: boolean
// Customer's up-front unit-test choice, forwarded to the ATX job objective as
// `generate_unit_tests`. Optional: absent means "no choice sent" (legacy behavior).
GenerateUnitTests?: boolean
PackageReferences?: PackageReferenceMetadata[]
DmsArn?: string
DatabaseSettings?: DatabaseSettings
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -778,6 +778,58 @@ describe('ATXTransformHandler - getTransformationPlan & helpers', () => {
expect(node.Status).to.equal('NOT_STARTED')
expect(node.score).to.equal(0)
})

it('mapApiStepToNode defaults IsStatusOnly to false (structural pass assigns it)', () => {
// The service sends no machine-readable step label, so the per-node mapper never
// sets IsStatusOnly; it is assigned during tree assembly based on parent identity.
const node = (handler as any).mapApiStepToNode({
stepId: 's1',
stepName: 'Merge Tests',
status: 'IN_PROGRESS',
})
expect(node.IsStatusOnly).to.equal(false)
})
})

describe('buildTreeFromFlatList - IsStatusOnly (unit-test-generation substeps)', () => {
// A realistic flat plan: a "Generate Unit Tests" parent with 4 substeps, plus a
// sibling "Transform Projects" parent with its own substep, all under root.
const flatPlan = () => [
{ stepId: 'gut', parentStepId: 'root', stepName: 'Generate Unit Tests', status: 'NOT_STARTED' },
{ stepId: 'plan', parentStepId: 'gut', stepName: 'Plan Unit Test Generation', status: 'NOT_STARTED' },
{ stepId: 'gen', parentStepId: 'gut', stepName: 'Generate Unit Tests', status: 'NOT_STARTED' },
{ stepId: 'merge', parentStepId: 'gut', stepName: 'Merge Tests', status: 'NOT_STARTED' },
{ stepId: 'cov', parentStepId: 'gut', stepName: 'Get Coverage', status: 'NOT_STARTED' },
{ stepId: 'tp', parentStepId: 'root', stepName: 'Transform Projects', status: 'NOT_STARTED' },
{ stepId: 'build', parentStepId: 'tp', stepName: 'Solution Build', status: 'NOT_STARTED' },
]

const findById = (nodes: any[], id: string): any => {
for (const n of nodes) {
if (n.StepId === id) return n
const hit = findById(n.Children || [], id)
if (hit) return hit
}
return null
}

it('marks direct substeps of "Generate Unit Tests" as IsStatusOnly=true', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
for (const id of ['plan', 'gen', 'merge', 'cov']) {
expect(findById(roots, id).IsStatusOnly, id).to.equal(true)
}
})

it('leaves the parent "Generate Unit Tests" step interactive (IsStatusOnly=false)', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
expect(findById(roots, 'gut').IsStatusOnly).to.equal(false)
})

it('does not mark transformation substeps (different parent)', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
expect(findById(roots, 'tp').IsStatusOnly).to.equal(false)
expect(findById(roots, 'build').IsStatusOnly).to.equal(false)
})
})

describe('findCompletedSteps', () => {
Expand DownExpand Up@@ -2027,6 +2079,47 @@ describe('ATXTransformHandler - lifecycle (startTransform & helpers)', () => {
const objective = JSON.parse(command.input.objective)
expect(objective.interactive_mode).to.equal('auto')
})

it('should include generate_unit_tests:true in objective when opted in', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: true })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective.generate_unit_tests).to.equal(true)
})

it('should include generate_unit_tests:false in objective on explicit decline', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: false })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective.generate_unit_tests).to.equal(false)
})

it('should omit generate_unit_tests from objective when no choice is sent', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1' })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective).to.not.have.property('generate_unit_tests')
})

it('should omit generate_unit_tests when the value is not a real boolean', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

// A mistyped/non-boolean value must read as "no choice sent", not a decision.
await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: 'true' as any })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective).to.not.have.property('generate_unit_tests')
})
})

describe('createArtifactUploadUrl', () => {
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,6 +16,7 @@ export interface AtxPlanStep {
Status: PlanStepStatus
Children: AtxPlanStep[]
HasCheckpoint?: boolean
IsStatusOnly?: boolean
}

/**
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -512,6 +512,7 @@ export class ATXTransformHandler {
jobName?: string
targetFramework?: string
interactiveMode?: InteractiveMode
generateUnitTests?: boolean
}): Promise<{ jobId: string; status: string } | null> {
try {
this.logging.log(`ATX: Starting CreateJob for workspace: ${request.workspaceId}`)
Expand All@@ -534,6 +535,13 @@ export class ATXTransformHandler {
interactive_mode: interactiveModeValue,
}

// The customer's up-front unit-test choice. Only a real boolean counts as a choice:
// clients that cannot express one omit the field, and the backend keeps legacy behavior.
// Do NOT default this to false here - an explicit false is a decline, not "no choice".
if (typeof request.generateUnitTests === 'boolean') {
objective.generate_unit_tests = request.generateUnitTests
}

const orchestratorAgent = getAtxOrchestratorAgent()
if (process.env.ATX_ORCHESTRATOR_AGENT) {
this.logging.log(
Expand DownExpand Up@@ -1163,6 +1171,7 @@ export class ATXTransformHandler {
jobName: request.jobName || 'Transform Job',
targetFramework: (request.startTransformRequest as any).TargetFramework,
interactiveMode: request.interactiveMode,
generateUnitTests: (request.startTransformRequest as any).GenerateUnitTests,
})

if (!createJobResponse?.jobId) {
Expand DownExpand Up@@ -3653,6 +3662,14 @@ export class ATXTransformHandler {
const parent = stepMap.get(step.ParentStepId)
if (parent) {
parent.Children.push(step)
// Substeps of the unit-test-generation step render status-only in the IDE
// (no checkpoint toggle / "View Results" button / checkpoint checkbox); the
// parent keeps its normal affordance. The service does not send a machine
// label, so we key off the parent's name. Only direct children are marked,
// so the parent "Generate Unit Tests" step itself stays interactive.
if (this.isUnitTestGenerationStep(parent.StepName)) {
step.IsStatusOnly = true
}
} else {
// Orphan step - treat as root level
rootChildren.push(step)
Expand All@@ -3675,6 +3692,15 @@ export class ATXTransformHandler {
* Maps an API step response to AtxPlanStep.
* Converts from FES camelCase to C#-compatible PascalCase.
*/
/**
* True when a step's name identifies it as the unit-test-generation parent step, whose
* direct substeps (plan / generate / merge / coverage) should render status-only in the IDE.
* Matches on normalized name because the service sends no machine-readable step label.
*/
private isUnitTestGenerationStep(stepName: string | undefined): boolean {
return typeof stepName === 'string' && stepName.trim().toLowerCase() === 'generate unit tests'
}

private mapApiStepToNode(apiStep: any): AtxPlanStep & { score?: number } {
return {
StepId: apiStep.stepId || '',
Expand All@@ -3683,6 +3709,12 @@ export class ATXTransformHandler {
Description: apiStep.description || '',
Status: this.mapApiStatus(apiStep.status),
Children: [],
// Defaults false here; the value is assigned structurally during tree assembly
// (buildTreeFromFlatList) for substeps of the unit-test-generation step. The service
// does not send a machine-readable step label, so parent identity — not a label —
// drives this. PascalCase matches the other fields (StepId/HasCheckpoint/...) so it
// binds onto the C# AtxPlanStep.IsStatusOnly.
IsStatusOnly: false,
// Keep score for sorting (not sent to C#)
score: apiStep.score || 0,
}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,6 +23,9 @@ export interface StartTransformRequest extends ExecuteCommandParams {
TransformNetStandardProjects: boolean
EnableRazorViewTransform: boolean
EnableWebFormsTransform: boolean
// Customer's up-front unit-test choice, forwarded to the ATX job objective as
// `generate_unit_tests`. Optional: absent means "no choice sent" (legacy behavior).
GenerateUnitTests?: boolean
PackageReferences?: PackageReferenceMetadata[]
DmsArn?: string
DatabaseSettings?: DatabaseSettings
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -778,6 +778,58 @@ describe('ATXTransformHandler - getTransformationPlan & helpers', () => {
expect(node.Status).to.equal('NOT_STARTED')
expect(node.score).to.equal(0)
})

it('mapApiStepToNode defaults IsStatusOnly to false (structural pass assigns it)', () => {
// The service sends no machine-readable step label, so the per-node mapper never
// sets IsStatusOnly; it is assigned during tree assembly based on parent identity.
const node = (handler as any).mapApiStepToNode({
stepId: 's1',
stepName: 'Merge Tests',
status: 'IN_PROGRESS',
})
expect(node.IsStatusOnly).to.equal(false)
})
})

describe('buildTreeFromFlatList - IsStatusOnly (unit-test-generation substeps)', () => {
// A realistic flat plan: a "Generate Unit Tests" parent with 4 substeps, plus a
// sibling "Transform Projects" parent with its own substep, all under root.
const flatPlan = () => [
{ stepId: 'gut', parentStepId: 'root', stepName: 'Generate Unit Tests', status: 'NOT_STARTED' },
{ stepId: 'plan', parentStepId: 'gut', stepName: 'Plan Unit Test Generation', status: 'NOT_STARTED' },
{ stepId: 'gen', parentStepId: 'gut', stepName: 'Generate Unit Tests', status: 'NOT_STARTED' },
{ stepId: 'merge', parentStepId: 'gut', stepName: 'Merge Tests', status: 'NOT_STARTED' },
{ stepId: 'cov', parentStepId: 'gut', stepName: 'Get Coverage', status: 'NOT_STARTED' },
{ stepId: 'tp', parentStepId: 'root', stepName: 'Transform Projects', status: 'NOT_STARTED' },
{ stepId: 'build', parentStepId: 'tp', stepName: 'Solution Build', status: 'NOT_STARTED' },
]

const findById = (nodes: any[], id: string): any => {
for (const n of nodes) {
if (n.StepId === id) return n
const hit = findById(n.Children || [], id)
if (hit) return hit
}
return null
}

it('marks direct substeps of "Generate Unit Tests" as IsStatusOnly=true', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
for (const id of ['plan', 'gen', 'merge', 'cov']) {
expect(findById(roots, id).IsStatusOnly, id).to.equal(true)
}
})

it('leaves the parent "Generate Unit Tests" step interactive (IsStatusOnly=false)', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
expect(findById(roots, 'gut').IsStatusOnly).to.equal(false)
})

it('does not mark transformation substeps (different parent)', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
expect(findById(roots, 'tp').IsStatusOnly).to.equal(false)
expect(findById(roots, 'build').IsStatusOnly).to.equal(false)
})
})

describe('findCompletedSteps', () => {
Expand DownExpand Up@@ -2027,6 +2079,47 @@ describe('ATXTransformHandler - lifecycle (startTransform & helpers)', () => {
const objective = JSON.parse(command.input.objective)
expect(objective.interactive_mode).to.equal('auto')
})

it('should include generate_unit_tests:true in objective when opted in', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: true })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective.generate_unit_tests).to.equal(true)
})

it('should include generate_unit_tests:false in objective on explicit decline', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: false })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective.generate_unit_tests).to.equal(false)
})

it('should omit generate_unit_tests from objective when no choice is sent', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1' })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective).to.not.have.property('generate_unit_tests')
})

it('should omit generate_unit_tests when the value is not a real boolean', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

// A mistyped/non-boolean value must read as "no choice sent", not a decision.
await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: 'true' as any })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective).to.not.have.property('generate_unit_tests')
})
})

describe('createArtifactUploadUrl', () => {
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,6 +16,7 @@ export interface AtxPlanStep {
Status: PlanStepStatus
Children: AtxPlanStep[]
HasCheckpoint?: boolean
IsStatusOnly?: boolean
}

/**
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -512,6 +512,7 @@ export class ATXTransformHandler {
jobName?: string
targetFramework?: string
interactiveMode?: InteractiveMode
generateUnitTests?: boolean
}): Promise<{ jobId: string; status: string } | null> {
try {
this.logging.log(`ATX: Starting CreateJob for workspace: ${request.workspaceId}`)
Expand All@@ -534,6 +535,13 @@ export class ATXTransformHandler {
interactive_mode: interactiveModeValue,
}

// The customer's up-front unit-test choice. Only a real boolean counts as a choice:
// clients that cannot express one omit the field, and the backend keeps legacy behavior.
// Do NOT default this to false here - an explicit false is a decline, not "no choice".
if (typeof request.generateUnitTests === 'boolean') {
objective.generate_unit_tests = request.generateUnitTests
}

const orchestratorAgent = getAtxOrchestratorAgent()
if (process.env.ATX_ORCHESTRATOR_AGENT) {
this.logging.log(
Expand DownExpand Up@@ -1163,6 +1171,7 @@ export class ATXTransformHandler {
jobName: request.jobName || 'Transform Job',
targetFramework: (request.startTransformRequest as any).TargetFramework,
interactiveMode: request.interactiveMode,
generateUnitTests: (request.startTransformRequest as any).GenerateUnitTests,
})

if (!createJobResponse?.jobId) {
Expand DownExpand Up@@ -3653,6 +3662,14 @@ export class ATXTransformHandler {
const parent = stepMap.get(step.ParentStepId)
if (parent) {
parent.Children.push(step)
// Substeps of the unit-test-generation step render status-only in the IDE
// (no checkpoint toggle / "View Results" button / checkpoint checkbox); the
// parent keeps its normal affordance. The service does not send a machine
// label, so we key off the parent's name. Only direct children are marked,
// so the parent "Generate Unit Tests" step itself stays interactive.
if (this.isUnitTestGenerationStep(parent.StepName)) {
step.IsStatusOnly = true
}
} else {
// Orphan step - treat as root level
rootChildren.push(step)
Expand All@@ -3675,6 +3692,15 @@ export class ATXTransformHandler {
* Maps an API step response to AtxPlanStep.
* Converts from FES camelCase to C#-compatible PascalCase.
*/
/**
* True when a step's name identifies it as the unit-test-generation parent step, whose
* direct substeps (plan / generate / merge / coverage) should render status-only in the IDE.
* Matches on normalized name because the service sends no machine-readable step label.
*/
private isUnitTestGenerationStep(stepName: string | undefined): boolean {
return typeof stepName === 'string' && stepName.trim().toLowerCase() === 'generate unit tests'
}

private mapApiStepToNode(apiStep: any): AtxPlanStep & { score?: number } {
return {
StepId: apiStep.stepId || '',
Expand All@@ -3683,6 +3709,12 @@ export class ATXTransformHandler {
Description: apiStep.description || '',
Status: this.mapApiStatus(apiStep.status),
Children: [],
// Defaults false here; the value is assigned structurally during tree assembly
// (buildTreeFromFlatList) for substeps of the unit-test-generation step. The service
// does not send a machine-readable step label, so parent identity — not a label —
// drives this. PascalCase matches the other fields (StepId/HasCheckpoint/...) so it
// binds onto the C# AtxPlanStep.IsStatusOnly.
IsStatusOnly: false,
// Keep score for sorting (not sent to C#)
score: apiStep.score || 0,
}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,6 +23,9 @@ export interface StartTransformRequest extends ExecuteCommandParams {
TransformNetStandardProjects: boolean
EnableRazorViewTransform: boolean
EnableWebFormsTransform: boolean
// Customer's up-front unit-test choice, forwarded to the ATX job objective as
// `generate_unit_tests`. Optional: absent means "no choice sent" (legacy behavior).
GenerateUnitTests?: boolean
PackageReferences?: PackageReferenceMetadata[]
DmsArn?: string
DatabaseSettings?: DatabaseSettings
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -778,6 +778,58 @@ describe('ATXTransformHandler - getTransformationPlan & helpers', () => {
expect(node.Status).to.equal('NOT_STARTED')
expect(node.score).to.equal(0)
})

it('mapApiStepToNode defaults IsStatusOnly to false (structural pass assigns it)', () => {
// The service sends no machine-readable step label, so the per-node mapper never
// sets IsStatusOnly; it is assigned during tree assembly based on parent identity.
const node = (handler as any).mapApiStepToNode({
stepId: 's1',
stepName: 'Merge Tests',
status: 'IN_PROGRESS',
})
expect(node.IsStatusOnly).to.equal(false)
})
})

describe('buildTreeFromFlatList - IsStatusOnly (unit-test-generation substeps)', () => {
// A realistic flat plan: a "Generate Unit Tests" parent with 4 substeps, plus a
// sibling "Transform Projects" parent with its own substep, all under root.
const flatPlan = () => [
{ stepId: 'gut', parentStepId: 'root', stepName: 'Generate Unit Tests', status: 'NOT_STARTED' },
{ stepId: 'plan', parentStepId: 'gut', stepName: 'Plan Unit Test Generation', status: 'NOT_STARTED' },
{ stepId: 'gen', parentStepId: 'gut', stepName: 'Generate Unit Tests', status: 'NOT_STARTED' },
{ stepId: 'merge', parentStepId: 'gut', stepName: 'Merge Tests', status: 'NOT_STARTED' },
{ stepId: 'cov', parentStepId: 'gut', stepName: 'Get Coverage', status: 'NOT_STARTED' },
{ stepId: 'tp', parentStepId: 'root', stepName: 'Transform Projects', status: 'NOT_STARTED' },
{ stepId: 'build', parentStepId: 'tp', stepName: 'Solution Build', status: 'NOT_STARTED' },
]

const findById = (nodes: any[], id: string): any => {
for (const n of nodes) {
if (n.StepId === id) return n
const hit = findById(n.Children || [], id)
if (hit) return hit
}
return null
}

it('marks direct substeps of "Generate Unit Tests" as IsStatusOnly=true', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
for (const id of ['plan', 'gen', 'merge', 'cov']) {
expect(findById(roots, id).IsStatusOnly, id).to.equal(true)
}
})

it('leaves the parent "Generate Unit Tests" step interactive (IsStatusOnly=false)', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
expect(findById(roots, 'gut').IsStatusOnly).to.equal(false)
})

it('does not mark transformation substeps (different parent)', () => {
const roots = (handler as any).buildTreeFromFlatList(flatPlan())
expect(findById(roots, 'tp').IsStatusOnly).to.equal(false)
expect(findById(roots, 'build').IsStatusOnly).to.equal(false)
})
})

describe('findCompletedSteps', () => {
Expand DownExpand Up@@ -2027,6 +2079,47 @@ describe('ATXTransformHandler - lifecycle (startTransform & helpers)', () => {
const objective = JSON.parse(command.input.objective)
expect(objective.interactive_mode).to.equal('auto')
})

it('should include generate_unit_tests:true in objective when opted in', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: true })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective.generate_unit_tests).to.equal(true)
})

it('should include generate_unit_tests:false in objective on explicit decline', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: false })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective.generate_unit_tests).to.equal(false)
})

it('should omit generate_unit_tests from objective when no choice is sent', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

await handler.createJob({ workspaceId: 'ws-1' })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective).to.not.have.property('generate_unit_tests')
})

it('should omit generate_unit_tests when the value is not a real boolean', async () => {
sendStub.resolves({ jobId: 'j', status: 'CREATED' })

// A mistyped/non-boolean value must read as "no choice sent", not a decision.
await handler.createJob({ workspaceId: 'ws-1', generateUnitTests: 'true' as any })

const command = sendStub.firstCall.args[0]
const objective = JSON.parse(command.input.objective)
expect(objective).to.not.have.property('generate_unit_tests')
})
})

describe('createArtifactUploadUrl', () => {
Expand Down
Loading