pr feedback

pull/767/head
Frostebite 2025-12-10 19:24:49 +00:00
parent 5011678ad1
commit b4fb0c00ce
4 changed files with 41 additions and 6 deletions

21
dist/index.js vendored
View File

@ -5649,6 +5649,14 @@ class RemoteClient {
// This ensures the message is captured in BuildResults for all providers
// Use synchronous write and ensure newline is included for proper flushing
process.stdout.write(`${successMessage}\n`, 'utf8');
// For K8s, also write directly to stdout (not through pipe) to ensure kubectl logs captures it
// This is critical because kubectl logs reads from stdout, and the pipe might not process
// the message in time before the container exits
if (cloud_runner_options_1.default.providerStrategy === 'k8s') {
// Write directly to stdout so kubectl logs can capture it immediately
// This bypasses the pipe to ensure the message is captured even if the pipe fails
process.stdout.write(`${successMessage}\n`, 'utf8');
}
// Ensure stdout is flushed before process exits (critical for K8s where process might exit quickly)
// For non-TTY streams, we need to explicitly ensure the write completes
if (!process.stdout.isTTY) {
@ -7521,8 +7529,17 @@ echo "CACHE_KEY=$CACHE_KEY"`;
node ${builderPath} -m remote-cli-post-build | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt || echo "Post-build command completed with warnings"
set -e
# Write end marker and pipe through log stream
echo "end of cloud runner job" | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt
echo "---${cloud_runner_1.default.buildParameters.logId}" | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt
# Use set +e to prevent failure if builder path doesn't exist (builder might have been cleaned up)
set +e
if [ -f "${builderPath}" ]; then
echo "end of cloud runner job" | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt || echo "end of cloud runner job" >> /home/job-log.txt
echo "---${cloud_runner_1.default.buildParameters.logId}" | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt || echo "---${cloud_runner_1.default.buildParameters.logId}" >> /home/job-log.txt
else
# Builder path doesn't exist, write directly to log file
echo "end of cloud runner job" >> /home/job-log.txt
echo "---${cloud_runner_1.default.buildParameters.logId}" >> /home/job-log.txt
fi
set -e
# Mirror cache back into workspace for test assertions
mkdir -p "$GITHUB_WORKSPACE/cloud-runner-cache/cache/$CACHE_KEY/Library"
mkdir -p "$GITHUB_WORKSPACE/cloud-runner-cache/cache/$CACHE_KEY/build"

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -173,7 +173,16 @@ export class RemoteClient {
// This ensures the message is captured in BuildResults for all providers
// Use synchronous write and ensure newline is included for proper flushing
process.stdout.write(`${successMessage}\n`, 'utf8');
// For K8s, also write directly to stdout (not through pipe) to ensure kubectl logs captures it
// This is critical because kubectl logs reads from stdout, and the pipe might not process
// the message in time before the container exits
if (CloudRunnerOptions.providerStrategy === 'k8s') {
// Write directly to stdout so kubectl logs can capture it immediately
// This bypasses the pipe to ensure the message is captured even if the pipe fails
process.stdout.write(`${successMessage}\n`, 'utf8');
}
// Ensure stdout is flushed before process exits (critical for K8s where process might exit quickly)
// For non-TTY streams, we need to explicitly ensure the write completes
if (!process.stdout.isTTY) {

View File

@ -183,8 +183,17 @@ echo "CACHE_KEY=$CACHE_KEY"`;
node ${builderPath} -m remote-cli-post-build | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt || echo "Post-build command completed with warnings"
set -e
# Write end marker and pipe through log stream
echo "end of cloud runner job" | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt
echo "---${CloudRunner.buildParameters.logId}" | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt
# Use set +e to prevent failure if builder path doesn't exist (builder might have been cleaned up)
set +e
if [ -f "${builderPath}" ]; then
echo "end of cloud runner job" | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt || echo "end of cloud runner job" >> /home/job-log.txt
echo "---${CloudRunner.buildParameters.logId}" | node ${builderPath} -m remote-cli-log-stream --logFile /home/job-log.txt || echo "---${CloudRunner.buildParameters.logId}" >> /home/job-log.txt
else
# Builder path doesn't exist, write directly to log file
echo "end of cloud runner job" >> /home/job-log.txt
echo "---${CloudRunner.buildParameters.logId}" >> /home/job-log.txt
fi
set -e
# Mirror cache back into workspace for test assertions
mkdir -p "$GITHUB_WORKSPACE/cloud-runner-cache/cache/$CACHE_KEY/Library"
mkdir -p "$GITHUB_WORKSPACE/cloud-runner-cache/cache/$CACHE_KEY/build"