Skip to content
Merged
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 number Diff line number Diff line change
Expand Up @@ -151,6 +151,29 @@ export interface AtxGetTransformInfoResponse {
// Surfaced so the IDE can restore the correct mode instead of relying on its local
// settings store, which may be missing/stale (e.g. cold restart on another machine).
InteractiveMode?: InteractiveMode
// ITGen (ATX_ITGEN_ENABLED only): every HITL open this poll, so a test-run HITL can't be
// hidden behind the one HitlTag/HitlTaskId picks. Absent when the poll didn't list HITLs.
OpenHitls?: AtxOpenHitl[]
}

/**
* One open HITL task (contract v0 §3). Matches C# AtxOpenHitl class.
*/
export interface AtxOpenHitl {
TaskId: string
Tag?: string
// The plan step the task belongs to (for ITGen: the test project's step)
StepId?: string
ExpiryTimestampUTC?: string
// integ-app-launch / integ-test-run only: absolute path of the downloaded request.json
// (artifactWorkspace/<job>/hitl/<taskId>/request.json). Absent when the request is missing,
// can't be downloaded, or is rejected (RequestError says why).
RequestPath?: string
RequestError?: string
// integ-test-run only: absolute path of the extracted repo artifact holding the generated test
// projects (artifactWorkspace/<job>/itgen/<runId>/tests); the request's tests.projectPath is
// relative to it. Downloaded again for every test-run task.
TestsPath?: string
}

/**
Expand Down Expand Up @@ -279,6 +302,20 @@ export interface AtxCompleteLocalBuildHitlRequest extends ExecuteCommandParams {
SolutionRootPath: string
}

/**
* Completes an integ-test-run HITL (contract v0 §5: summary.json, plus trx/<project>/<runId>.trx
* or build-errors.json) or an integ-app-launch HITL (§6: launch-result.json, plus the startup
* log): uploads the result ZIP and submits the task by ID.
* ResultZipPath may be absolute or relative to SolutionRootPath.
*/
export interface AtxCompleteHitlWithTestResultsRequest extends ExecuteCommandParams {
WorkspaceId: string
TransformationJobId: string
TaskId: string
ResultZipPath: string
SolutionRootPath: string
}

