apify-test-tools 0.6.4-beta.2 → 0.7.0
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/CHANGELOG.md +5 -3
- package/bin/git.ts +45 -5
- package/bin/main.ts +52 -22
- package/dist/bin/git.d.ts +11 -0
- package/dist/bin/git.d.ts.map +1 -1
- package/dist/bin/git.js +37 -3
- package/dist/bin/git.js.map +1 -1
- package/dist/bin/main.js +35 -22
- package/dist/bin/main.js.map +1 -1
- package/dist/test/unit/bin/git.test.js +68 -1
- package/dist/test/unit/bin/git.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +61 -61
- package/test/unit/bin/git.test.ts +87 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
## 0.6.4 - **not yet released**
|
|
5
|
+
## [0.7.0](https://github.com/apify/apify-test-tools/releases/tag/v0.7.0) (2026-04-10)
|
|
7
6
|
|
|
8
7
|
### 🚀 Features
|
|
9
8
|
|
|
@@ -13,8 +12,11 @@ All notable changes to this project will be documented in this file.
|
|
|
13
12
|
|
|
14
13
|
- Standby tests ([#76](https://github.com/apify/apify-test-tools/pull/76)) ([33cd89c](https://github.com/apify/apify-test-tools/commit/33cd89cf9e512f422704eeb8f6c46e4e2759a902)) by [@oklinov](https://github.com/oklinov)
|
|
15
14
|
|
|
15
|
+
### ⚡ Performance
|
|
16
|
+
|
|
17
|
+
- **bin:** Don't test if we merge master into cosmetic only changes ([#78](https://github.com/apify/apify-test-tools/pull/78)) ([bc899eb](https://github.com/apify/apify-test-tools/commit/bc899eb550283862fbdc3c44a4fca6f682017c43)) by [@metalwarrior665](https://github.com/metalwarrior665)
|
|
18
|
+
|
|
16
19
|
|
|
17
|
-
<!-- git-cliff-unreleased-end -->
|
|
18
20
|
## [0.6.3](https://github.com/apify/apify-test-tools/releases/tag/v0.6.3) (2026-04-06)
|
|
19
21
|
|
|
20
22
|
### 🐛 Bug Fixes
|
package/bin/git.ts
CHANGED
|
@@ -17,6 +17,41 @@ export const getChangedFiles = (commits: Commit[]) => {
|
|
|
17
17
|
return changedFiles;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Returns true if the branch contains a merge commit whose parent is reachable from targetBranch
|
|
22
|
+
* (i.e. a genuine "merge from target" commit, not a merge of some unrelated branch).
|
|
23
|
+
* Uses the full targetBranch..sourceBranch range, ignoring baseCommit.
|
|
24
|
+
*/
|
|
25
|
+
export const hasMergeFromTarget = (sourceBranch: string, targetBranch: string): boolean => {
|
|
26
|
+
const mergeShas = spawnCommandInGhWorkspace(`git log --merges --pretty=format:%H ${targetBranch}..${sourceBranch}`)
|
|
27
|
+
.split('\n')
|
|
28
|
+
.filter(Boolean);
|
|
29
|
+
|
|
30
|
+
for (const sha of mergeShas) {
|
|
31
|
+
const parents = spawnCommandInGhWorkspace(`git log -1 --pretty=format:%P ${sha}`).trim().split(' ');
|
|
32
|
+
for (const parent of parents) {
|
|
33
|
+
// git merge-base A B outputs the common ancestor.
|
|
34
|
+
// If that equals A, then A is an ancestor of B (i.e. parent is reachable from targetBranch).
|
|
35
|
+
const mergeBase = spawnCommandInGhWorkspace(`git merge-base ${parent} ${targetBranch}`);
|
|
36
|
+
if (mergeBase === parent) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Returns all files touched by non-merge commits on the branch (full history, ignoring baseCommit).
|
|
46
|
+
* Used to check whether the branch itself has any functional changes, independent of what master merged in.
|
|
47
|
+
*/
|
|
48
|
+
export const getBranchOnlyChangedFiles = (sourceBranch: string, targetBranch: string): string[] => {
|
|
49
|
+
const output = spawnCommandInGhWorkspace(
|
|
50
|
+
`git log --no-merges --name-only --pretty=format: ${targetBranch}..${sourceBranch}`,
|
|
51
|
+
);
|
|
52
|
+
return output.split('\n').filter(Boolean);
|
|
53
|
+
};
|
|
54
|
+
|
|
20
55
|
const SHA_REGEX = /^[0-9a-f]{40}$/i;
|
|
21
56
|
|
|
22
57
|
/**
|
|
@@ -40,17 +75,22 @@ export const parseBaseCommit = (shaOrCommit: string | undefined): string | undef
|
|
|
40
75
|
return sha;
|
|
41
76
|
};
|
|
42
77
|
|
|
78
|
+
const fetchAllBranchCommits = (sourceBranch: string, targetBranch: string): Commit[] => {
|
|
79
|
+
const commitsStrings = spawnCommandInGhWorkspace(
|
|
80
|
+
`git log --pretty=format:'${GIT_LOG_FORMAT}' ${targetBranch}..${sourceBranch}`,
|
|
81
|
+
).split('\n');
|
|
82
|
+
const commits = commitsStrings.map((commitString) => parseCommit(commitString));
|
|
83
|
+
commits.reverse();
|
|
84
|
+
return commits;
|
|
85
|
+
};
|
|
86
|
+
|
|
43
87
|
/**
|
|
44
88
|
* Gets the commits between sourceBranch and targetBranch (exclusive).
|
|
45
89
|
* - If baseCommit is provided, only returns commits after the baseCommit.
|
|
46
90
|
*/
|
|
47
91
|
export const getCommits = ({ sourceBranch, targetBranch, baseCommit }: Config): Commit[] => {
|
|
48
92
|
const baseCommitSha = parseBaseCommit(baseCommit);
|
|
49
|
-
const
|
|
50
|
-
`git log --pretty=format:'${GIT_LOG_FORMAT}' ${targetBranch}..${sourceBranch}`,
|
|
51
|
-
).split('\n');
|
|
52
|
-
const commits = commitsStrings.map((commitString) => parseCommit(commitString));
|
|
53
|
-
commits.reverse();
|
|
93
|
+
const commits = fetchAllBranchCommits(sourceBranch, targetBranch);
|
|
54
94
|
|
|
55
95
|
const baseCommitIndex = commits.findIndex((commit) => commit.sha === baseCommitSha);
|
|
56
96
|
|
package/bin/main.ts
CHANGED
|
@@ -8,10 +8,11 @@ import { hideBin } from 'yargs/helpers';
|
|
|
8
8
|
|
|
9
9
|
import { deleteOldBuilds, runBuilds } from './build.js';
|
|
10
10
|
import { getChangedActors } from './diff-changes.js';
|
|
11
|
-
import { getChangedFiles, getCommits } from './git.js';
|
|
11
|
+
import { getBranchOnlyChangedFiles, getChangedFiles, getCommits, hasMergeFromTarget } from './git.js';
|
|
12
12
|
import { getPushData } from './github.js';
|
|
13
13
|
import { notifyToSlack } from './slack.js';
|
|
14
14
|
import { reportTestResults } from './test-report.js';
|
|
15
|
+
import type { Config } from './types.js';
|
|
15
16
|
import { getRepoActors, setCwd, spawnCommandInGhWorkspace } from './utils.js';
|
|
16
17
|
|
|
17
18
|
/**
|
|
@@ -34,6 +35,44 @@ const buildOptions = (y: Argv) => {
|
|
|
34
35
|
});
|
|
35
36
|
};
|
|
36
37
|
|
|
38
|
+
const resolveChangedActors = async (
|
|
39
|
+
{ targetBranch, sourceBranch, baseCommit }: Config,
|
|
40
|
+
{ isLatest }: { isLatest: boolean },
|
|
41
|
+
) => {
|
|
42
|
+
const actorConfigs = await getRepoActors();
|
|
43
|
+
|
|
44
|
+
// This is an optimization for the common case where a branch only has cosmetic changes but had to merge in
|
|
45
|
+
// functional changes from master (being up-to-date is a CI requirement). Master is already validated, and
|
|
46
|
+
// since the branch has no functional changes of its own, there is nothing new to validate.
|
|
47
|
+
// Exception: if the branch has any functional changes alongside the merge, we must re-test — even
|
|
48
|
+
// individually validated changes can have novel interactions when combined.
|
|
49
|
+
if (hasMergeFromTarget(sourceBranch, targetBranch)) {
|
|
50
|
+
console.error(
|
|
51
|
+
'[MERGE-FROM-TARGET-OPTIMIZATION]: There is merge from target branch, checking if there are no functional changes in our own branch. If so, we can skip tests',
|
|
52
|
+
);
|
|
53
|
+
const branchOnlyFiles = getBranchOnlyChangedFiles(sourceBranch, targetBranch);
|
|
54
|
+
// Omit baseCommit to get full branch history. Validated functional commits can still interact with merged ones
|
|
55
|
+
const allBranchCommits = getCommits({ sourceBranch, targetBranch, baseCommit: undefined });
|
|
56
|
+
const branchOnlyActorsChanged = getChangedActors({
|
|
57
|
+
filepathsChanged: branchOnlyFiles,
|
|
58
|
+
actorConfigs,
|
|
59
|
+
commits: allBranchCommits,
|
|
60
|
+
});
|
|
61
|
+
if (branchOnlyActorsChanged.length === 0) {
|
|
62
|
+
console.error('[MERGE-FROM-TARGET-OPTIMIZATION]: Branch itself has no functional changes, skipping tests');
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
console.error(
|
|
66
|
+
`[MERGE-FROM-TARGET-OPTIMIZATION]: Branch has ${branchOnlyActorsChanged.length} functional changes, cannot optimize, we continue with full check`,
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// If the optimization doesn't apply, we check all branch commits including merges for full coverage. We don't reuse the merge optimization results because here we can apply baseCommit and check merge commits (they might be functional or just cosmetic)
|
|
71
|
+
const commits = getCommits({ targetBranch, sourceBranch, baseCommit });
|
|
72
|
+
const changedFiles = getChangedFiles(commits);
|
|
73
|
+
return getChangedActors({ filepathsChanged: changedFiles, actorConfigs, isLatest, commits });
|
|
74
|
+
};
|
|
75
|
+
|
|
37
76
|
await yargs()
|
|
38
77
|
.scriptName('public-actors-utils')
|
|
39
78
|
.option('dry-run', {
|
|
@@ -68,16 +107,11 @@ await yargs()
|
|
|
68
107
|
console.log(JSON.stringify(actorConfigs));
|
|
69
108
|
},
|
|
70
109
|
)
|
|
71
|
-
.command('get-affected-actors', '', buildOptions, async (
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
filepathsChanged: changedFiles,
|
|
77
|
-
actorConfigs,
|
|
78
|
-
isLatest: false,
|
|
79
|
-
commits,
|
|
80
|
-
});
|
|
110
|
+
.command('get-affected-actors', '', buildOptions, async ({ targetBranch, sourceBranch, baseCommit }) => {
|
|
111
|
+
const actorsChanged = await resolveChangedActors(
|
|
112
|
+
{ targetBranch, sourceBranch, baseCommit },
|
|
113
|
+
{ isLatest: false },
|
|
114
|
+
);
|
|
81
115
|
console.log(JSON.stringify(actorsChanged));
|
|
82
116
|
})
|
|
83
117
|
.command(
|
|
@@ -97,15 +131,11 @@ await yargs()
|
|
|
97
131
|
'build',
|
|
98
132
|
'',
|
|
99
133
|
(args) => buildOptions(args).option('dry-run', { type: 'boolean', default: false }),
|
|
100
|
-
async (
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
filepathsChanged: changedFiles,
|
|
106
|
-
actorConfigs,
|
|
107
|
-
commits,
|
|
108
|
-
});
|
|
134
|
+
async ({ targetBranch, sourceBranch, baseCommit, dryRun }) => {
|
|
135
|
+
const actorsChanged = await resolveChangedActors(
|
|
136
|
+
{ targetBranch, sourceBranch, baseCommit },
|
|
137
|
+
{ isLatest: false },
|
|
138
|
+
);
|
|
109
139
|
// https://github.com/apify-store/google-maps#:actors/lukaskrivka_google-maps-with-contact-details
|
|
110
140
|
// git@github.com:apify-store/google-maps#:actors/lukaskrivka_google-maps-with-contact-details
|
|
111
141
|
const repoUrl = spawnCommandInGhWorkspace(`git remote get-url origin`).replace(
|
|
@@ -116,8 +146,8 @@ await yargs()
|
|
|
116
146
|
const builds = await runBuilds({
|
|
117
147
|
repoUrl,
|
|
118
148
|
actorConfigs: actorsChanged,
|
|
119
|
-
branch:
|
|
120
|
-
dryRun
|
|
149
|
+
branch: sourceBranch.replace('origin/', ''),
|
|
150
|
+
dryRun,
|
|
121
151
|
});
|
|
122
152
|
console.log(JSON.stringify(builds));
|
|
123
153
|
},
|
package/dist/bin/git.d.ts
CHANGED
|
@@ -4,6 +4,17 @@ export declare const GIT_FORMAT_SEPARATOR = "\u00BB\u00A6\u00AB";
|
|
|
4
4
|
* Gets the list of changed files between the given commits (inclusive).
|
|
5
5
|
*/
|
|
6
6
|
export declare const getChangedFiles: (commits: Commit[]) => string[];
|
|
7
|
+
/**
|
|
8
|
+
* Returns true if the branch contains a merge commit whose parent is reachable from targetBranch
|
|
9
|
+
* (i.e. a genuine "merge from target" commit, not a merge of some unrelated branch).
|
|
10
|
+
* Uses the full targetBranch..sourceBranch range, ignoring baseCommit.
|
|
11
|
+
*/
|
|
12
|
+
export declare const hasMergeFromTarget: (sourceBranch: string, targetBranch: string) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Returns all files touched by non-merge commits on the branch (full history, ignoring baseCommit).
|
|
15
|
+
* Used to check whether the branch itself has any functional changes, independent of what master merged in.
|
|
16
|
+
*/
|
|
17
|
+
export declare const getBranchOnlyChangedFiles: (sourceBranch: string, targetBranch: string) => string[];
|
|
7
18
|
/**
|
|
8
19
|
*
|
|
9
20
|
* @param shaOrCommit Supports both a SHA string or a Commit object in JSON format. Can be empty.
|
package/dist/bin/git.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../bin/git.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGjD,eAAO,MAAM,oBAAoB,uBAAQ,CAAC;AAG1C;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,EAAE,aAQhD,CAAC;AAIF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,aAAa,MAAM,GAAG,SAAS,KAAG,MAAM,GAAG,SAc1E,CAAC;
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../bin/git.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGjD,eAAO,MAAM,oBAAoB,uBAAQ,CAAC;AAG1C;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,EAAE,aAQhD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,cAAc,MAAM,EAAE,cAAc,MAAM,KAAG,OAiB/E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,GAAI,cAAc,MAAM,EAAE,cAAc,MAAM,KAAG,MAAM,EAK5F,CAAC;AAIF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,aAAa,MAAM,GAAG,SAAS,KAAG,MAAM,GAAG,SAc1E,CAAC;AAWF;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,4CAA4C,MAAM,KAAG,MAAM,EAqBrF,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,cAAc,MAAM,KAAG,MAYlD,CAAC"}
|
package/dist/bin/git.js
CHANGED
|
@@ -10,6 +10,36 @@ export const getChangedFiles = (commits) => {
|
|
|
10
10
|
console.error(`Changed files (up to 50): ${changedFiles.slice(0, 50).join(', ')}`);
|
|
11
11
|
return changedFiles;
|
|
12
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* Returns true if the branch contains a merge commit whose parent is reachable from targetBranch
|
|
15
|
+
* (i.e. a genuine "merge from target" commit, not a merge of some unrelated branch).
|
|
16
|
+
* Uses the full targetBranch..sourceBranch range, ignoring baseCommit.
|
|
17
|
+
*/
|
|
18
|
+
export const hasMergeFromTarget = (sourceBranch, targetBranch) => {
|
|
19
|
+
const mergeShas = spawnCommandInGhWorkspace(`git log --merges --pretty=format:%H ${targetBranch}..${sourceBranch}`)
|
|
20
|
+
.split('\n')
|
|
21
|
+
.filter(Boolean);
|
|
22
|
+
for (const sha of mergeShas) {
|
|
23
|
+
const parents = spawnCommandInGhWorkspace(`git log -1 --pretty=format:%P ${sha}`).trim().split(' ');
|
|
24
|
+
for (const parent of parents) {
|
|
25
|
+
// git merge-base A B outputs the common ancestor.
|
|
26
|
+
// If that equals A, then A is an ancestor of B (i.e. parent is reachable from targetBranch).
|
|
27
|
+
const mergeBase = spawnCommandInGhWorkspace(`git merge-base ${parent} ${targetBranch}`);
|
|
28
|
+
if (mergeBase === parent) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Returns all files touched by non-merge commits on the branch (full history, ignoring baseCommit).
|
|
37
|
+
* Used to check whether the branch itself has any functional changes, independent of what master merged in.
|
|
38
|
+
*/
|
|
39
|
+
export const getBranchOnlyChangedFiles = (sourceBranch, targetBranch) => {
|
|
40
|
+
const output = spawnCommandInGhWorkspace(`git log --no-merges --name-only --pretty=format: ${targetBranch}..${sourceBranch}`);
|
|
41
|
+
return output.split('\n').filter(Boolean);
|
|
42
|
+
};
|
|
13
43
|
const SHA_REGEX = /^[0-9a-f]{40}$/i;
|
|
14
44
|
/**
|
|
15
45
|
*
|
|
@@ -31,15 +61,19 @@ export const parseBaseCommit = (shaOrCommit) => {
|
|
|
31
61
|
}
|
|
32
62
|
return sha;
|
|
33
63
|
};
|
|
64
|
+
const fetchAllBranchCommits = (sourceBranch, targetBranch) => {
|
|
65
|
+
const commitsStrings = spawnCommandInGhWorkspace(`git log --pretty=format:'${GIT_LOG_FORMAT}' ${targetBranch}..${sourceBranch}`).split('\n');
|
|
66
|
+
const commits = commitsStrings.map((commitString) => parseCommit(commitString));
|
|
67
|
+
commits.reverse();
|
|
68
|
+
return commits;
|
|
69
|
+
};
|
|
34
70
|
/**
|
|
35
71
|
* Gets the commits between sourceBranch and targetBranch (exclusive).
|
|
36
72
|
* - If baseCommit is provided, only returns commits after the baseCommit.
|
|
37
73
|
*/
|
|
38
74
|
export const getCommits = ({ sourceBranch, targetBranch, baseCommit }) => {
|
|
39
75
|
const baseCommitSha = parseBaseCommit(baseCommit);
|
|
40
|
-
const
|
|
41
|
-
const commits = commitsStrings.map((commitString) => parseCommit(commitString));
|
|
42
|
-
commits.reverse();
|
|
76
|
+
const commits = fetchAllBranchCommits(sourceBranch, targetBranch);
|
|
43
77
|
const baseCommitIndex = commits.findIndex((commit) => commit.sha === baseCommitSha);
|
|
44
78
|
const hasBaseCommit = baseCommitIndex !== -1;
|
|
45
79
|
if (hasBaseCommit) {
|
package/dist/bin/git.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version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CACT,eAAe,aAAa,iDAAiD,OAAO,CAAC,MAAM,UAAU,CACxG,CAAC;IACF,OAAO,CAAC,KAAK,CAAC,2BAA2B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjF,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,YAAoB,EAAU,EAAE;IACxD,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,kCAAkC,YAAY,EAAE,CAAC,CAAC;IACtE,CAAC;IACD,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IAC5C,OAAO;QACH,GAAG;QACH,MAAM;QACN,IAAI;QACJ,OAAO;KACV,CAAC;AACN,CAAC,CAAC"}
|
package/dist/bin/main.js
CHANGED
|
@@ -5,7 +5,7 @@ import yargs from 'yargs';
|
|
|
5
5
|
import { hideBin } from 'yargs/helpers';
|
|
6
6
|
import { deleteOldBuilds, runBuilds } from './build.js';
|
|
7
7
|
import { getChangedActors } from './diff-changes.js';
|
|
8
|
-
import { getChangedFiles, getCommits } from './git.js';
|
|
8
|
+
import { getBranchOnlyChangedFiles, getChangedFiles, getCommits, hasMergeFromTarget } from './git.js';
|
|
9
9
|
import { getPushData } from './github.js';
|
|
10
10
|
import { notifyToSlack } from './slack.js';
|
|
11
11
|
import { reportTestResults } from './test-report.js';
|
|
@@ -28,6 +28,34 @@ const buildOptions = (y) => {
|
|
|
28
28
|
type: 'string',
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
|
+
const resolveChangedActors = async ({ targetBranch, sourceBranch, baseCommit }, { isLatest }) => {
|
|
32
|
+
const actorConfigs = await getRepoActors();
|
|
33
|
+
// This is an optimization for the common case where a branch only has cosmetic changes but had to merge in
|
|
34
|
+
// functional changes from master (being up-to-date is a CI requirement). Master is already validated, and
|
|
35
|
+
// since the branch has no functional changes of its own, there is nothing new to validate.
|
|
36
|
+
// Exception: if the branch has any functional changes alongside the merge, we must re-test — even
|
|
37
|
+
// individually validated changes can have novel interactions when combined.
|
|
38
|
+
if (hasMergeFromTarget(sourceBranch, targetBranch)) {
|
|
39
|
+
console.error('[MERGE-FROM-TARGET-OPTIMIZATION]: There is merge from target branch, checking if there are no functional changes in our own branch. If so, we can skip tests');
|
|
40
|
+
const branchOnlyFiles = getBranchOnlyChangedFiles(sourceBranch, targetBranch);
|
|
41
|
+
// Omit baseCommit to get full branch history. Validated functional commits can still interact with merged ones
|
|
42
|
+
const allBranchCommits = getCommits({ sourceBranch, targetBranch, baseCommit: undefined });
|
|
43
|
+
const branchOnlyActorsChanged = getChangedActors({
|
|
44
|
+
filepathsChanged: branchOnlyFiles,
|
|
45
|
+
actorConfigs,
|
|
46
|
+
commits: allBranchCommits,
|
|
47
|
+
});
|
|
48
|
+
if (branchOnlyActorsChanged.length === 0) {
|
|
49
|
+
console.error('[MERGE-FROM-TARGET-OPTIMIZATION]: Branch itself has no functional changes, skipping tests');
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
console.error(`[MERGE-FROM-TARGET-OPTIMIZATION]: Branch has ${branchOnlyActorsChanged.length} functional changes, cannot optimize, we continue with full check`);
|
|
53
|
+
}
|
|
54
|
+
// If the optimization doesn't apply, we check all branch commits including merges for full coverage. We don't reuse the merge optimization results because here we can apply baseCommit and check merge commits (they might be functional or just cosmetic)
|
|
55
|
+
const commits = getCommits({ targetBranch, sourceBranch, baseCommit });
|
|
56
|
+
const changedFiles = getChangedFiles(commits);
|
|
57
|
+
return getChangedActors({ filepathsChanged: changedFiles, actorConfigs, isLatest, commits });
|
|
58
|
+
};
|
|
31
59
|
await yargs()
|
|
32
60
|
.scriptName('public-actors-utils')
|
|
33
61
|
.option('dry-run', {
|
|
@@ -57,16 +85,8 @@ await yargs()
|
|
|
57
85
|
const actorConfigs = await getRepoActors();
|
|
58
86
|
console.log(JSON.stringify(actorConfigs));
|
|
59
87
|
})
|
|
60
|
-
.command('get-affected-actors', '', buildOptions, async (
|
|
61
|
-
const
|
|
62
|
-
const changedFiles = getChangedFiles(commits);
|
|
63
|
-
const actorConfigs = await getRepoActors();
|
|
64
|
-
const actorsChanged = getChangedActors({
|
|
65
|
-
filepathsChanged: changedFiles,
|
|
66
|
-
actorConfigs,
|
|
67
|
-
isLatest: false,
|
|
68
|
-
commits,
|
|
69
|
-
});
|
|
88
|
+
.command('get-affected-actors', '', buildOptions, async ({ targetBranch, sourceBranch, baseCommit }) => {
|
|
89
|
+
const actorsChanged = await resolveChangedActors({ targetBranch, sourceBranch, baseCommit }, { isLatest: false });
|
|
70
90
|
console.log(JSON.stringify(actorsChanged));
|
|
71
91
|
})
|
|
72
92
|
.command('report-tests', '', (args) => args
|
|
@@ -76,23 +96,16 @@ await yargs()
|
|
|
76
96
|
.option('workflow-name', { type: 'string' }), async (args) => {
|
|
77
97
|
await reportTestResults(args);
|
|
78
98
|
})
|
|
79
|
-
.command('build', '', (args) => buildOptions(args).option('dry-run', { type: 'boolean', default: false }), async (
|
|
80
|
-
const
|
|
81
|
-
const changedFiles = getChangedFiles(commits);
|
|
82
|
-
const actorConfigs = await getRepoActors();
|
|
83
|
-
const actorsChanged = getChangedActors({
|
|
84
|
-
filepathsChanged: changedFiles,
|
|
85
|
-
actorConfigs,
|
|
86
|
-
commits,
|
|
87
|
-
});
|
|
99
|
+
.command('build', '', (args) => buildOptions(args).option('dry-run', { type: 'boolean', default: false }), async ({ targetBranch, sourceBranch, baseCommit, dryRun }) => {
|
|
100
|
+
const actorsChanged = await resolveChangedActors({ targetBranch, sourceBranch, baseCommit }, { isLatest: false });
|
|
88
101
|
// https://github.com/apify-store/google-maps#:actors/lukaskrivka_google-maps-with-contact-details
|
|
89
102
|
// git@github.com:apify-store/google-maps#:actors/lukaskrivka_google-maps-with-contact-details
|
|
90
103
|
const repoUrl = spawnCommandInGhWorkspace(`git remote get-url origin`).replace(/^https:\/\/github\.com\//, 'git@github.com:');
|
|
91
104
|
const builds = await runBuilds({
|
|
92
105
|
repoUrl,
|
|
93
106
|
actorConfigs: actorsChanged,
|
|
94
|
-
branch:
|
|
95
|
-
dryRun
|
|
107
|
+
branch: sourceBranch.replace('origin/', ''),
|
|
108
|
+
dryRun,
|
|
96
109
|
});
|
|
97
110
|
console.log(JSON.stringify(builds));
|
|
98
111
|
})
|
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,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
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,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,UAAU,C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Aa,EAAE,CAAC;IAC3C,MAAM,eAAe,CAAC,YAAY,CAAC,CAAC;AACxC,CAAC,CACJ;KACA,cAAc,EAAE;KAChB,aAAa,CAAC,CAAC,EAAE,qBAAqB,CAAC;KACvC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
-
import { getChangedFiles, getCommits, parseBaseCommit } from '../../../bin/git.js';
|
|
2
|
+
import { getBranchOnlyChangedFiles, getChangedFiles, getCommits, hasMergeFromTarget, parseBaseCommit, } from '../../../bin/git.js';
|
|
3
3
|
import * as Utils from '../../../bin/utils.js';
|
|
4
4
|
describe('getCommits', () => {
|
|
5
5
|
const sourceBranch = 'feature-branch';
|
|
@@ -84,6 +84,73 @@ describe('getChangedFiles', () => {
|
|
|
84
84
|
expect(gitCommandSpy).toHaveBeenCalledWith(`git diff --name-only ${onlySha}~..${onlySha}`);
|
|
85
85
|
});
|
|
86
86
|
});
|
|
87
|
+
describe('hasMergeFromTarget', () => {
|
|
88
|
+
const sourceBranch = 'feature-branch';
|
|
89
|
+
const targetBranch = 'main';
|
|
90
|
+
const mergeSha = 'f'.repeat(40);
|
|
91
|
+
const branchParentSha = 'b'.repeat(40);
|
|
92
|
+
const targetParentSha = 't'.repeat(40);
|
|
93
|
+
let gitCommandSpy;
|
|
94
|
+
beforeEach(() => {
|
|
95
|
+
gitCommandSpy = vi.spyOn(Utils, 'spawnCommandInGhWorkspace');
|
|
96
|
+
});
|
|
97
|
+
it('should return false when there are no merge commits on the branch', () => {
|
|
98
|
+
gitCommandSpy.mockImplementation((cmd) => {
|
|
99
|
+
if (cmd.includes('--merges'))
|
|
100
|
+
return '';
|
|
101
|
+
return '';
|
|
102
|
+
});
|
|
103
|
+
expect(hasMergeFromTarget(sourceBranch, targetBranch)).toBe(false);
|
|
104
|
+
expect(gitCommandSpy).toHaveBeenCalledWith(`git log --merges --pretty=format:%H ${targetBranch}..${sourceBranch}`);
|
|
105
|
+
});
|
|
106
|
+
it('should return true when a merge commit has a parent reachable from targetBranch', () => {
|
|
107
|
+
gitCommandSpy.mockImplementation((cmd) => {
|
|
108
|
+
if (cmd.includes('--merges'))
|
|
109
|
+
return mergeSha;
|
|
110
|
+
if (cmd.includes('--pretty=format:%P'))
|
|
111
|
+
return `${branchParentSha} ${targetParentSha}`;
|
|
112
|
+
if (cmd.startsWith(`git merge-base ${branchParentSha}`))
|
|
113
|
+
return branchParentSha; // not ancestor
|
|
114
|
+
if (cmd.startsWith(`git merge-base ${targetParentSha}`))
|
|
115
|
+
return targetParentSha; // is ancestor
|
|
116
|
+
return '';
|
|
117
|
+
});
|
|
118
|
+
expect(hasMergeFromTarget(sourceBranch, targetBranch)).toBe(true);
|
|
119
|
+
});
|
|
120
|
+
it('should return false when the merge commit parent is not reachable from targetBranch (unrelated branch merge)', () => {
|
|
121
|
+
const unrelatedSha = 'e'.repeat(40);
|
|
122
|
+
const differentMergeBase = '0'.repeat(40);
|
|
123
|
+
gitCommandSpy.mockImplementation((cmd) => {
|
|
124
|
+
if (cmd.includes('--merges'))
|
|
125
|
+
return mergeSha;
|
|
126
|
+
if (cmd.includes('--pretty=format:%P'))
|
|
127
|
+
return `${branchParentSha} ${unrelatedSha}`;
|
|
128
|
+
// merge-base returns something other than the parent — not an ancestor
|
|
129
|
+
if (cmd.startsWith('git merge-base'))
|
|
130
|
+
return differentMergeBase;
|
|
131
|
+
return '';
|
|
132
|
+
});
|
|
133
|
+
expect(hasMergeFromTarget(sourceBranch, targetBranch)).toBe(false);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
describe('getBranchOnlyChangedFiles', () => {
|
|
137
|
+
const sourceBranch = 'feature-branch';
|
|
138
|
+
const targetBranch = 'main';
|
|
139
|
+
let gitCommandSpy;
|
|
140
|
+
beforeEach(() => {
|
|
141
|
+
gitCommandSpy = vi.spyOn(Utils, 'spawnCommandInGhWorkspace');
|
|
142
|
+
});
|
|
143
|
+
it('should return files touched by non-merge commits', () => {
|
|
144
|
+
gitCommandSpy.mockReturnValue('README.md\n\nactors/foo_bar/src/main.ts\n');
|
|
145
|
+
const result = getBranchOnlyChangedFiles(sourceBranch, targetBranch);
|
|
146
|
+
expect(result).toStrictEqual(['README.md', 'actors/foo_bar/src/main.ts']);
|
|
147
|
+
expect(gitCommandSpy).toHaveBeenCalledWith(`git log --no-merges --name-only --pretty=format: ${targetBranch}..${sourceBranch}`);
|
|
148
|
+
});
|
|
149
|
+
it('should return empty array when there are no non-merge commits', () => {
|
|
150
|
+
gitCommandSpy.mockReturnValue('');
|
|
151
|
+
expect(getBranchOnlyChangedFiles(sourceBranch, targetBranch)).toStrictEqual([]);
|
|
152
|
+
});
|
|
153
|
+
});
|
|
87
154
|
const VALID_SHA = 'a'.repeat(40);
|
|
88
155
|
const VALID_JSON = JSON.stringify({ sha: VALID_SHA, author: 'test', date: 'now', message: 'msg' });
|
|
89
156
|
describe('parseBaseCommit', () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.test.js","sourceRoot":"","sources":["../../../../test/unit/bin/git.test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9D,OAAO,
|
|
1
|
+
{"version":3,"file":"git.test.js","sourceRoot":"","sources":["../../../../test/unit/bin/git.test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9D,OAAO,EACH,yBAAyB,EACzB,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,eAAe,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,uBAAuB,CAAC;AAE/C,QAAQ,CAAC,YAAY,EAAE,GAAG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