apify-test-tools 0.9.1-beta.4 → 0.9.1-beta.6
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/on_pull_request.yaml +1 -1
- package/.prettierignore +3 -0
- package/.vscode/settings.json +2 -1
- package/CHANGELOG.md +4 -0
- package/bin/main.ts +2 -1
- package/bin/types.ts +0 -11
- package/bin/utils/config/load-config.ts +133 -0
- package/bin/utils/config/parser.ts +88 -0
- package/bin/utils/config/structures/base.ts +61 -0
- package/bin/utils/config/structures/legacy.ts +20 -0
- package/bin/utils/json-file.ts +55 -0
- package/bin/utils.ts +0 -138
- package/dist/bin/main.d.ts.map +1 -1
- package/dist/bin/main.js +2 -1
- package/dist/bin/main.js.map +1 -1
- package/dist/bin/types.d.ts +0 -9
- package/dist/bin/types.d.ts.map +1 -1
- package/dist/bin/utils/config/load-config.d.ts +13 -0
- package/dist/bin/utils/config/load-config.d.ts.map +1 -0
- package/dist/bin/utils/config/load-config.js +99 -0
- package/dist/bin/utils/config/load-config.js.map +1 -0
- package/dist/bin/utils/config/parser.d.ts +19 -0
- package/dist/bin/utils/config/parser.d.ts.map +1 -0
- package/dist/bin/utils/config/parser.js +72 -0
- package/dist/bin/utils/config/parser.js.map +1 -0
- package/dist/bin/utils/config/structures/base.d.ts +35 -0
- package/dist/bin/utils/config/structures/base.d.ts.map +1 -0
- package/dist/bin/utils/config/structures/base.js +40 -0
- package/dist/bin/utils/config/structures/base.js.map +1 -0
- package/dist/bin/utils/config/structures/legacy.d.ts +6 -0
- package/dist/bin/utils/config/structures/legacy.d.ts.map +1 -0
- package/dist/bin/utils/config/structures/legacy.js +14 -0
- package/dist/bin/utils/config/structures/legacy.js.map +1 -0
- package/dist/bin/utils/json-file.d.ts +20 -0
- package/dist/bin/utils/json-file.d.ts.map +1 -0
- package/dist/bin/utils/json-file.js +42 -0
- package/dist/bin/utils/json-file.js.map +1 -0
- package/dist/bin/utils.d.ts +0 -6
- package/dist/bin/utils.d.ts.map +1 -1
- package/dist/bin/utils.js +0 -98
- package/dist/bin/utils.js.map +1 -1
- package/dist/test/unit/bin/utils/config/load-config.test.d.ts +2 -0
- package/dist/test/unit/bin/utils/config/load-config.test.d.ts.map +1 -0
- package/dist/test/unit/bin/utils/config/load-config.test.js +138 -0
- package/dist/test/unit/bin/utils/config/load-config.test.js.map +1 -0
- package/dist/test/unit/bin/utils/config/parser.test.d.ts +2 -0
- package/dist/test/unit/bin/utils/config/parser.test.d.ts.map +1 -0
- package/dist/test/unit/bin/utils/config/parser.test.js +111 -0
- package/dist/test/unit/bin/utils/config/parser.test.js.map +1 -0
- package/dist/test/unit/bin/utils/config/structures/base.test.d.ts +2 -0
- package/dist/test/unit/bin/utils/config/structures/base.test.d.ts.map +1 -0
- package/dist/test/unit/bin/utils/config/structures/base.test.js +74 -0
- package/dist/test/unit/bin/utils/config/structures/base.test.js.map +1 -0
- package/dist/test/unit/bin/utils/config/structures/legacy.test.d.ts +2 -0
- package/dist/test/unit/bin/utils/config/structures/legacy.test.d.ts.map +1 -0
- package/dist/test/unit/bin/utils/config/structures/legacy.test.js +63 -0
- package/dist/test/unit/bin/utils/config/structures/legacy.test.js.map +1 -0
- package/dist/test/unit/bin/utils/files.test.d.ts +2 -0
- package/dist/test/unit/bin/utils/files.test.d.ts.map +1 -0
- package/dist/test/unit/bin/utils/files.test.js +117 -0
- package/dist/test/unit/bin/utils/files.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/test/fixtures/bin/utils/files/array.json +1 -0
- package/test/fixtures/bin/utils/files/comments.jsonc +4 -0
- package/test/fixtures/bin/utils/files/directory.json/.gitkeep +0 -0
- package/test/fixtures/bin/utils/files/empty-object.json +1 -0
- package/test/fixtures/bin/utils/files/empty.json +0 -0
- package/test/fixtures/bin/utils/files/malformed.json +1 -0
- package/test/fixtures/bin/utils/files/nested.json +6 -0
- package/test/fixtures/bin/utils/files/no-json-extension.actorrc +1 -0
- package/test/fixtures/bin/utils/files/null.json +1 -0
- package/test/fixtures/bin/utils/files/number.json +1 -0
- package/test/fixtures/bin/utils/files/unreadable.json +1 -0
- package/test/tsconfig.json +4 -2
- package/test/unit/bin/utils/config/load-config.test.ts +179 -0
- package/test/unit/bin/utils/config/parser.test.ts +137 -0
- package/test/unit/bin/utils/config/structures/base.test.ts +83 -0
- package/test/unit/bin/utils/config/structures/legacy.test.ts +78 -0
- package/test/unit/bin/utils/files.test.ts +158 -0
- package/dist/test/unit/bin/utils.test.d.ts +0 -2
- package/dist/test/unit/bin/utils.test.d.ts.map +0 -1
- package/dist/test/unit/bin/utils.test.js +0 -321
- package/dist/test/unit/bin/utils.test.js.map +0 -1
- package/test/unit/bin/utils.test.ts +0 -381
package/.prettierignore
CHANGED
package/.vscode/settings.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
<!-- git-cliff-unreleased-start -->
|
|
6
6
|
## 0.9.1 - **not yet released**
|
|
7
7
|
|
|
8
|
+
### 🚀 Features
|
|
9
|
+
|
|
10
|
+
- **config/modes:** Lay groundwork for multiple configuration structures ([#142](https://github.com/apify/apify-test-tools/pull/142)) ([7e18638](https://github.com/apify/apify-test-tools/commit/7e18638a8d3523154dbe819312c2b16b54c548ff)) by [@JuanGalilea](https://github.com/JuanGalilea)
|
|
11
|
+
|
|
8
12
|
### 🐛 Bug Fixes
|
|
9
13
|
|
|
10
14
|
- Apply default actor timeout to runs ([#134](https://github.com/apify/apify-test-tools/pull/134)) ([82f5f7d](https://github.com/apify/apify-test-tools/commit/82f5f7d4de990db7ad8edf940c19ffd6b20bad13)) by [@Patai5](https://github.com/Patai5)
|
package/bin/main.ts
CHANGED
|
@@ -14,7 +14,8 @@ import { getPushData } from './github.js';
|
|
|
14
14
|
import { notifyToSlack } from './slack.js';
|
|
15
15
|
import { reportTestResults } from './test-report.js';
|
|
16
16
|
import type { Config } from './types.js';
|
|
17
|
-
import {
|
|
17
|
+
import { setCwd, spawnCommandInGhWorkspace } from './utils.js';
|
|
18
|
+
import { readConfigFile } from './utils/config/load-config.js';
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* Middlewares to be run before every command execution
|
package/bin/types.ts
CHANGED
|
@@ -87,17 +87,6 @@ export interface GithubCommit {
|
|
|
87
87
|
modified: string[];
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
export interface ActorConfigFileEntry {
|
|
91
|
-
folder: string;
|
|
92
|
-
actorFullName: string;
|
|
93
|
-
tokenEnvVar: string;
|
|
94
|
-
overrideActorContext?: string[];
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export interface ActorConfigFile {
|
|
98
|
-
actors: ActorConfigFileEntry[];
|
|
99
|
-
}
|
|
100
|
-
|
|
101
90
|
export interface BuildData {
|
|
102
91
|
buildId: string;
|
|
103
92
|
actorRawId: string;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
|
|
3
|
+
import { selectActors } from '../../actor-filtering.js';
|
|
4
|
+
import { isPathWithinScope } from '../../path-utils.js';
|
|
5
|
+
import type { ActorConfig } from '../../types.js';
|
|
6
|
+
import { safeReadJsonObjectFile } from '../json-file.js';
|
|
7
|
+
import { parseConfigFile } from './parser.js';
|
|
8
|
+
import type { ResolvedActorConfig } from './structures/base.js';
|
|
9
|
+
|
|
10
|
+
export const CONFIG_FILE_NAME = 'apify-test-tools.config.json';
|
|
11
|
+
|
|
12
|
+
// Reading the config happens in three stages, each one swappable on its own:
|
|
13
|
+
//
|
|
14
|
+
// 1. file -> plain object (safeReadJsonObjectFile)
|
|
15
|
+
// 2. plain object -> ResolvedActorConfig[] (parseConfigFile — picks a strategy, validates
|
|
16
|
+
// and normalizes; see ./parser.ts)
|
|
17
|
+
// 3. ResolvedActorConfig -> ActorConfig (loadActorConfig — merges in .actor/actor.json)
|
|
18
|
+
|
|
19
|
+
// #region utils
|
|
20
|
+
|
|
21
|
+
const findOverlappingContextPaths = (contextPaths: string[]): [string, string] | undefined => {
|
|
22
|
+
for (let i = 0; i < contextPaths.length; i++) {
|
|
23
|
+
for (let j = i + 1; j < contextPaths.length; j++) {
|
|
24
|
+
if (
|
|
25
|
+
isPathWithinScope(contextPaths[i], contextPaths[j]) ||
|
|
26
|
+
isPathWithinScope(contextPaths[j], contextPaths[i])
|
|
27
|
+
) {
|
|
28
|
+
return [contextPaths[i], contextPaths[j]];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return undefined;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// The repo root is spelled "" internally but "." in a config file, so report it the way a reader
|
|
36
|
+
// would have written it.
|
|
37
|
+
const displayFolder = (folder: string): string => folder || '.';
|
|
38
|
+
|
|
39
|
+
// #endregion
|
|
40
|
+
|
|
41
|
+
// #region stages
|
|
42
|
+
|
|
43
|
+
/** Stage 1 — the config file as a plain object, or a failure phrased for whoever wrote it. */
|
|
44
|
+
const readConfigFileContents = async (): Promise<Record<string, unknown>> => {
|
|
45
|
+
const file = safeReadJsonObjectFile(CONFIG_FILE_NAME);
|
|
46
|
+
if (file.success) {
|
|
47
|
+
return file.contents;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
switch (file.reason) {
|
|
51
|
+
case 'invalid-json':
|
|
52
|
+
// TODO: support .jsonc
|
|
53
|
+
throw new Error(`Config file "${CONFIG_FILE_NAME}" contains invalid JSON and cannot be parsed.`);
|
|
54
|
+
// Valid JSON that isn't an object can't carry an "actors" array either.
|
|
55
|
+
case 'not-an-object':
|
|
56
|
+
throw new Error(`Config file "${CONFIG_FILE_NAME}" must have an "actors" array at the top level.`);
|
|
57
|
+
default:
|
|
58
|
+
throw new Error(
|
|
59
|
+
`Config file "${CONFIG_FILE_NAME}" not found in the current directory. ` +
|
|
60
|
+
`Please create one with the required actor entries.`,
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Stage 3 — resolves one normalized entry against the repo, reading the actor's `.actor/actor.json`
|
|
67
|
+
* for its `dockerContextDir` and deciding which paths count as the actor's context.
|
|
68
|
+
*/
|
|
69
|
+
export const loadActorConfig = (entry: ResolvedActorConfig): ActorConfig => {
|
|
70
|
+
const { folder } = entry;
|
|
71
|
+
const actorJsonPath = folder ? `${folder}/.actor/actor.json` : '.actor/actor.json';
|
|
72
|
+
|
|
73
|
+
const actorJson = safeReadJsonObjectFile(actorJsonPath);
|
|
74
|
+
if (!actorJson.success) {
|
|
75
|
+
throw new Error(
|
|
76
|
+
`Cannot read "${actorJsonPath}". Every actor entry in "${CONFIG_FILE_NAME}" ` +
|
|
77
|
+
`must have a corresponding .actor/actor.json file.`,
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const actorDotDir = folder ? `${folder}/.actor` : '.actor';
|
|
82
|
+
const rawDockerContextDir =
|
|
83
|
+
typeof actorJson.contents.dockerContextDir === 'string' ? actorJson.contents.dockerContextDir : '..';
|
|
84
|
+
const resolved = path.resolve(process.cwd(), actorDotDir, rawDockerContextDir);
|
|
85
|
+
const dockerContextDir = path.relative(process.cwd(), resolved);
|
|
86
|
+
|
|
87
|
+
if (dockerContextDir.startsWith('..')) {
|
|
88
|
+
throw new Error(
|
|
89
|
+
`"dockerContextDir" for folder "${displayFolder(folder)}" resolves outside the repository root. ` +
|
|
90
|
+
`Resolved path: "${dockerContextDir}".`,
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const normalizedDockerContextDir = dockerContextDir === '.' ? '' : dockerContextDir;
|
|
95
|
+
const contextPaths = [...(entry.overrideActorContext ?? [normalizedDockerContextDir])];
|
|
96
|
+
|
|
97
|
+
// The actor's own folder is always part of its context. When an explicit "overrideActorContext"
|
|
98
|
+
// doesn't already cover it, add it automatically instead of failing the workflow.
|
|
99
|
+
if (!contextPaths.some((contextPath) => isPathWithinScope(folder, contextPath))) {
|
|
100
|
+
contextPaths.push(folder);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const overlap = findOverlappingContextPaths(contextPaths);
|
|
104
|
+
if (overlap) {
|
|
105
|
+
throw new Error(
|
|
106
|
+
`Invalid context paths for folder "${displayFolder(folder)}" in "${CONFIG_FILE_NAME}": ` +
|
|
107
|
+
`"${overlap[0]}" and "${overlap[1]}" overlap. Context paths must not be prefixes of one another.`,
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return {
|
|
112
|
+
actorFullName: entry.actorFullName,
|
|
113
|
+
folder,
|
|
114
|
+
tokenEnvVar: entry.tokenEnvVar,
|
|
115
|
+
dockerContextDir: normalizedDockerContextDir,
|
|
116
|
+
contextPaths,
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
// #endregion
|
|
121
|
+
|
|
122
|
+
export const readConfigFile = async (selection: { actors: string[]; ignore: string[] }): Promise<ActorConfig[]> => {
|
|
123
|
+
const rawFileContents = await readConfigFileContents();
|
|
124
|
+
const parsedConfigs = parseConfigFile(rawFileContents);
|
|
125
|
+
|
|
126
|
+
const actorConfigs: ActorConfig[] = [];
|
|
127
|
+
for (const parsed of parsedConfigs) {
|
|
128
|
+
// Sequential on purpose: the first actor with a problem should be the one reported.
|
|
129
|
+
actorConfigs.push(loadActorConfig(parsed));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return selectActors(selection, actorConfigs);
|
|
133
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
|
|
3
|
+
import { CONFIG_FILE_STRATEGY, type ResolvedActorConfig, type StrategyParser } from './structures/base.js';
|
|
4
|
+
import { LEGACY_PARSER } from './structures/legacy.js';
|
|
5
|
+
|
|
6
|
+
const CONFIG_FILE_STRATEGIES: {
|
|
7
|
+
// instead of Record, we do this to ensure that the modes match
|
|
8
|
+
[key in CONFIG_FILE_STRATEGY]: StrategyParser & { mode: key };
|
|
9
|
+
} = {
|
|
10
|
+
[CONFIG_FILE_STRATEGY.LEGACY]: LEGACY_PARSER,
|
|
11
|
+
} as const;
|
|
12
|
+
|
|
13
|
+
const ModeSelectionSchema = z.enum(CONFIG_FILE_STRATEGY).default(CONFIG_FILE_STRATEGY.LEGACY);
|
|
14
|
+
|
|
15
|
+
function selectStrategy(mode: unknown): StrategyParser {
|
|
16
|
+
const parsed = ModeSelectionSchema.safeParse(mode);
|
|
17
|
+
if (!parsed.success) {
|
|
18
|
+
throw new Error(z.prettifyError(parsed.error));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return CONFIG_FILE_STRATEGIES[parsed.data];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Strips a trailing slash so config-declared paths ("actors/shopify/" vs "actors/shopify") compare equal.
|
|
25
|
+
const stripTrailingSlash = (pathValue: string): string => pathValue.replace(/\/+$/, '');
|
|
26
|
+
|
|
27
|
+
// The repo root may be written as ".", "./", "/" or ""; everything downstream spells it "".
|
|
28
|
+
const normalizeFolder = (folder: string): string => {
|
|
29
|
+
const stripped = stripTrailingSlash(folder);
|
|
30
|
+
return stripped === '.' ? '' : stripped;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Normalizes the paths the user wrote and checks the cross-entry invariants a per-entry schema
|
|
35
|
+
* cannot: that no two actors claim the same folder once normalized, nor the same actor on the
|
|
36
|
+
* platform. Collects every violation before throwing, so one run reports all of them rather than
|
|
37
|
+
* only the first.
|
|
38
|
+
*
|
|
39
|
+
* @returns the actors it vouched for, with their paths normalized.
|
|
40
|
+
* @throws Error listing every problem found.
|
|
41
|
+
*/
|
|
42
|
+
function verifyConfiguration(body: ResolvedActorConfig[]): ResolvedActorConfig[] {
|
|
43
|
+
const seenFolders = new Set<string>();
|
|
44
|
+
const seenActorFullNames = new Set<string>();
|
|
45
|
+
const errors: string[] = [];
|
|
46
|
+
|
|
47
|
+
const normalized = body.map((entry) => ({
|
|
48
|
+
...entry,
|
|
49
|
+
folder: normalizeFolder(entry.folder),
|
|
50
|
+
overrideActorContext: entry.overrideActorContext?.map(stripTrailingSlash),
|
|
51
|
+
}));
|
|
52
|
+
|
|
53
|
+
for (const [index, entry] of normalized.entries()) {
|
|
54
|
+
// TODO: drop folder uniqueness (this requires several changes on other places)
|
|
55
|
+
if (seenFolders.has(entry.folder)) {
|
|
56
|
+
errors.push(`Duplicate folder "${body[index].folder}". Each actor must have a unique folder.`);
|
|
57
|
+
} else {
|
|
58
|
+
seenFolders.add(entry.folder);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (seenActorFullNames.has(entry.actorFullName)) {
|
|
62
|
+
errors.push(`Duplicate actor "${entry.actorFullName}". Each entry must point at a different actor.`);
|
|
63
|
+
} else {
|
|
64
|
+
seenActorFullNames.add(entry.actorFullName);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (errors.length > 0) {
|
|
69
|
+
throw new Error(errors.join('\n'));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return normalized;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
76
|
+
export const _privates = {
|
|
77
|
+
selectStrategy,
|
|
78
|
+
verifyConfiguration,
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export function parseConfigFile(body: Record<string, unknown>): ResolvedActorConfig[] {
|
|
82
|
+
const { mode, ...rest } = body;
|
|
83
|
+
const strategy = selectStrategy(mode);
|
|
84
|
+
|
|
85
|
+
const resolved = strategy.parse(rest);
|
|
86
|
+
const validated = verifyConfiguration(resolved);
|
|
87
|
+
return validated;
|
|
88
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { prettifyError, type ZodType } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { ACTOR_NAME, USERNAME } from '@apify/consts';
|
|
4
|
+
|
|
5
|
+
function stripRegexAnchor(regex: string): string {
|
|
6
|
+
return regex.replace(/^\^/, '').replace(/\$$/, '');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const ACTOR_FULL_NAME_REGEX = new RegExp(
|
|
10
|
+
`^${stripRegexAnchor(USERNAME.REGEX.source)}/${stripRegexAnchor(ACTOR_NAME.REGEX.source)}$`,
|
|
11
|
+
USERNAME.REGEX.flags + ACTOR_NAME.REGEX.flags,
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export interface ResolvedActorConfig {
|
|
15
|
+
actorFullName: string;
|
|
16
|
+
folder: string;
|
|
17
|
+
tokenEnvVar: string;
|
|
18
|
+
overrideActorContext?: string[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export enum CONFIG_FILE_STRATEGY {
|
|
22
|
+
LEGACY = 'legacy',
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type StrategyParser = {
|
|
26
|
+
mode: CONFIG_FILE_STRATEGY;
|
|
27
|
+
parse: (body: Record<string, unknown>) => ResolvedActorConfig[];
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export function defineStrategy<T extends Record<string, unknown>, Mode extends CONFIG_FILE_STRATEGY>(
|
|
31
|
+
// mode is transparent so it can be validated with & { mode: Mode }
|
|
32
|
+
mode: Mode,
|
|
33
|
+
schema: ZodType<T>,
|
|
34
|
+
resolve: (body: T) => ResolvedActorConfig[],
|
|
35
|
+
) {
|
|
36
|
+
return {
|
|
37
|
+
mode,
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @param body raw config file to be read
|
|
41
|
+
* @returns ResolvedActorConfig[] if the config file is valid, otherwise throws an error with a description of the issues.
|
|
42
|
+
* @throws Error if the config file is invalid.
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const strategy = defineStrategy(CONFIG_FILE_STRATEGY.LEGACY, schema, resolve);
|
|
46
|
+
* const resolvedActors = strategy.parse(configFileContents);
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* This function is used to parse the config file according to the strategy defined by the user.
|
|
50
|
+
* It uses the schema defined in the strategy to validate the config file and resolve it into a list of ResolvedActorConfig.
|
|
51
|
+
* If the config file is invalid, it throws an error with a description of the issues.
|
|
52
|
+
*/
|
|
53
|
+
parse: (body: Record<string, unknown>) => {
|
|
54
|
+
const parsed = schema.safeParse(body);
|
|
55
|
+
if (parsed.success) {
|
|
56
|
+
return resolve(parsed.data);
|
|
57
|
+
}
|
|
58
|
+
throw new Error(prettifyError(parsed.error));
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
|
|
3
|
+
import { ACTOR_FULL_NAME_REGEX, CONFIG_FILE_STRATEGY, defineStrategy } from './base.js';
|
|
4
|
+
|
|
5
|
+
const schema = z.object({
|
|
6
|
+
actors: z
|
|
7
|
+
.array(
|
|
8
|
+
z.object({
|
|
9
|
+
folder: z.string(),
|
|
10
|
+
actorFullName: z.string().regex(ACTOR_FULL_NAME_REGEX),
|
|
11
|
+
tokenEnvVar: z.string(),
|
|
12
|
+
overrideActorContext: z.array(z.string()).optional(),
|
|
13
|
+
}),
|
|
14
|
+
)
|
|
15
|
+
.min(1),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
type LegacyConfig = z.infer<typeof schema>;
|
|
19
|
+
|
|
20
|
+
export const LEGACY_PARSER = defineStrategy(CONFIG_FILE_STRATEGY.LEGACY, schema, (body: LegacyConfig) => body.actors);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { readFileSync, statSync } from 'node:fs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Why a JSON object could not be produced from a path. Callers that already have their own
|
|
5
|
+
* user-facing wording (e.g. the config file reader) switch on this instead of re-deriving the
|
|
6
|
+
* cause from an error message.
|
|
7
|
+
*/
|
|
8
|
+
export type JsonObjectReadFailureReason = 'not-a-file' | 'unreadable' | 'invalid-json' | 'not-an-object';
|
|
9
|
+
|
|
10
|
+
export type JsonObjectReadResult =
|
|
11
|
+
| { success: true; contents: Record<string, unknown> }
|
|
12
|
+
| { success: false; reason: JsonObjectReadFailureReason; failure: Error };
|
|
13
|
+
|
|
14
|
+
const failed = (reason: JsonObjectReadFailureReason, message: string): JsonObjectReadResult => ({
|
|
15
|
+
success: false,
|
|
16
|
+
reason,
|
|
17
|
+
failure: new Error(message),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Reads a file and parses it as a JSON object, reporting every way that can go wrong as a value
|
|
22
|
+
* instead of a thrown error — the caller decides which failures are fatal and how to word them.
|
|
23
|
+
*/
|
|
24
|
+
export function safeReadJsonObjectFile(path: string): JsonObjectReadResult {
|
|
25
|
+
let file: string;
|
|
26
|
+
try {
|
|
27
|
+
// `stat`, not `lstat`: a symlink must resolve to its target, matching what `readFile` does below.
|
|
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');
|
|
33
|
+
} catch {
|
|
34
|
+
return failed('unreadable', `Expected ${path} to exist or be readable`);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
let parsed: unknown;
|
|
38
|
+
try {
|
|
39
|
+
parsed = JSON.parse(file);
|
|
40
|
+
} catch (err) {
|
|
41
|
+
return failed('invalid-json', `Failed to parse ${path}: ${err}`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (parsed === null) {
|
|
45
|
+
return failed('not-an-object', `Expected ${path} to be a JSON object, not null`);
|
|
46
|
+
}
|
|
47
|
+
if (Array.isArray(parsed)) {
|
|
48
|
+
return failed('not-an-object', `Expected ${path} to be a JSON object, not an array`);
|
|
49
|
+
}
|
|
50
|
+
if (typeof parsed !== 'object') {
|
|
51
|
+
return failed('not-an-object', `Expected ${path} to be a JSON object`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return { success: true, contents: parsed as Record<string, unknown> };
|
|
55
|
+
}
|
package/bin/utils.ts
CHANGED
|
@@ -6,10 +6,6 @@ import type { ActorVersionSourceFile } from 'apify-client';
|
|
|
6
6
|
|
|
7
7
|
import { SOURCE_FILE_FORMATS } from '@apify/consts';
|
|
8
8
|
|
|
9
|
-
import { selectActors } from './actor-filtering.js';
|
|
10
|
-
import { isPathWithinScope } from './path-utils.js';
|
|
11
|
-
import type { ActorConfig, ActorConfigFile } from './types.js';
|
|
12
|
-
|
|
13
9
|
// Returns true when `childPath` is not inside `parentPath`.
|
|
14
10
|
// Used to detect monorepo actors whose dockerContextDir escapes the actor directory.
|
|
15
11
|
export const isOutsideDir = (childPath: string, parentPath: string): boolean =>
|
|
@@ -95,140 +91,6 @@ export const getEnvVar = (varName: string, defaultValue?: string): string => {
|
|
|
95
91
|
return value;
|
|
96
92
|
};
|
|
97
93
|
|
|
98
|
-
export const CONFIG_FILE_NAME = 'apify-test-tools.config.json';
|
|
99
|
-
|
|
100
|
-
// Strips a trailing slash so config-declared paths ("actors/shopify/" vs "actors/shopify") compare equal.
|
|
101
|
-
const stripTrailingSlash = (pathValue: string): string => pathValue.replace(/\/+$/, '');
|
|
102
|
-
|
|
103
|
-
const findOverlappingContextPaths = (contextPaths: string[]): [string, string] | undefined => {
|
|
104
|
-
for (let i = 0; i < contextPaths.length; i++) {
|
|
105
|
-
for (let j = i + 1; j < contextPaths.length; j++) {
|
|
106
|
-
if (
|
|
107
|
-
isPathWithinScope(contextPaths[i], contextPaths[j]) ||
|
|
108
|
-
isPathWithinScope(contextPaths[j], contextPaths[i])
|
|
109
|
-
) {
|
|
110
|
-
return [contextPaths[i], contextPaths[j]];
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return undefined;
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export const readConfigFile = async (selection: { actors: string[]; ignore: string[] }): Promise<ActorConfig[]> => {
|
|
118
|
-
let raw: string;
|
|
119
|
-
try {
|
|
120
|
-
raw = await fs.readFile(CONFIG_FILE_NAME, 'utf-8');
|
|
121
|
-
} catch {
|
|
122
|
-
throw new Error(
|
|
123
|
-
`Config file "${CONFIG_FILE_NAME}" not found in the current directory. ` +
|
|
124
|
-
`Please create one with the required actor entries.`,
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
let config: ActorConfigFile;
|
|
129
|
-
try {
|
|
130
|
-
config = JSON.parse(raw);
|
|
131
|
-
} catch {
|
|
132
|
-
throw new Error(`Config file "${CONFIG_FILE_NAME}" contains invalid JSON.`);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (!Array.isArray(config.actors)) {
|
|
136
|
-
throw new Error(`Config file "${CONFIG_FILE_NAME}" must have an "actors" array at the top level.`);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const seenFolders = new Set<string>();
|
|
140
|
-
const actorConfigs: ActorConfig[] = [];
|
|
141
|
-
|
|
142
|
-
for (const [index, entry] of config.actors.entries()) {
|
|
143
|
-
if (typeof entry.folder !== 'string') {
|
|
144
|
-
throw new Error(
|
|
145
|
-
`Invalid "folder" for actor entry at index ${index} in "${CONFIG_FILE_NAME}". ` +
|
|
146
|
-
`Must be a string (use "." for a single-actor repo).`,
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const folder = entry.folder === '.' ? '' : stripTrailingSlash(entry.folder);
|
|
151
|
-
|
|
152
|
-
if (seenFolders.has(folder)) {
|
|
153
|
-
throw new Error(
|
|
154
|
-
`Duplicate folder "${entry.folder}" in "${CONFIG_FILE_NAME}". Each actor must have a unique folder.`,
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
seenFolders.add(folder);
|
|
158
|
-
|
|
159
|
-
const nameParts = entry.actorFullName?.split('/');
|
|
160
|
-
if (!nameParts || nameParts.length !== 2 || !nameParts[0] || !nameParts[1]) {
|
|
161
|
-
throw new Error(
|
|
162
|
-
`Invalid "actorFullName" for folder "${entry.folder}" in "${CONFIG_FILE_NAME}". ` +
|
|
163
|
-
`Must be in "owner/name" format (e.g. "apify/web-scraper").`,
|
|
164
|
-
);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
if (entry.overrideActorContext !== undefined) {
|
|
168
|
-
if (
|
|
169
|
-
!Array.isArray(entry.overrideActorContext) ||
|
|
170
|
-
!entry.overrideActorContext.every((p) => typeof p === 'string')
|
|
171
|
-
) {
|
|
172
|
-
throw new Error(
|
|
173
|
-
`Invalid "overrideActorContext" for folder "${entry.folder}" in "${CONFIG_FILE_NAME}". ` +
|
|
174
|
-
`Must be an array of strings.`,
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
const actorJsonPath = folder ? `${folder}/.actor/actor.json` : '.actor/actor.json';
|
|
180
|
-
|
|
181
|
-
let actorJson: { dockerContextDir?: string };
|
|
182
|
-
try {
|
|
183
|
-
actorJson = JSON.parse(await fs.readFile(actorJsonPath, 'utf-8'));
|
|
184
|
-
} catch {
|
|
185
|
-
throw new Error(
|
|
186
|
-
`Cannot read "${actorJsonPath}". Every actor entry in "${CONFIG_FILE_NAME}" ` +
|
|
187
|
-
`must have a corresponding .actor/actor.json file.`,
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
const actorDotDir = folder ? `${folder}/.actor` : '.actor';
|
|
192
|
-
const rawDockerContextDir = actorJson.dockerContextDir ?? '..';
|
|
193
|
-
const resolved = path.resolve(process.cwd(), actorDotDir, rawDockerContextDir);
|
|
194
|
-
const dockerContextDir = path.relative(process.cwd(), resolved);
|
|
195
|
-
|
|
196
|
-
if (dockerContextDir.startsWith('..')) {
|
|
197
|
-
throw new Error(
|
|
198
|
-
`"dockerContextDir" for folder "${entry.folder}" resolves outside the repository root. ` +
|
|
199
|
-
`Resolved path: "${dockerContextDir}".`,
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
const normalizedDockerContextDir = dockerContextDir === '.' ? '' : dockerContextDir;
|
|
204
|
-
const contextPaths = (entry.overrideActorContext ?? [normalizedDockerContextDir]).map(stripTrailingSlash);
|
|
205
|
-
|
|
206
|
-
// The actor's own folder is always part of its context. When an explicit "overrideActorContext"
|
|
207
|
-
// doesn't already cover it, add it automatically instead of failing the workflow.
|
|
208
|
-
if (!contextPaths.some((contextPath) => isPathWithinScope(folder, contextPath))) {
|
|
209
|
-
contextPaths.push(folder);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
const overlap = findOverlappingContextPaths(contextPaths);
|
|
213
|
-
if (overlap) {
|
|
214
|
-
throw new Error(
|
|
215
|
-
`Invalid context paths for folder "${entry.folder}" in "${CONFIG_FILE_NAME}": ` +
|
|
216
|
-
`"${overlap[0]}" and "${overlap[1]}" overlap. Context paths must not be prefixes of one another.`,
|
|
217
|
-
);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
actorConfigs.push({
|
|
221
|
-
actorFullName: entry.actorFullName,
|
|
222
|
-
folder,
|
|
223
|
-
tokenEnvVar: entry.tokenEnvVar,
|
|
224
|
-
dockerContextDir: normalizedDockerContextDir,
|
|
225
|
-
contextPaths,
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
return selectActors(selection, actorConfigs);
|
|
230
|
-
};
|
|
231
|
-
|
|
232
94
|
export const setCwd = ({ workspace }: { workspace: string | undefined }) => {
|
|
233
95
|
if (workspace) {
|
|
234
96
|
process.chdir(workspace);
|
package/dist/bin/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../bin/main.ts"],"names":[],"mappings":";AAIA,OAAc,EAAE,KAAK,IAAI,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../bin/main.ts"],"names":[],"mappings":";AAIA,OAAc,EAAE,KAAK,IAAI,EAAE,MAAM,OAAO,CAAC;AAoBzC,eAAO,MAAM,YAAY,GAAI,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;;;;;;;;EAkBzC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;;;;EAYlD,CAAC"}
|
package/dist/bin/main.js
CHANGED
|
@@ -10,7 +10,8 @@ import { getBranchOnlyChangedFiles, getChangedFiles, getCommits, hasMergeFromTar
|
|
|
10
10
|
import { getPushData } from './github.js';
|
|
11
11
|
import { notifyToSlack } from './slack.js';
|
|
12
12
|
import { reportTestResults } from './test-report.js';
|
|
13
|
-
import {
|
|
13
|
+
import { setCwd, spawnCommandInGhWorkspace } from './utils.js';
|
|
14
|
+
import { readConfigFile } from './utils/config/load-config.js';
|
|
14
15
|
/**
|
|
15
16
|
* Middlewares to be run before every command execution
|
|
16
17
|
*/
|
package/dist/bin/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../bin/main.ts"],"names":[],"mappings":";AAEA,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,gFAAgF;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACtG,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,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C"}
|
package/dist/bin/types.d.ts
CHANGED
|
@@ -76,15 +76,6 @@ export interface GithubCommit {
|
|
|
76
76
|
removed: string[];
|
|
77
77
|
modified: string[];
|
|
78
78
|
}
|
|
79
|
-
export interface ActorConfigFileEntry {
|
|
80
|
-
folder: string;
|
|
81
|
-
actorFullName: string;
|
|
82
|
-
tokenEnvVar: string;
|
|
83
|
-
overrideActorContext?: string[];
|
|
84
|
-
}
|
|
85
|
-
export interface ActorConfigFile {
|
|
86
|
-
actors: ActorConfigFileEntry[];
|
|
87
|
-
}
|
|
88
79
|
export interface BuildData {
|
|
89
80
|
buildId: string;
|
|
90
81
|
actorRawId: string;
|
package/dist/bin/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../bin/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,MAAM,MAAM,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAGF,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IACvB,SAAS,EAAE,MAAM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