pr feedback
parent
ebbb1d4150
commit
6e82b74240
|
|
@ -3213,6 +3213,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.TaskService = void 0;
|
||||
const client_cloudformation_1 = __nccwpck_require__(15650);
|
||||
// eslint-disable-next-line import/named
|
||||
const client_cloudwatch_logs_1 = __nccwpck_require__(31573);
|
||||
const client_ecs_1 = __nccwpck_require__(18209);
|
||||
const client_s3_1 = __nccwpck_require__(19250);
|
||||
|
|
@ -4004,9 +4005,9 @@ class KubernetesPods {
|
|||
errorDetails.push(`Recent events: ${JSON.stringify(events.slice(-5), undefined, 2)}`);
|
||||
}
|
||||
// Check if only PreStopHook failed but container succeeded
|
||||
const hasPreStopHookFailure = events.some((e) => e.reason === 'FailedPreStopHook');
|
||||
const wasKilled = events.some((e) => e.reason === 'Killing');
|
||||
const hasExceededGracePeriod = events.some((e) => e.reason === 'ExceededGracePeriod');
|
||||
const hasPreStopHookFailure = events.some((event) => event.reason === 'FailedPreStopHook');
|
||||
const wasKilled = events.some((event) => event.reason === 'Killing');
|
||||
const hasExceededGracePeriod = events.some((event) => event.reason === 'ExceededGracePeriod');
|
||||
// If container succeeded (exit code 0), PreStopHook failure is non-critical
|
||||
// Also check if pod was killed but container might have succeeded
|
||||
if (containerSucceeded && containerExitCode === 0) {
|
||||
|
|
@ -5622,7 +5623,8 @@ class RemoteClient {
|
|||
}
|
||||
if (!build_parameters_1.default.shouldUseRetainedWorkspaceMode(cloud_runner_1.default.buildParameters)) {
|
||||
const uniqueJobFolderLinux = cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute);
|
||||
if (node_fs_1.default.existsSync(cloud_runner_folders_1.CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute) || node_fs_1.default.existsSync(uniqueJobFolderLinux)) {
|
||||
if (node_fs_1.default.existsSync(cloud_runner_folders_1.CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute) ||
|
||||
node_fs_1.default.existsSync(uniqueJobFolderLinux)) {
|
||||
await cloud_runner_system_1.CloudRunnerSystem.Run(`rm -r ${uniqueJobFolderLinux} || true`);
|
||||
}
|
||||
else {
|
||||
|
|
@ -6324,7 +6326,7 @@ class SharedWorkspaceLocking {
|
|||
try {
|
||||
const output = await SharedWorkspaceLocking.rclone(`lsjson ${path}`);
|
||||
const json = JSON.parse(output);
|
||||
return json.map((e) => (e.IsDir ? `${e.Name}/` : e.Name));
|
||||
return json.map((entry) => (entry.IsDir ? `${entry.Name}/` : entry.Name));
|
||||
}
|
||||
catch {
|
||||
return [];
|
||||
|
|
@ -7318,7 +7320,7 @@ git config --global filter.lfs.smudge "git-lfs smudge --skip -- %f"
|
|||
git config --global filter.lfs.process "git-lfs filter-process --skip"
|
||||
BRANCH="${cloud_runner_1.default.buildParameters.cloudRunnerBranch}"
|
||||
REPO="${cloud_runner_folders_1.CloudRunnerFolders.unityBuilderRepoUrl}"
|
||||
if [ -n "$(git ls-remote --heads \"$REPO\" \"$BRANCH\" 2>/dev/null)" ]; then
|
||||
if [ -n "$(git ls-remote --heads "$REPO" "$BRANCH" 2>/dev/null)" ]; then
|
||||
git clone -q -b "$BRANCH" "$REPO" /builder
|
||||
else
|
||||
echo "Remote branch $BRANCH not found in $REPO; falling back to a known branch"
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -3,12 +3,16 @@ import * as core from '@actions/core';
|
|||
import {
|
||||
CloudFormation,
|
||||
CreateStackCommand,
|
||||
// eslint-disable-next-line import/named
|
||||
CreateStackCommandInput,
|
||||
DescribeStacksCommand,
|
||||
// eslint-disable-next-line import/named
|
||||
DescribeStacksCommandInput,
|
||||
ListStacksCommand,
|
||||
// eslint-disable-next-line import/named
|
||||
Parameter,
|
||||
UpdateStackCommand,
|
||||
// eslint-disable-next-line import/named
|
||||
UpdateStackCommandInput,
|
||||
waitUntilStackCreateComplete,
|
||||
waitUntilStackUpdateComplete,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import {
|
||||
CloudFormation,
|
||||
CreateStackCommand,
|
||||
// eslint-disable-next-line import/named
|
||||
CreateStackCommandInput,
|
||||
DescribeStackResourcesCommand,
|
||||
DescribeStacksCommand,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// eslint-disable-next-line import/named
|
||||
import { StackResource } from '@aws-sdk/client-cloudformation';
|
||||
|
||||
class CloudRunnerAWSTaskDef {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import {
|
|||
ListStacksCommand,
|
||||
} from '@aws-sdk/client-cloudformation';
|
||||
import type { StackSummary } from '@aws-sdk/client-cloudformation';
|
||||
// eslint-disable-next-line import/named
|
||||
import { DescribeLogGroupsCommand, DescribeLogGroupsCommandInput } from '@aws-sdk/client-cloudwatch-logs';
|
||||
import type { LogGroup } from '@aws-sdk/client-cloudwatch-logs';
|
||||
import { DescribeTasksCommand, ListClustersCommand, ListTasksCommand } from '@aws-sdk/client-ecs';
|
||||
|
|
@ -201,9 +202,9 @@ export class TaskService {
|
|||
public static async getLocks(): Promise<Array<{ Key: string }>> {
|
||||
process.env.AWS_REGION = Input.region;
|
||||
if (CloudRunner.buildParameters.storageProvider === 'rclone') {
|
||||
const objects = await (
|
||||
SharedWorkspaceLocking as unknown as { listObjects(prefix: string): Promise<string[]> }
|
||||
).listObjects('');
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
type ListObjectsFunction = (prefix: string) => Promise<string[]>;
|
||||
const objects = await (SharedWorkspaceLocking as unknown as { listObjects: ListObjectsFunction }).listObjects('');
|
||||
|
||||
return objects.map((x: string) => ({ Key: x }));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,9 +61,9 @@ class KubernetesPods {
|
|||
}
|
||||
|
||||
// Check if only PreStopHook failed but container succeeded
|
||||
const hasPreStopHookFailure = events.some((e) => e.reason === 'FailedPreStopHook');
|
||||
const wasKilled = events.some((e) => e.reason === 'Killing');
|
||||
const hasExceededGracePeriod = events.some((e) => e.reason === 'ExceededGracePeriod');
|
||||
const hasPreStopHookFailure = events.some((event) => event.reason === 'FailedPreStopHook');
|
||||
const wasKilled = events.some((event) => event.reason === 'Killing');
|
||||
const hasExceededGracePeriod = events.some((event) => event.reason === 'ExceededGracePeriod');
|
||||
|
||||
// If container succeeded (exit code 0), PreStopHook failure is non-critical
|
||||
// Also check if pod was killed but container might have succeeded
|
||||
|
|
|
|||
|
|
@ -143,7 +143,10 @@ export class RemoteClient {
|
|||
const uniqueJobFolderLinux = CloudRunnerFolders.ToLinuxFolder(
|
||||
CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute,
|
||||
);
|
||||
if (fs.existsSync(CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute) || fs.existsSync(uniqueJobFolderLinux)) {
|
||||
if (
|
||||
fs.existsSync(CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute) ||
|
||||
fs.existsSync(uniqueJobFolderLinux)
|
||||
) {
|
||||
await CloudRunnerSystem.Run(`rm -r ${uniqueJobFolderLinux} || true`);
|
||||
} else {
|
||||
RemoteClientLogger.log(`Skipping cleanup; unique job folder missing`);
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ export class SharedWorkspaceLocking {
|
|||
const output = await SharedWorkspaceLocking.rclone(`lsjson ${path}`);
|
||||
const json = JSON.parse(output) as { Name: string; IsDir: boolean }[];
|
||||
|
||||
return json.map((e) => (e.IsDir ? `${e.Name}/` : e.Name));
|
||||
return json.map((entry) => (entry.IsDir ? `${entry.Name}/` : entry.Name));
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,9 @@ describe('Cloud Runner pre-built rclone steps', () => {
|
|||
try {
|
||||
const lines = await CloudRunnerSystem.RunAndReadLines(`rclone lsf ${remote}`);
|
||||
CloudRunnerLogger.log(lines.join(','));
|
||||
} catch {}
|
||||
} catch {
|
||||
// Ignore errors when listing remote root (best-effort validation)
|
||||
}
|
||||
}, 1_000_000_000);
|
||||
} else {
|
||||
it.skip('Run build and prebuilt rclone steps - rclone not configured', () => {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { GitHubUrlInfo } from '../../providers/provider-url-parser';
|
||||
import * as fs from 'fs';
|
||||
|
||||
// Import the mocked ProviderGitManager
|
||||
import { ProviderGitManager } from '../../providers/provider-git-manager';
|
||||
|
|
@ -15,7 +14,6 @@ jest.mock('@actions/core', () => ({
|
|||
jest.mock('fs');
|
||||
|
||||
// Mock the entire provider-git-manager module
|
||||
const mockExecAsync = jest.fn();
|
||||
jest.mock('../../providers/provider-git-manager', () => {
|
||||
const originalModule = jest.requireActual('../../providers/provider-git-manager');
|
||||
|
||||
|
|
@ -29,8 +27,6 @@ jest.mock('../../providers/provider-git-manager', () => {
|
|||
},
|
||||
};
|
||||
});
|
||||
|
||||
const mockFs = fs as jest.Mocked<typeof fs>;
|
||||
const mockProviderGitManager = ProviderGitManager as jest.Mocked<typeof ProviderGitManager>;
|
||||
|
||||
describe('ProviderGitManager', () => {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ git config --global filter.lfs.smudge "git-lfs smudge --skip -- %f"
|
|||
git config --global filter.lfs.process "git-lfs filter-process --skip"
|
||||
BRANCH="${CloudRunner.buildParameters.cloudRunnerBranch}"
|
||||
REPO="${CloudRunnerFolders.unityBuilderRepoUrl}"
|
||||
if [ -n "$(git ls-remote --heads \"$REPO\" \"$BRANCH\" 2>/dev/null)" ]; then
|
||||
if [ -n "$(git ls-remote --heads "$REPO" "$BRANCH" 2>/dev/null)" ]; then
|
||||
git clone -q -b "$BRANCH" "$REPO" /builder
|
||||
else
|
||||
echo "Remote branch $BRANCH not found in $REPO; falling back to a known branch"
|
||||
|
|
|
|||
Loading…
Reference in New Issue