export interface AtxCompleteLocalBuildHitlResponse {
Success: boolean
Error?: string
Expand Down Expand Up @@ -346,16 +383,18 @@ export interface AtxLoadOlderWorklogsRequest extends ExecuteCommandParams {
nextToken?: string
}

// ITGen test-run HITL payloads (ITGen–IDE contract v0, schema 1.0). Draft: names follow the v0
// ITGen test-run HITL payloads (ITGen–IDE contract v0, schema 1.1). Draft: names follow the v0
// proposal and match C# AtxTestRunRequest / AtxTestRunSummary / AtxAppLaunchRequest /
// AtxAppLaunchResult in the VS extension.

export const ATX_TEST_RUN_SCHEMA_VERSION = '1.0'
// 1.1 (10/26) added launch-result launchedBy and dropped NOT_LOCALHOST; 1.0 payloads are still accepted
export const ATX_TEST_RUN_SCHEMA_VERSION = '1.1'
export const ATX_TEST_RUN_BASE_URL_ENV = 'AB_BASE_URL'

export type AtxTestRunSide = 'original' | 'transformed'

export type AtxTestRunStatus = 'COMPLETED' | 'TEST_BUILD_FAILED' | 'TIMED_OUT' | 'NOT_LOCALHOST'
// NOT_LOCALHOST was removed in 1.1: published URLs are allowed on the original side
export type AtxTestRunStatus = 'COMPLETED' | 'TEST_BUILD_FAILED' | 'TIMED_OUT'

/**
* Request from the Transform agent to run one test project (request.json of an integ-test-run HITL)
Expand All @@ -368,8 +407,8 @@ export interface AtxTestRunRequest {
schemaVersion: string
// Names the TRX file (trx/<project>/<runId>.trx) and is echoed in the summary
runId: string
// Also says where the app runs from: original = the copy uploaded at job start
// (artifactWorkspace/<upload folder>/artifact/sourceCode), transformed = the customer's solution
// Also says where the app runs from: original = the copy of the original solution the IDE takes
// at job start (artifactWorkspace/before/), transformed = the customer's solution
side: AtxTestRunSide
project: string
// The repo artifact the agent rewrites, holding the generated test projects: one per repo,
Expand Down Expand Up @@ -398,6 +437,9 @@ export interface AtxAppLaunchApp {

export type AtxAppLaunchStatus = 'STARTED' | 'APP_NOT_STARTED'

// Who started the app: the IDE, or the customer (who started it themselves or gave a URL)
export type AtxAppLaunchedBy = 'ide' | 'customer'

/**
* Request from the Transform agent to start one web project (request.json of an integ-app-launch HITL),
* one per launch attempt. Contract v0 defines only the result, so this shape is a proposal. Like LBV's
Expand All @@ -422,6 +464,9 @@ export interface AtxAppLaunchResult {
project: string
attempt: number
status: AtxAppLaunchStatus
// Since 1.1; absent means ide. For customer, appUrl is the URL the customer gave: localhost or
// published on the original side, localhost only on the transformed side
launchedBy?: AtxAppLaunchedBy
appUrl?: string
// The last health check; httpStatus is absent when the app didn't answer
healthCheck?: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
AtxListArtifactsRequest,
AtxDownloadArtifactRequest,
AtxCompleteLocalBuildHitlRequest,
AtxCompleteHitlWithTestResultsRequest,
AtxGetJobDashboardRequest,
AtxGetJobReportRequest,
AtxUploadCustomPlanRequest,
Expand All @@ -43,6 +44,8 @@ const AtxBatchGetMessagesCommand = 'aws/atxTransform/batchGetMessages'
const AtxListArtifactsCommand = 'aws/atxTransform/listArtifacts'
const AtxDownloadArtifactCommand = 'aws/atxTransform/downloadArtifact'
const AtxCompleteLocalBuildHitlCommand = 'aws/atxTransform/completeLocalBuildHitl'
// ITGen; the handler refuses it unless ATX_ITGEN_ENABLED is on
const AtxCompleteHitlWithTestResultsCommand = 'aws/atxTransform/completeHitlWithTestResults'
const AtxGetJobDashboardCommand = 'aws/atxTransform/getJobDashboard'
const AtxGetJobReportCommand = 'aws/atxTransform/getJobReport'
const AtxUploadCustomPlanCommand = 'aws/atxTransform/uploadCustomPlan'
Expand Down Expand Up @@ -237,6 +240,22 @@ export const AtxNetTransformServerToken =
SolutionRootPath
)
}
case AtxCompleteHitlWithTestResultsCommand: {
const { WorkspaceId, TransformationJobId, TaskId, ResultZipPath, SolutionRootPath } =
params as AtxCompleteHitlWithTestResultsRequest

logging.log(
`ATX: completeHitlWithTestResults received — jobId=${TransformationJobId} taskId=${TaskId} zip=${ResultZipPath}`
)

return await atxTransformHandler.completeHitlWithTestResults(
WorkspaceId,
TransformationJobId,
TaskId,
ResultZipPath,
SolutionRootPath
)
}
case AtxGetJobDashboardCommand: {
const { WorkspaceId, JobId } = params as AtxGetJobDashboardRequest

Expand Down Expand Up @@ -343,6 +362,7 @@ export const AtxNetTransformServerToken =
AtxListArtifactsCommand,
AtxDownloadArtifactCommand,
AtxCompleteLocalBuildHitlCommand,
AtxCompleteHitlWithTestResultsCommand,
AtxGetJobDashboardCommand,
AtxGetJobReportCommand,
AtxUploadCustomPlanCommand,
Expand Down
Loading
Loading