apify-test-tools 0.10.1-beta.3 → 0.10.1-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/public_platform-tests-claude-investigate-and-fix.yaml +7 -2
- package/CHANGELOG.md +6 -0
- package/CONTRIBUTING.md +9 -0
- package/bin/build-from-local.ts +8 -7
- package/bin/build.ts +22 -21
- package/bin/diff-changes.ts +11 -10
- package/bin/diff-json-schema.ts +14 -12
- package/bin/git.ts +90 -43
- package/bin/logger.ts +23 -0
- package/bin/main.ts +49 -35
- package/bin/output.ts +6 -0
- package/bin/slack.ts +8 -7
- package/bin/test-report.ts +22 -21
- package/bin/utils/config/actor-json.ts +84 -0
- package/bin/utils/config/load-config.ts +46 -46
- package/bin/utils/config/parser.ts +33 -28
- package/bin/utils/config/structures/base.ts +7 -0
- package/bin/utils/json-file.ts +11 -14
- package/bin/utils/path/repo-relative.ts +156 -0
- package/bin/utils/path/schema.ts +18 -0
- package/bin/utils.ts +61 -34
- package/dist/bin/build-from-local.d.ts +1 -1
- package/dist/bin/build-from-local.d.ts.map +1 -1
- package/dist/bin/build-from-local.js +8 -7
- package/dist/bin/build-from-local.js.map +1 -1
- package/dist/bin/build.d.ts.map +1 -1
- package/dist/bin/build.js +22 -21
- package/dist/bin/build.js.map +1 -1
- package/dist/bin/diff-changes.d.ts +1 -1
- package/dist/bin/diff-changes.d.ts.map +1 -1
- package/dist/bin/diff-changes.js +9 -8
- package/dist/bin/diff-changes.js.map +1 -1
- package/dist/bin/diff-json-schema.d.ts +1 -1
- package/dist/bin/diff-json-schema.d.ts.map +1 -1
- package/dist/bin/diff-json-schema.js +13 -12
- package/dist/bin/diff-json-schema.js.map +1 -1
- package/dist/bin/git.d.ts +10 -10
- package/dist/bin/git.d.ts.map +1 -1
- package/dist/bin/git.js +78 -37
- package/dist/bin/git.js.map +1 -1
- package/dist/bin/logger.d.ts +11 -0
- package/dist/bin/logger.d.ts.map +1 -0
- package/dist/bin/logger.js +20 -0
- package/dist/bin/logger.js.map +1 -0
- package/dist/bin/main.d.ts +1 -1
- package/dist/bin/main.js +48 -35
- package/dist/bin/main.js.map +1 -1
- package/dist/bin/output.d.ts +3 -0
- package/dist/bin/output.d.ts.map +1 -0
- package/dist/bin/output.js +6 -0
- package/dist/bin/output.js.map +1 -0
- package/dist/bin/slack.d.ts.map +1 -1
- package/dist/bin/slack.js +8 -7
- package/dist/bin/slack.js.map +1 -1
- package/dist/bin/test-report.d.ts.map +1 -1
- package/dist/bin/test-report.js +22 -21
- package/dist/bin/test-report.js.map +1 -1
- package/dist/bin/utils/config/actor-json.d.ts +14 -0
- package/dist/bin/utils/config/actor-json.d.ts.map +1 -0
- package/dist/bin/utils/config/actor-json.js +60 -0
- package/dist/bin/utils/config/actor-json.js.map +1 -0
- package/dist/bin/utils/config/load-config.d.ts +12 -2
- package/dist/bin/utils/config/load-config.d.ts.map +1 -1
- package/dist/bin/utils/config/load-config.js +32 -31
- package/dist/bin/utils/config/load-config.js.map +1 -1
- package/dist/bin/utils/config/parser.d.ts +4 -12
- package/dist/bin/utils/config/parser.d.ts.map +1 -1
- package/dist/bin/utils/config/parser.js +24 -23
- package/dist/bin/utils/config/parser.js.map +1 -1
- package/dist/bin/utils/config/structures/base.d.ts +5 -0
- package/dist/bin/utils/config/structures/base.d.ts.map +1 -1
- package/dist/bin/utils/config/structures/base.js.map +1 -1
- package/dist/bin/utils/json-file.d.ts +3 -2
- package/dist/bin/utils/json-file.d.ts.map +1 -1
- package/dist/bin/utils/json-file.js +8 -13
- package/dist/bin/utils/json-file.js.map +1 -1
- package/dist/bin/utils/path/repo-relative.d.ts +35 -0
- package/dist/bin/utils/path/repo-relative.d.ts.map +1 -0
- package/dist/bin/utils/path/repo-relative.js +137 -0
- package/dist/bin/utils/path/repo-relative.js.map +1 -0
- package/dist/bin/utils/path/schema.d.ts +7 -0
- package/dist/bin/utils/path/schema.d.ts.map +1 -0
- package/dist/bin/utils/path/schema.js +16 -0
- package/dist/bin/utils/path/schema.js.map +1 -0
- package/dist/bin/utils.d.ts +14 -3
- package/dist/bin/utils.d.ts.map +1 -1
- package/dist/bin/utils.js +52 -29
- package/dist/bin/utils.js.map +1 -1
- package/dist/test/unit/bin/build-from-local.test.js +3 -39
- package/dist/test/unit/bin/build-from-local.test.js.map +1 -1
- package/dist/test/unit/bin/diff-changes.test.js +97 -96
- package/dist/test/unit/bin/diff-changes.test.js.map +1 -1
- package/dist/test/unit/bin/diff.test.js +52 -48
- package/dist/test/unit/bin/diff.test.js.map +1 -1
- package/dist/test/unit/bin/git-command.test.d.ts +2 -0
- package/dist/test/unit/bin/git-command.test.d.ts.map +1 -0
- package/dist/test/unit/bin/git-command.test.js +54 -0
- package/dist/test/unit/bin/git-command.test.js.map +1 -0
- package/dist/test/unit/bin/git.test.js +211 -92
- package/dist/test/unit/bin/git.test.js.map +1 -1
- package/dist/test/unit/bin/logger.test.d.ts +2 -0
- package/dist/test/unit/bin/logger.test.d.ts.map +1 -0
- package/dist/test/unit/bin/logger.test.js +44 -0
- package/dist/test/unit/bin/logger.test.js.map +1 -0
- package/dist/test/unit/bin/logging.test.d.ts +2 -0
- package/dist/test/unit/bin/logging.test.d.ts.map +1 -0
- package/dist/test/unit/bin/logging.test.js +43 -0
- package/dist/test/unit/bin/logging.test.js.map +1 -0
- package/dist/test/unit/bin/utils/config/load-config.test.js +47 -25
- package/dist/test/unit/bin/utils/config/load-config.test.js.map +1 -1
- package/dist/test/unit/bin/utils/config/parser.test.js +64 -19
- package/dist/test/unit/bin/utils/config/parser.test.js.map +1 -1
- package/dist/test/unit/bin/utils/files.test.js +16 -27
- package/dist/test/unit/bin/utils/files.test.js.map +1 -1
- package/dist/test/unit/bin/utils/path/repo-relative.test.d.ts +2 -0
- package/dist/test/unit/bin/utils/path/repo-relative.test.d.ts.map +1 -0
- package/dist/test/unit/bin/utils/path/repo-relative.test.js +196 -0
- package/dist/test/unit/bin/utils/path/repo-relative.test.js.map +1 -0
- package/dist/test/unit/bin/utils/path/schema.test.d.ts +2 -0
- package/dist/test/unit/bin/utils/path/schema.test.d.ts.map +1 -0
- package/dist/test/unit/bin/utils/path/schema.test.js +52 -0
- package/dist/test/unit/bin/utils/path/schema.test.js.map +1 -0
- package/dist/test/unit/should-built-and-test.test.js +40 -38
- package/dist/test/unit/should-built-and-test.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/eslint.config.mjs +9 -1
- package/package.json +4 -4
- package/test/unit/bin/build-from-local.test.ts +3 -53
- package/test/unit/bin/diff-changes.test.ts +97 -96
- package/test/unit/bin/diff.test.ts +53 -48
- package/test/unit/bin/git-command.test.ts +71 -0
- package/test/unit/bin/git.test.ts +246 -89
- package/test/unit/bin/logger.test.ts +55 -0
- package/test/unit/bin/logging.test.ts +52 -0
- package/test/unit/bin/utils/config/load-config.test.ts +63 -26
- package/test/unit/bin/utils/config/parser.test.ts +81 -27
- package/test/unit/bin/utils/files.test.ts +19 -33
- package/test/unit/bin/utils/path/repo-relative.test.ts +250 -0
- package/test/unit/bin/utils/path/schema.test.ts +65 -0
- package/test/unit/should-built-and-test.test.ts +40 -38
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { ExistingDirSchema, RelativeDirSchema } from '../path/schema.js';
|
|
4
|
+
import {
|
|
5
|
+
CONFIG_FILE_STRATEGY,
|
|
6
|
+
type ResolvedActorConfig,
|
|
7
|
+
type StrategyParser,
|
|
8
|
+
type ValidatedActorConfig,
|
|
9
|
+
} from './structures/base.js';
|
|
4
10
|
import { GROUPED_PARSER } from './structures/grouped.js';
|
|
5
11
|
import { LEGACY_PARSER } from './structures/legacy.js';
|
|
6
12
|
|
|
@@ -32,32 +38,34 @@ const normalizeFolder = (folder: string): string => {
|
|
|
32
38
|
return stripped === '.' ? '' : stripped;
|
|
33
39
|
};
|
|
34
40
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const seenActorFullNames = new Set<string>();
|
|
47
|
-
const errors: string[] = [];
|
|
48
|
-
|
|
41
|
+
const ValidatedConfigSchema = z.array(
|
|
42
|
+
z.object({
|
|
43
|
+
actorFullName: z.string(),
|
|
44
|
+
folder: ExistingDirSchema,
|
|
45
|
+
tokenEnvVar: z.string(),
|
|
46
|
+
overrideActorContext: z.array(RelativeDirSchema).optional(),
|
|
47
|
+
}),
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
/** Normalize and validate paths, then check collisions using their final spelling. */
|
|
51
|
+
function verifyConfiguration(body: ResolvedActorConfig[]): ValidatedActorConfig[] {
|
|
49
52
|
const normalized = body.map((entry) => ({
|
|
50
53
|
...entry,
|
|
51
54
|
folder: normalizeFolder(entry.folder),
|
|
52
55
|
overrideActorContext: entry.overrideActorContext?.map(stripTrailingSlash),
|
|
53
56
|
}));
|
|
57
|
+
const parsed = ValidatedConfigSchema.safeParse(normalized);
|
|
58
|
+
if (!parsed.success) throw new Error(z.prettifyError(parsed.error));
|
|
54
59
|
|
|
55
|
-
|
|
60
|
+
const seenFolders = new Set<string>();
|
|
61
|
+
const seenActorFullNames = new Set<string>();
|
|
62
|
+
const errors: string[] = [];
|
|
63
|
+
for (const [index, entry] of parsed.data.entries()) {
|
|
56
64
|
// TODO: drop folder uniqueness (this requires several changes on other places)
|
|
57
|
-
if (seenFolders.has(entry.folder)) {
|
|
65
|
+
if (seenFolders.has(entry.folder.path)) {
|
|
58
66
|
errors.push(`Duplicate folder "${body[index].folder}". Each actor must have a unique folder.`);
|
|
59
67
|
} else {
|
|
60
|
-
seenFolders.add(entry.folder);
|
|
68
|
+
seenFolders.add(entry.folder.path);
|
|
61
69
|
}
|
|
62
70
|
|
|
63
71
|
if (seenActorFullNames.has(entry.actorFullName)) {
|
|
@@ -67,11 +75,8 @@ function verifyConfiguration(body: ResolvedActorConfig[]): ResolvedActorConfig[]
|
|
|
67
75
|
}
|
|
68
76
|
}
|
|
69
77
|
|
|
70
|
-
if (errors.length > 0)
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return normalized;
|
|
78
|
+
if (errors.length > 0) throw new Error(errors.join('\n'));
|
|
79
|
+
return parsed.data;
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
// eslint-disable-next-line no-underscore-dangle
|
|
@@ -80,10 +85,10 @@ export const _privates = {
|
|
|
80
85
|
verifyConfiguration,
|
|
81
86
|
};
|
|
82
87
|
|
|
83
|
-
export function parseConfigFile(body: Record<string, unknown>):
|
|
84
|
-
const
|
|
88
|
+
export function parseConfigFile(body: Record<string, unknown>): ValidatedActorConfig[] {
|
|
89
|
+
const { mode, ...rest } = body;
|
|
90
|
+
const strategy = selectStrategy({ mode });
|
|
85
91
|
|
|
86
|
-
const resolved = strategy.parse(
|
|
87
|
-
|
|
88
|
-
return validated;
|
|
92
|
+
const resolved = strategy.parse(rest);
|
|
93
|
+
return verifyConfiguration(resolved);
|
|
89
94
|
}
|
|
@@ -2,6 +2,8 @@ import { prettifyError, type ZodType } from 'zod';
|
|
|
2
2
|
|
|
3
3
|
import { ACTOR_NAME, USERNAME } from '@apify/consts';
|
|
4
4
|
|
|
5
|
+
import type { ExistingDir, RelativeDir } from '../../path/repo-relative.js';
|
|
6
|
+
|
|
5
7
|
function stripRegexAnchor(regex: string): string {
|
|
6
8
|
return regex.replace(/^\^/, '').replace(/\$$/, '');
|
|
7
9
|
}
|
|
@@ -21,6 +23,11 @@ export interface ResolvedActorConfig {
|
|
|
21
23
|
overrideActorContext: string[] | undefined;
|
|
22
24
|
}
|
|
23
25
|
|
|
26
|
+
export interface ValidatedActorConfig extends Omit<ResolvedActorConfig, 'folder' | 'overrideActorContext'> {
|
|
27
|
+
folder: ExistingDir;
|
|
28
|
+
overrideActorContext?: RelativeDir[];
|
|
29
|
+
}
|
|
30
|
+
|
|
24
31
|
export enum CONFIG_FILE_STRATEGY {
|
|
25
32
|
LEGACY = 'legacy',
|
|
26
33
|
GROUPED = 'grouped',
|
package/bin/utils/json-file.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { readFileSync
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
|
|
3
|
+
import type { ExistingFile } from './path/repo-relative.js';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* Why a JSON object could not be produced from a path. Callers that already have their own
|
|
5
7
|
* user-facing wording (e.g. the config file reader) switch on this instead of re-deriving the
|
|
6
8
|
* cause from an error message.
|
|
7
9
|
*/
|
|
8
|
-
export type JsonObjectReadFailureReason = '
|
|
10
|
+
export type JsonObjectReadFailureReason = 'unreadable' | 'invalid-json' | 'not-an-object';
|
|
9
11
|
|
|
10
12
|
export type JsonObjectReadResult =
|
|
11
13
|
| { success: true; contents: Record<string, unknown> }
|
|
@@ -21,34 +23,29 @@ const failed = (reason: JsonObjectReadFailureReason, message: string): JsonObjec
|
|
|
21
23
|
* Reads a file and parses it as a JSON object, reporting every way that can go wrong as a value
|
|
22
24
|
* instead of a thrown error — the caller decides which failures are fatal and how to word them.
|
|
23
25
|
*/
|
|
24
|
-
export function safeReadJsonObjectFile(
|
|
26
|
+
export function safeReadJsonObjectFile(filePath: ExistingFile): JsonObjectReadResult {
|
|
25
27
|
let file: string;
|
|
26
28
|
try {
|
|
27
|
-
|
|
28
|
-
const stats = statSync(path);
|
|
29
|
-
if (!stats.isFile()) {
|
|
30
|
-
return failed('not-a-file', `Expected ${path} to be a file`);
|
|
31
|
-
}
|
|
32
|
-
file = readFileSync(path, 'utf8');
|
|
29
|
+
file = readFileSync(filePath.path, 'utf8');
|
|
33
30
|
} catch {
|
|
34
|
-
return failed('unreadable', `Expected ${
|
|
31
|
+
return failed('unreadable', `Expected ${filePath} to exist or be readable`);
|
|
35
32
|
}
|
|
36
33
|
|
|
37
34
|
let parsed: unknown;
|
|
38
35
|
try {
|
|
39
36
|
parsed = JSON.parse(file);
|
|
40
37
|
} catch (err) {
|
|
41
|
-
return failed('invalid-json', `Failed to parse ${
|
|
38
|
+
return failed('invalid-json', `Failed to parse ${filePath}: ${err}`);
|
|
42
39
|
}
|
|
43
40
|
|
|
44
41
|
if (parsed === null) {
|
|
45
|
-
return failed('not-an-object', `Expected ${
|
|
42
|
+
return failed('not-an-object', `Expected ${filePath} to be a JSON object, not null`);
|
|
46
43
|
}
|
|
47
44
|
if (Array.isArray(parsed)) {
|
|
48
|
-
return failed('not-an-object', `Expected ${
|
|
45
|
+
return failed('not-an-object', `Expected ${filePath} to be a JSON object, not an array`);
|
|
49
46
|
}
|
|
50
47
|
if (typeof parsed !== 'object') {
|
|
51
|
-
return failed('not-an-object', `Expected ${
|
|
48
|
+
return failed('not-an-object', `Expected ${filePath} to be a JSON object`);
|
|
52
49
|
}
|
|
53
50
|
|
|
54
51
|
return { success: true, contents: parsed as Record<string, unknown> };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/* eslint-disable max-classes-per-file */
|
|
2
|
+
import { statSync } from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
|
|
5
|
+
// Git and the config file always use "/", so paths are POSIX regardless of the host OS.
|
|
6
|
+
const { posix } = path;
|
|
7
|
+
|
|
8
|
+
// A file path cannot end in "/", ".", "..", or be empty: each of those names a directory.
|
|
9
|
+
const assertNamesFile = (rawPath: string): void => {
|
|
10
|
+
const lastSegment = rawPath.slice(rawPath.lastIndexOf('/') + 1);
|
|
11
|
+
if (lastSegment === '' || lastSegment === '.' || lastSegment === '..') {
|
|
12
|
+
throw new Error(`Expected a file path, got directory path "${rawPath}".`);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// Shared by the file and directory paths. Use it as a parameter type where either kind is fine.
|
|
17
|
+
export abstract class AbstractPath {
|
|
18
|
+
readonly #path: string;
|
|
19
|
+
constructor(rawPath: string) {
|
|
20
|
+
if (posix.isAbsolute(rawPath)) {
|
|
21
|
+
throw new Error(`Expected a relative path, got absolute path "${rawPath}".`);
|
|
22
|
+
}
|
|
23
|
+
const normalized = posix.normalize(rawPath);
|
|
24
|
+
// normalize keeps a trailing slash ("actors/foo/"), which would make equal paths compare unequal.
|
|
25
|
+
this.#path = normalized.endsWith('/') ? normalized.slice(0, -1) : normalized;
|
|
26
|
+
this.assertNoEscape(rawPath);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// A file and a directory are never equal, even when spelled the same.
|
|
30
|
+
isEqualTo(other: AbstractPath): boolean {
|
|
31
|
+
// inheritance safe check, at least one of the two is a subclass of the other
|
|
32
|
+
const isRelativeOf = this instanceof other.constructor || other instanceof this.constructor;
|
|
33
|
+
return isRelativeOf && this.#path === other.#path;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
get path(): string {
|
|
37
|
+
return this.#path;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
toString(): string {
|
|
41
|
+
return this.path;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
toJSON(): string {
|
|
45
|
+
return this.path;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
private assertNoEscape(raw: string): void {
|
|
49
|
+
if (this.#path === '..' || this.#path.startsWith('../')) {
|
|
50
|
+
throw new Error(`Path "${raw}" escapes the repo root.`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export class RelativeDir extends AbstractPath {
|
|
56
|
+
static readonly ROOT = new RelativeDir('.');
|
|
57
|
+
|
|
58
|
+
joinDir(relativePath: string): RelativeDir {
|
|
59
|
+
return new RelativeDir(this.join(relativePath));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
joinFile(relativePath: string): RelativeFile {
|
|
63
|
+
// Must be checked before joining: posix.join('actors/foo', '.') is "actors/foo", which looks like a file.
|
|
64
|
+
assertNamesFile(relativePath);
|
|
65
|
+
return new RelativeFile(this.join(relativePath));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// True when `other` is this directory itself or lies inside it.
|
|
69
|
+
contains(other: AbstractPath): boolean {
|
|
70
|
+
// the root contains every path
|
|
71
|
+
if (this.path === '.') return true;
|
|
72
|
+
return this.isEqualTo(other) || other.path.startsWith(`${this.path}/`);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
isStrictAncestorOf(other: AbstractPath): boolean {
|
|
76
|
+
// you are not an ancestor of yourself
|
|
77
|
+
return !this.isEqualTo(other) && this.contains(other);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Throws unless this path exists and is a directory. Paths resolve against the process working
|
|
81
|
+
// directory, which is the repo root.
|
|
82
|
+
assertIsDir(): this {
|
|
83
|
+
// `stat`, not `lstat`: a symlink must resolve to its target, matching what reading it does.
|
|
84
|
+
const stats = statSync(this.path, { throwIfNoEntry: false });
|
|
85
|
+
if (!stats) throw new Error(`Expected directory "${this}" to exist.`);
|
|
86
|
+
if (!stats.isDirectory()) throw new Error(`Expected "${this}" to be a directory.`);
|
|
87
|
+
return this;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
private join(relativePath: string): string {
|
|
91
|
+
// Must be checked here: posix.join('.', '/etc') is "etc", so the constructor would not catch it.
|
|
92
|
+
if (posix.isAbsolute(relativePath)) {
|
|
93
|
+
throw new Error(`Expected a relative path to join with "${this}", got absolute path "${relativePath}".`);
|
|
94
|
+
}
|
|
95
|
+
return posix.join(this.path, relativePath);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export class ExistingDir extends RelativeDir {
|
|
100
|
+
constructor(rawPath: string) {
|
|
101
|
+
super(rawPath);
|
|
102
|
+
this.assertIsDir();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
static initialize(dir: RelativeDir): ExistingDir {
|
|
106
|
+
return new ExistingDir(dir.path);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export class RelativeFile extends AbstractPath {
|
|
111
|
+
constructor(rawPath: string) {
|
|
112
|
+
assertNamesFile(rawPath);
|
|
113
|
+
super(rawPath);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// The directory containing this file.
|
|
117
|
+
get parent(): RelativeDir {
|
|
118
|
+
return new RelativeDir(posix.dirname(this.path));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Resolves against the file's directory, the way a path written inside the file is meant
|
|
122
|
+
// (e.g. `dockerContextDir: ".."` in `.actor/actor.json` is the actor folder).
|
|
123
|
+
joinDir(relativePath: string): RelativeDir {
|
|
124
|
+
return this.parent.joinDir(relativePath);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Resolves against the file's directory, e.g. a sibling file.
|
|
128
|
+
joinFile(relativePath: string): RelativeFile {
|
|
129
|
+
return this.parent.joinFile(relativePath);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
isWithin(scope: RelativeDir): boolean {
|
|
133
|
+
return scope.contains(this);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Throws unless this path exists and is a file. Paths resolve against the process working
|
|
137
|
+
// directory, which is the repo root.
|
|
138
|
+
assertIsFile(): this {
|
|
139
|
+
// `stat`, not `lstat`: a symlink must resolve to its target, matching what reading it does.
|
|
140
|
+
const stats = statSync(this.path, { throwIfNoEntry: false });
|
|
141
|
+
if (!stats) throw new Error(`Expected file "${this}" to exist.`);
|
|
142
|
+
if (!stats.isFile()) throw new Error(`Expected "${this}" to be a file.`);
|
|
143
|
+
return this;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export class ExistingFile extends RelativeFile {
|
|
148
|
+
constructor(rawPath: string) {
|
|
149
|
+
super(rawPath);
|
|
150
|
+
this.assertIsFile();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
static initialize(file: RelativeFile): ExistingFile {
|
|
154
|
+
return new ExistingFile(file.path);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
|
|
3
|
+
import { ExistingDir, ExistingFile, RelativeDir, RelativeFile } from './repo-relative.js';
|
|
4
|
+
|
|
5
|
+
const parsePath = <T>(construct: (value: string) => T) =>
|
|
6
|
+
z.string().transform((value, ctx): T | typeof z.NEVER => {
|
|
7
|
+
try {
|
|
8
|
+
return construct(value);
|
|
9
|
+
} catch (error) {
|
|
10
|
+
ctx.addIssue({ code: 'custom', message: error instanceof Error ? error.message : String(error) });
|
|
11
|
+
return z.NEVER;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const RelativeDirSchema = parsePath((value) => new RelativeDir(value));
|
|
16
|
+
export const ExistingDirSchema = parsePath((value) => new ExistingDir(value));
|
|
17
|
+
export const RelativeFileSchema = parsePath((value) => new RelativeFile(value));
|
|
18
|
+
export const ExistingFileSchema = parsePath((value) => new ExistingFile(value));
|
package/bin/utils.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
+
import { promisify } from 'node:util';
|
|
5
|
+
|
|
6
|
+
import { logger } from './logger.js';
|
|
7
|
+
|
|
8
|
+
const execFileAsync = promisify(execFile);
|
|
4
9
|
|
|
5
10
|
// Returns true when `childPath` is not inside `parentPath`.
|
|
6
11
|
// Used to detect monorepo actors whose dockerContextDir escapes the actor directory.
|
|
@@ -14,18 +19,13 @@ export const isOutsideDir = (childPath: string, parentPath: string): boolean =>
|
|
|
14
19
|
* to keep, e.g. because .actor/ must survive even if .gitignore would otherwise exclude it.
|
|
15
20
|
* This also means .git/ itself is never walked, since git never lists its own internals here.
|
|
16
21
|
*/
|
|
17
|
-
export const listRepoFilePaths = (repoRoot: string, subDir: string): string[] => {
|
|
22
|
+
export const listRepoFilePaths = async (repoRoot: string, subDir: string): Promise<string[]> => {
|
|
18
23
|
const relSubDir = path.relative(repoRoot, subDir).split(path.sep).join('/') || '.';
|
|
19
|
-
const
|
|
24
|
+
const output = await runGitCommand(['ls-files', '--cached', '--others', '-z', '--', relSubDir], {
|
|
20
25
|
cwd: repoRoot,
|
|
21
|
-
|
|
26
|
+
operation: 'list repository files for the local build',
|
|
22
27
|
});
|
|
23
|
-
|
|
24
|
-
if (result.status !== 0) {
|
|
25
|
-
throw new Error(`[Command failed]: git ls-files\n${result.stderr.toString()}`);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return result.stdout.toString().split('\0').filter(Boolean);
|
|
28
|
+
return output.split('\0').filter(Boolean);
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
/**
|
|
@@ -34,21 +34,23 @@ export const listRepoFilePaths = (repoRoot: string, subDir: string): string[] =>
|
|
|
34
34
|
* anything `git` itself respects). Delegating to `git check-ignore` avoids re-implementing gitignore
|
|
35
35
|
* pattern matching.
|
|
36
36
|
*/
|
|
37
|
-
export const getGitignoredPaths = (relativePaths: string[]): Set<string
|
|
37
|
+
export const getGitignoredPaths = async (relativePaths: string[], cwd?: string): Promise<Set<string>> => {
|
|
38
38
|
if (relativePaths.length === 0) return new Set();
|
|
39
39
|
|
|
40
|
-
const result = spawnSync('git', ['check-ignore', '--stdin'], {
|
|
41
|
-
input: relativePaths.join('\n'),
|
|
42
|
-
maxBuffer: 100 * 1024 * 1024,
|
|
43
|
-
});
|
|
44
|
-
|
|
45
40
|
// Exit code 1 means none of the given paths are ignored - not an error. Anything else
|
|
46
41
|
// (e.g. 128 for "not a git repository") is a real failure.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
return runGitCommand(['check-ignore', '--', ...relativePaths], {
|
|
43
|
+
cwd,
|
|
44
|
+
operation: 'check which repository paths are ignored',
|
|
45
|
+
})
|
|
46
|
+
.then((output) => new Set(output.split('\n').filter(Boolean)))
|
|
47
|
+
.catch((error: unknown) => {
|
|
48
|
+
// exit code 1 means none of the given paths are ignored - not an error
|
|
49
|
+
if (error instanceof GitCommandError && error.exitCode === 1) {
|
|
50
|
+
return new Set<string>();
|
|
51
|
+
}
|
|
52
|
+
throw error;
|
|
53
|
+
});
|
|
52
54
|
};
|
|
53
55
|
|
|
54
56
|
export type SourceFile = { name: string; content: Buffer };
|
|
@@ -58,22 +60,47 @@ export const readSourceFile = async (absPath: string, rootDir: string): Promise<
|
|
|
58
60
|
content: await fs.readFile(absPath),
|
|
59
61
|
});
|
|
60
62
|
|
|
61
|
-
export
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
throw new Error(`[Command failed]: ${command}\n${commandResult.error}`);
|
|
67
|
-
}
|
|
63
|
+
export class GitCommandError extends Error {
|
|
64
|
+
readonly args: readonly string[];
|
|
65
|
+
readonly gitError: string;
|
|
66
|
+
readonly exitCode?: number;
|
|
67
|
+
readonly cause: unknown;
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
constructor(args: readonly string[], error: unknown, operation?: string) {
|
|
70
|
+
const stderr =
|
|
71
|
+
typeof error === 'object' && error !== null && 'stderr' in error && typeof error.stderr === 'string'
|
|
72
|
+
? error.stderr.trim()
|
|
73
|
+
: '';
|
|
74
|
+
const gitError = stderr || (error instanceof Error ? error.message : String(error));
|
|
75
|
+
const exitCode =
|
|
76
|
+
typeof error === 'object' && error !== null && 'code' in error && typeof error.code === 'number'
|
|
77
|
+
? error.code
|
|
78
|
+
: undefined;
|
|
79
|
+
const command = `git ${args.map((arg) => JSON.stringify(arg)).join(' ')}`;
|
|
80
|
+
const operationContext = operation ? `Failed to ${operation}.\n` : '';
|
|
81
|
+
super(`${operationContext}Command: ${command}\nGit error: ${gitError}`);
|
|
82
|
+
this.name = 'GitCommandError';
|
|
83
|
+
this.args = [...args];
|
|
84
|
+
this.gitError = gitError;
|
|
85
|
+
this.exitCode = exitCode;
|
|
86
|
+
this.cause = error;
|
|
74
87
|
}
|
|
88
|
+
}
|
|
75
89
|
|
|
76
|
-
|
|
90
|
+
/** Runs Git asynchronously, passing each argument directly to Git without a shell. */
|
|
91
|
+
export const runGitCommand = async (
|
|
92
|
+
args: string[],
|
|
93
|
+
{ cwd, operation }: { cwd?: string; operation?: string } = {},
|
|
94
|
+
): Promise<string> => {
|
|
95
|
+
logger.debug('git', args);
|
|
96
|
+
const { stdout } = await execFileAsync('git', args, { cwd, encoding: 'utf8', maxBuffer: 100 * 1024 * 1024 }).catch(
|
|
97
|
+
(error: unknown) => {
|
|
98
|
+
const err = new GitCommandError(args, error, operation);
|
|
99
|
+
logger.debug('git command failed:\n', err);
|
|
100
|
+
throw err;
|
|
101
|
+
},
|
|
102
|
+
);
|
|
103
|
+
return stdout.trim();
|
|
77
104
|
};
|
|
78
105
|
|
|
79
106
|
export const getEnvVar = (varName: string, defaultValue?: string): string => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ActorConfig, BuildData } from './types.js';
|
|
2
2
|
import type { SourceFile } from './utils.js';
|
|
3
3
|
export declare const collectSourceFiles: (actorName: string, actorDir: string) => Promise<SourceFile[]>;
|
|
4
|
-
export declare const collectNonIgnoredFiles: (dockerContextDir: string, repoRoot: string) => string[]
|
|
4
|
+
export declare const collectNonIgnoredFiles: (dockerContextDir: string, repoRoot: string) => Promise<string[]>;
|
|
5
5
|
export declare const flattenMonorepoContext: (actorName: string, absActorDir: string, contextAbsDir: string, actorJson: Record<string, unknown>, keptContextFiles: string[]) => Promise<{
|
|
6
6
|
tempDir: string;
|
|
7
7
|
filePaths: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-from-local.d.ts","sourceRoot":"","sources":["../../bin/build-from-local.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-from-local.d.ts","sourceRoot":"","sources":["../../bin/build-from-local.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAU7C,eAAO,MAAM,kBAAkB,GAAU,WAAW,MAAM,EAAE,UAAU,MAAM,KAAG,OAAO,CAAC,UAAU,EAAE,CAiClG,CAAC;AAWF,eAAO,MAAM,sBAAsB,GAAU,kBAAkB,MAAM,EAAE,UAAU,MAAM,KAAG,OAAO,CAAC,MAAM,EAAE,CAoBzG,CAAC;AAaF,eAAO,MAAM,sBAAsB,GAC/B,WAAW,MAAM,EACjB,aAAa,MAAM,EACnB,eAAe,MAAM,EACrB,WAAW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,kBAAkB,MAAM,EAAE,KAC3B,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAyClD,CAAC;AAcF,eAAO,MAAM,qBAAqB,GAC9B,aAAa,MAAM,EACnB,eAAe,MAAM,EACrB,SAAS,MAAM,EACf,WAAW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KACnC,OAAO,CAAC,IAAI,CAqBd,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAU,2BAGtC;IACC,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,MAAM,EAAE,OAAO,CAAC;CACnB,KAAG,OAAO,CAAC,SAAS,EAAE,CAsBtB,CAAC"}
|
|
@@ -5,6 +5,7 @@ import AdmZip from 'adm-zip';
|
|
|
5
5
|
import { ActorSourceType } from 'apify-client';
|
|
6
6
|
import { dryRunBuildData, LOCAL_SOURCE_VERSION_NUMBER, runAndSummarizeBuilds } from './build.js';
|
|
7
7
|
import { buildDockerIgnoreMatcher } from './dockerignore.js';
|
|
8
|
+
import { logger } from './logger.js';
|
|
8
9
|
import { isPathWithinScope } from './path-utils.js';
|
|
9
10
|
import { getGitignoredPaths, isOutsideDir, listRepoFilePaths, readSourceFile } from './utils.js';
|
|
10
11
|
// JUST IN CASE. File patterns that commonly hold credentials — never ship these into a build, regardless
|
|
@@ -25,7 +26,7 @@ export const collectSourceFiles = async (actorName, actorDir) => {
|
|
|
25
26
|
const contextAbsDir = rawContextDir ? path.resolve(absActorDir, '.actor', rawContextDir) : undefined;
|
|
26
27
|
const isMonorepoActor = !!contextAbsDir && isOutsideDir(contextAbsDir, absActorDir);
|
|
27
28
|
const dockerContextDirAbs = isMonorepoActor ? contextAbsDir : absActorDir;
|
|
28
|
-
const keptFilePaths = collectNonIgnoredFiles(dockerContextDirAbs, repoRoot);
|
|
29
|
+
const keptFilePaths = await collectNonIgnoredFiles(dockerContextDirAbs, repoRoot);
|
|
29
30
|
if (!isMonorepoActor) {
|
|
30
31
|
return Promise.all(keptFilePaths.map(async (filePath) => readSourceFile(filePath, dockerContextDirAbs)));
|
|
31
32
|
}
|
|
@@ -47,9 +48,9 @@ export const collectSourceFiles = async (actorName, actorDir) => {
|
|
|
47
48
|
// regardless of .gitignore/.dockerignore, matching Apify CLI's own behavior. Files matching the
|
|
48
49
|
// hardcoded secret-pattern backstop (keys, certs, .env variants) are dropped unconditionally,
|
|
49
50
|
// .actor/ included, since those should never ship regardless of what the ignore files say.
|
|
50
|
-
export const collectNonIgnoredFiles = (dockerContextDir, repoRoot) => {
|
|
51
|
-
const relativePaths = listRepoFilePaths(repoRoot, dockerContextDir);
|
|
52
|
-
const ignoredPaths = getGitignoredPaths(relativePaths);
|
|
51
|
+
export const collectNonIgnoredFiles = async (dockerContextDir, repoRoot) => {
|
|
52
|
+
const relativePaths = await listRepoFilePaths(repoRoot, dockerContextDir);
|
|
53
|
+
const ignoredPaths = await getGitignoredPaths(relativePaths, repoRoot);
|
|
53
54
|
const rootRelativePaths = new Map(relativePaths.map((relPath) => [
|
|
54
55
|
relPath,
|
|
55
56
|
path.relative(dockerContextDir, path.join(repoRoot, relPath)).split(path.sep).join('/'),
|
|
@@ -80,7 +81,7 @@ export const collectNonIgnoredFiles = (dockerContextDir, repoRoot) => {
|
|
|
80
81
|
// all relative paths (dockerfile, dockerContextDir, changelog) are exactly one
|
|
81
82
|
// level up ("..") instead of three ("../../..").
|
|
82
83
|
export const flattenMonorepoContext = async (actorName, absActorDir, contextAbsDir, actorJson, keptContextFiles) => {
|
|
83
|
-
|
|
84
|
+
logger.info(`[${actorName}]: monorepo actor detected — flattening from Docker context`);
|
|
84
85
|
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), `apify-build-${actorName.replace('/', '_')}-`));
|
|
85
86
|
const filePaths = [];
|
|
86
87
|
// Step 1: copy only the files that survived gitignore/secret filtering, preserving their
|
|
@@ -147,9 +148,9 @@ export const rewriteActorJsonPaths = async (absActorDir, contextAbsDir, tempDir,
|
|
|
147
148
|
};
|
|
148
149
|
export const runBuildsFromLocal = async ({ actorConfigs, dryRun, }) => {
|
|
149
150
|
if (dryRun) {
|
|
150
|
-
|
|
151
|
+
logger.info('[DRY RUN] Would build from local source:');
|
|
151
152
|
for (const { actorFullName, folder } of actorConfigs) {
|
|
152
|
-
|
|
153
|
+
logger.info(` ${actorFullName} (${folder})`);
|
|
153
154
|
}
|
|
154
155
|
return actorConfigs.map(({ actorFullName }) => dryRunBuildData(actorFullName, LOCAL_SOURCE_VERSION_NUMBER));
|
|
155
156
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-from-local.js","sourceRoot":"","sources":["../../bin/build-from-local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,MAAM,MAAM,SAAS,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACjG,OAAO,EAAE,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2B,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;IAC3F,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}
|
package/dist/bin/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../bin/build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,gBAAgB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../bin/build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,gBAAgB,MAAM,cAAc,CAAC;AAKtD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAYzD,eAAO,MAAM,2BAA2B,SAAS,CAAC;AAQlD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAI,eAAe,MAAM,EAAE,WAAW,gBAAgB,CAAC,KAAK;;;;;CAsB7F,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kCAAkC,GAC3C,eAAe,MAAM,EACrB,gBAAgB,gBAAgB,CAAC,YAAY,GAAG,SAAS,EACzD,SAAS,MAAM,SAoBlB,CAAC;AAEF,qBAAa,YAAY;IAEjB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAFlC,OAAO;IAKP,YAAY,QAAa,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAQtD;IAEF,uBAAuB;;;;;OAAoF;IAI3G,eAAe,GAAU,eAAe,MAAM,EAAE,KAAK,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC,CAY3E;IAGF,qBAAqB,GACjB,eAAe,MAAM,EACrB,cAAc,gBAAgB,CAAC,YAAY,EAC3C,UAAU,OAAO,EACjB,YAAY,gBAAgB,CAAC,KAAK,KACnC,OAAO,CAAC,SAAS,CAAC,CAmBnB;IAEF,oBAAoB,GAAU,SAAS,MAAM,KAAG,OAAO,C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