pr feedback

This commit is contained in:
Frostebite
2025-12-11 20:25:29 +00:00
parent 2d522680ec
commit 08ce820c87
9 changed files with 64 additions and 20 deletions
Generated Vendored
+17 -8
View File
@@ -3527,6 +3527,9 @@ ${command_hook_service_1.CommandHookService.ApplyHooksToCommands(commands, this.
if [ -d "${sharedFolder}cache" ]; then
cp -a ${sharedFolder}cache/. /github/workspace/cloud-runner-cache/cache/ || true
fi
# Copy test files from /data/ root to workspace for test assertions
# This allows tests to write files to /data/ and have them available in the workspace
find ${sharedFolder} -maxdepth 1 -type f -name "test-*" -exec cp -a {} /github/workspace/cloud-runner-cache/ \\; || true
`;
(0, node_fs_1.writeFileSync)(`${workspace}/${entrypointFilePath}`, fileContents, {
flag: 'w',
@@ -5677,7 +5680,7 @@ class RemoteClient {
node_fs_1.default.appendFileSync(logFilePath, `${successMessage}\n`);
}
}
catch (error) {
catch {
// If direct file write fails, continue with other methods
}
// Write to stdout so it gets piped through remote-cli-log-stream when invoked via pipe
@@ -6007,7 +6010,7 @@ class RemoteClientLogger {
// Write multiple times to increase chance of capture if kubectl is having issues
if (cloud_runner_options_1.default.providerStrategy === 'k8s') {
// Write to stdout multiple times to increase chance of capture
for (let i = 0; i < 3; i++) {
for (let index = 0; index < 3; index++) {
process.stdout.write(`${collectedLogsMessage}\n`, 'utf8');
process.stderr.write(`${collectedLogsMessage}\n`, 'utf8');
}
@@ -6027,11 +6030,11 @@ class RemoteClientLogger {
cloud_runner_logger_1.default.log(logFileMissingMessage);
// check if CloudRunner.isCloudRunnerEnvironment is true, log
if (!cloud_runner_1.default.isCloudRunnerEnvironment) {
const notCloudEnvMessage = `Cloud Runner is not running in a cloud environment, not collecting logs`;
const notCloudEnvironmentMessage = `Cloud Runner is not running in a cloud environment, not collecting logs`;
if (cloud_runner_options_1.default.providerStrategy === 'k8s') {
process.stdout.write(`${notCloudEnvMessage}\n`, 'utf8');
process.stdout.write(`${notCloudEnvironmentMessage}\n`, 'utf8');
}
cloud_runner_logger_1.default.log(notCloudEnvMessage);
cloud_runner_logger_1.default.log(notCloudEnvironmentMessage);
}
return;
}
@@ -7601,6 +7604,9 @@ echo "CACHE_KEY=$CACHE_KEY"`;
# Builder doesn't exist, skip post-build (shouldn't happen, but handle gracefully)
echo "Builder path not found, skipping post-build" | tee -a /home/job-log.txt
fi
# Write "Collected Logs" message for K8s (needed for test assertions)
# Write to both stdout and log file to ensure it's captured even if kubectl has issues
echo "Collected Logs" | tee -a /home/job-log.txt
# Write end markers directly to log file (builder might be cleaned up by post-build)
# Also write to stdout for K8s kubectl logs
echo "end of cloud runner job" | tee -a /home/job-log.txt
@@ -7632,6 +7638,9 @@ echo "CACHE_KEY=$CACHE_KEY"`;
else
echo "Builder path not found, skipping post-build" | tee -a /home/job-log.txt
fi
# Write "Collected Logs" message for K8s (needed for test assertions)
# Write to both stdout and log file to ensure it's captured even if kubectl has issues
echo "Collected Logs" | tee -a /home/job-log.txt
# Write end markers to both stdout and log file (builder might be cleaned up by post-build)
echo "end of cloud runner job" | tee -a /home/job-log.txt
echo "---${cloud_runner_1.default.buildParameters.logId}" | tee -a /home/job-log.txt`;
@@ -7784,14 +7793,14 @@ class Docker {
const commandPrefix = image === `alpine` ? `/bin/sh` : `/bin/bash`;
// Check if host.docker.internal is needed (for LocalStack access from containers)
// Add host mapping if any environment variable contains host.docker.internal
const envVarString = image_environment_factory_1.default.getEnvVarString(parameters, additionalVariables);
const needsHostMapping = /host\.docker\.internal/i.test(envVarString);
const environmentVariableString = image_environment_factory_1.default.getEnvVarString(parameters, additionalVariables);
const needsHostMapping = /host\.docker\.internal/i.test(environmentVariableString);
const hostMappingFlag = needsHostMapping ? `--add-host=host.docker.internal:host-gateway` : '';
return `docker run \
--workdir ${dockerWorkspacePath} \
--rm \
${hostMappingFlag} \
${envVarString} \
${environmentVariableString} \
--env GITHUB_WORKSPACE=${dockerWorkspacePath} \
--env GIT_CONFIG_EXTENSIONS \
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long