From 53c25b8568cc9d136d7c345cae941a783edc259e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Thu, 28 Nov 2024 10:54:07 +0100 Subject: [PATCH] chore(slab): log details and waiting on the instance --- dist/index.js | 12 +++++++++++- src/index.js | 9 ++++++++- src/slab.js | 3 +++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index b535055..f8e4d18 100644 --- a/dist/index.js +++ b/dist/index.js @@ -49776,11 +49776,14 @@ async function startInstanceRequest() { } async function waitForInstance(taskId, taskName) { + core.info(`Wait for instance to ${taskName} (task ID: ${taskId})`) + // while (true) equivalent to please ESLint for (;;) { await utils.sleep(15) try { + core.info('Checking...') const response = await getTask(taskId) if (response.ok) { @@ -51856,13 +51859,20 @@ function setOutput(label) { } async function start() { + const provider = config.input.backend + const start_instance_response = await slab.startInstanceRequest() + core.info( + `${provider} instance details: ${JSON.stringify( + start_instance_response.details + )}` + ) + const wait_instance_response = await slab.waitForInstance( start_instance_response.task_id, 'start' ) - const provider = config.input.backend const instance_id = wait_instance_response.start.instance_id core.info(`${provider} instance started with ID: ${instance_id}`) diff --git a/src/index.js b/src/index.js index c3ec1d9..cfd8bec 100644 --- a/src/index.js +++ b/src/index.js @@ -8,13 +8,20 @@ function setOutput(label) { } async function start() { + const provider = config.input.backend + const start_instance_response = await slab.startInstanceRequest() + core.info( + `${provider} instance details: ${JSON.stringify( + start_instance_response.details + )}` + ) + const wait_instance_response = await slab.waitForInstance( start_instance_response.task_id, 'start' ) - const provider = config.input.backend const instance_id = wait_instance_response.start.instance_id core.info(`${provider} instance started with ID: ${instance_id}`) diff --git a/src/slab.js b/src/slab.js index faee347..8c562c4 100644 --- a/src/slab.js +++ b/src/slab.js @@ -68,11 +68,14 @@ async function startInstanceRequest() { } async function waitForInstance(taskId, taskName) { + core.info(`Wait for instance to ${taskName} (task ID: ${taskId})`) + // while (true) equivalent to please ESLint for (;;) { await utils.sleep(15) try { + core.info('Checking...') const response = await getTask(taskId) if (response.ok) {