apify-test-tools 0.5.0 → 0.5.2
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/.prettierrc +5 -0
- package/.vscode/settings.json +3 -0
- package/CHANGELOG.md +10 -0
- package/bin/git.ts +24 -44
- package/bin/github.ts +5 -14
- package/bin/main.ts +38 -38
- package/bin/slack.ts +13 -16
- package/dist/bin/git.d.ts +9 -4
- package/dist/bin/git.d.ts.map +1 -1
- package/dist/bin/git.js +15 -36
- package/dist/bin/git.js.map +1 -1
- package/dist/bin/github.d.ts +1 -1
- package/dist/bin/github.d.ts.map +1 -1
- package/dist/bin/github.js +3 -9
- package/dist/bin/github.js.map +1 -1
- package/dist/bin/main.js +5 -7
- package/dist/bin/main.js.map +1 -1
- package/dist/bin/slack.d.ts +2 -2
- package/dist/bin/slack.d.ts.map +1 -1
- package/dist/bin/slack.js +4 -2
- package/dist/bin/slack.js.map +1 -1
- package/dist/lib/consts.d.ts +1 -1
- package/dist/lib/consts.d.ts.map +1 -1
- package/dist/lib/consts.js +1 -4
- package/dist/lib/consts.js.map +1 -1
- package/dist/lib/extend-expect.d.ts.map +1 -1
- package/dist/lib/extend-expect.js +11 -2
- package/dist/lib/extend-expect.js.map +1 -1
- package/dist/lib/lib.d.ts +1 -1
- package/dist/lib/lib.d.ts.map +1 -1
- package/dist/lib/lib.js +12 -9
- package/dist/lib/lib.js.map +1 -1
- package/dist/lib/run-test-result.d.ts +1 -1
- package/dist/lib/run-test-result.d.ts.map +1 -1
- package/dist/lib/run-test-result.js +1 -0
- package/dist/lib/run-test-result.js.map +1 -1
- package/dist/lib/types.d.ts +2 -0
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/test/unit/bin/git.test.d.ts +2 -0
- package/dist/test/unit/bin/git.test.d.ts.map +1 -0
- package/dist/test/unit/bin/git.test.js +81 -0
- package/dist/test/unit/bin/git.test.js.map +1 -0
- package/dist/test/unit/custom-matchers.test.js +2 -2
- package/dist/test/unit/custom-matchers.test.js.map +1 -1
- package/dist/test/unit/parse-commit.test.js +5 -5
- package/dist/test/unit/parse-commit.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/lib/consts.ts +2 -5
- package/lib/extend-expect.ts +38 -25
- package/lib/lib.ts +31 -42
- package/lib/run-test-result.ts +9 -10
- package/lib/types.ts +69 -68
- package/package.json +4 -1
- package/test/unit/bin/git.test.ts +109 -0
- package/test/unit/custom-matchers.test.ts +6 -9
- package/test/unit/parse-commit.test.ts +6 -7
- package/tsconfig.json +4 -8
- package/test/unit/test-actor.test.ts +0 -17
package/.prettierrc
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.2
|
|
4
|
+
|
|
5
|
+
fix: file diffs between commits
|
|
6
|
+
feat: annotate runs with test names
|
|
7
|
+
|
|
8
|
+
## 0.5.1
|
|
9
|
+
|
|
10
|
+
fix: properly check on maxRetriesPerRequest
|
|
11
|
+
fix: change module resolution to nodenext and fix types
|
|
12
|
+
|
|
3
13
|
## 0.5.0
|
|
4
14
|
|
|
5
15
|
feat: feat: add maxRetriesPerRequest test
|
package/bin/git.ts
CHANGED
|
@@ -1,57 +1,37 @@
|
|
|
1
|
-
import { Commit, Config } from './types';
|
|
1
|
+
import { Commit, Config } from './types.js';
|
|
2
2
|
import { spawnCommandInGhWorkspace } from './utils.js';
|
|
3
3
|
|
|
4
4
|
export const GIT_FORMAT_SEPARATOR = '»¦«';
|
|
5
5
|
const GIT_LOG_FORMAT = ['%H', '%aN<%aE>', '%aD', '%s'].join(GIT_FORMAT_SEPARATOR);
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const commit = parseCommit(commitString);
|
|
11
|
-
return commit;
|
|
12
|
-
};
|
|
13
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Gets the list of changed files between the given commits (inclusive).
|
|
9
|
+
*/
|
|
14
10
|
export const getChangedFiles = (commits: Commit[]) => {
|
|
15
|
-
const changedFiles =
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
const changedFiles = spawnCommandInGhWorkspace(
|
|
12
|
+
`git diff --name-only ${commits[0].sha}~..${commits[commits.length - 1].sha}`,
|
|
13
|
+
);
|
|
14
|
+
|
|
18
15
|
return changedFiles.split('\n');
|
|
19
16
|
};
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}: Config): Commit[] => {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
try {
|
|
31
|
-
baseCommit = getCommitInfo(baseCommitSha);
|
|
32
|
-
} catch (err) {
|
|
33
|
-
console.warn(`Failed to get base commit "${baseCommitSha}", it will not be used: ${err}`);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
// const baseCommit = baseCommitSha !== undefined ? : undefined;
|
|
37
|
-
// const gitOutputFormat = '{"sha":"%H","author":"%aN<%aE>","date":"%aD","message":"%f"}';
|
|
38
|
-
// console.log(`git log --pretty=format:"${gitOutputFormat}" ${targetBranch}..${sourceBranch}`);
|
|
39
|
-
// return [];
|
|
40
|
-
const base = getBaseCommit(sourceBranchCommit, targetBranchCommit);
|
|
41
|
-
const commitsStrings = spawnCommandInGhWorkspace(`git log --pretty=format:'${GIT_LOG_FORMAT}' ${base.sha}..${sourceBranchCommit.sha}`)
|
|
42
|
-
.split('\n');
|
|
43
|
-
const commits = commitsStrings.map((commitString) => parseCommit(commitString)) as Commit[];
|
|
18
|
+
/**
|
|
19
|
+
* Gets the commits between sourceBranch and targetBranch (exclusive).
|
|
20
|
+
* - If baseCommit is provided, only returns commits after the baseCommit.
|
|
21
|
+
*/
|
|
22
|
+
export const getCommits = ({ sourceBranch, targetBranch, baseCommit: baseCommitSha }: Config): Commit[] => {
|
|
23
|
+
const commitsStrings = spawnCommandInGhWorkspace(
|
|
24
|
+
`git log --pretty=format:'${GIT_LOG_FORMAT}' ${targetBranch}..${sourceBranch}`,
|
|
25
|
+
).split('\n');
|
|
26
|
+
const commits = commitsStrings.map((commitString) => parseCommit(commitString));
|
|
44
27
|
commits.reverse();
|
|
45
|
-
const baseCommitIndex = baseCommit
|
|
46
|
-
? commits.findIndex(({ sha }) => sha === baseCommit.sha)
|
|
47
|
-
: -1;
|
|
48
|
-
return commits.slice(baseCommitIndex + 1);
|
|
49
|
-
};
|
|
50
28
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
return
|
|
29
|
+
const baseCommitIndex = commits.findIndex((commit) => commit.sha === baseCommitSha);
|
|
30
|
+
|
|
31
|
+
const hasBaseCommit = baseCommitIndex !== -1;
|
|
32
|
+
if (hasBaseCommit) return commits.slice(baseCommitIndex + 1);
|
|
33
|
+
|
|
34
|
+
return commits;
|
|
55
35
|
};
|
|
56
36
|
|
|
57
37
|
export const getCommitInfo = (commitSha: string): Commit => {
|
|
@@ -72,4 +52,4 @@ export const parseCommit = (commitString: string): Commit => {
|
|
|
72
52
|
date,
|
|
73
53
|
message,
|
|
74
54
|
};
|
|
75
|
-
}
|
|
55
|
+
};
|
package/bin/github.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fs from 'fs/promises';
|
|
2
|
-
import { Commit, GitHubEventPush } from './types';
|
|
2
|
+
import { Commit, GitHubEventPush } from './types.js';
|
|
3
3
|
import { spawnCommandInGhWorkspace } from './utils.js';
|
|
4
4
|
|
|
5
5
|
export const getPushData = async (path: string) => {
|
|
@@ -8,7 +8,7 @@ export const getPushData = async (path: string) => {
|
|
|
8
8
|
const {
|
|
9
9
|
commits: ghCommits,
|
|
10
10
|
repository: { ssh_url: repoUrl, name },
|
|
11
|
-
head_commit: { author }
|
|
11
|
+
head_commit: { author },
|
|
12
12
|
} = event;
|
|
13
13
|
const commits: Commit[] = ghCommits.map(({ author, message, id, timestamp }) => ({
|
|
14
14
|
author: author.username,
|
|
@@ -25,7 +25,7 @@ export const getPushData = async (path: string) => {
|
|
|
25
25
|
repoUrl,
|
|
26
26
|
changelog,
|
|
27
27
|
repository: name,
|
|
28
|
-
author: author.name
|
|
28
|
+
author: author.name,
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
|
|
@@ -39,22 +39,13 @@ const getChangedFiles = ({ after, before }: GitHubEventPush): string[] => {
|
|
|
39
39
|
return changedFiles.split('\n');
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
export const getChangelogChanges = (
|
|
43
|
-
changedFiles: string[],
|
|
44
|
-
event: GitHubEventPush,
|
|
45
|
-
): string | null => {
|
|
42
|
+
export const getChangelogChanges = (changedFiles: string[], event: GitHubEventPush): string | null => {
|
|
46
43
|
const changelogPath = 'CHANGELOG.md';
|
|
47
44
|
if (!changedFiles.includes(changelogPath)) {
|
|
48
45
|
return null;
|
|
49
46
|
}
|
|
50
47
|
const { after, before } = event;
|
|
51
|
-
const diff = spawnCommandInGhWorkspace('git', [
|
|
52
|
-
'diff',
|
|
53
|
-
before,
|
|
54
|
-
after,
|
|
55
|
-
'--',
|
|
56
|
-
changelogPath,
|
|
57
|
-
]);
|
|
48
|
+
const diff = spawnCommandInGhWorkspace('git', ['diff', before, after, '--', changelogPath]);
|
|
58
49
|
|
|
59
50
|
const added: string[] = [];
|
|
60
51
|
let startedChangelog = false;
|
package/bin/main.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import process from 'process';
|
|
4
|
-
import yargs from 'yargs';
|
|
4
|
+
import yargs, { type Argv } from 'yargs';
|
|
5
5
|
import { hideBin } from 'yargs/helpers';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
getRepoActors,
|
|
9
|
-
getChangedActors,
|
|
10
|
-
spawnCommandInGhWorkspace,
|
|
11
|
-
setCwd,
|
|
12
|
-
} from './utils.js';
|
|
7
|
+
import { getRepoActors, getChangedActors, spawnCommandInGhWorkspace, setCwd } from './utils.js';
|
|
13
8
|
import { runBuilds } from './build.js';
|
|
14
9
|
import { getChangedFiles, getCommits } from './git.js';
|
|
15
10
|
import { getPushData } from './github.js';
|
|
@@ -21,7 +16,7 @@ import { reportTestRestuls } from './test-report.js';
|
|
|
21
16
|
*/
|
|
22
17
|
const middlewares = [setCwd];
|
|
23
18
|
|
|
24
|
-
const buildOptions = (y:
|
|
19
|
+
const buildOptions = (y: Argv) => {
|
|
25
20
|
return y
|
|
26
21
|
.option('target-branch', {
|
|
27
22
|
type: 'string',
|
|
@@ -33,7 +28,7 @@ const buildOptions = (y: yargs.Argv) => {
|
|
|
33
28
|
})
|
|
34
29
|
.option('base-commit', {
|
|
35
30
|
type: 'string',
|
|
36
|
-
})
|
|
31
|
+
});
|
|
37
32
|
};
|
|
38
33
|
|
|
39
34
|
await yargs()
|
|
@@ -61,10 +56,15 @@ await yargs()
|
|
|
61
56
|
const changedFiles = getChangedFiles(commits);
|
|
62
57
|
console.log(JSON.stringify(changedFiles));
|
|
63
58
|
})
|
|
64
|
-
.command(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
.command(
|
|
60
|
+
'get-actor-configs',
|
|
61
|
+
'',
|
|
62
|
+
(_) => _,
|
|
63
|
+
async () => {
|
|
64
|
+
const actorConfigs = await getRepoActors();
|
|
65
|
+
console.log(JSON.stringify(actorConfigs));
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
68
|
.command('get-affected-actors', '', buildOptions, async (args) => {
|
|
69
69
|
const commits = getCommits(args);
|
|
70
70
|
const changedFiles = getChangedFiles(commits);
|
|
@@ -75,19 +75,20 @@ await yargs()
|
|
|
75
75
|
.command(
|
|
76
76
|
'report-tests',
|
|
77
77
|
'',
|
|
78
|
-
(args) =>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
(args) =>
|
|
79
|
+
args
|
|
80
|
+
.option('report-file', { type: 'string', demandOption: true })
|
|
81
|
+
.option('job-url', { type: 'string' })
|
|
82
|
+
.option('workflow-name', { type: 'string' })
|
|
83
|
+
.option('repository', { type: 'string' }),
|
|
83
84
|
async (args) => {
|
|
84
85
|
await reportTestRestuls(args);
|
|
85
|
-
}
|
|
86
|
+
}
|
|
87
|
+
)
|
|
86
88
|
.command(
|
|
87
89
|
'build',
|
|
88
90
|
'',
|
|
89
|
-
(args) => buildOptions(args)
|
|
90
|
-
.option('dry-run', { type: 'boolean', default: false }),
|
|
91
|
+
(args) => buildOptions(args).option('dry-run', { type: 'boolean', default: false }),
|
|
91
92
|
async (args) => {
|
|
92
93
|
const commits = getCommits(args);
|
|
93
94
|
const changedFiles = getChangedFiles(commits);
|
|
@@ -98,8 +99,10 @@ await yargs()
|
|
|
98
99
|
});
|
|
99
100
|
// https://github.com/apify-store/google-maps#:actors/lukaskrivka_google-maps-with-contact-details
|
|
100
101
|
// git@github.com:apify-store/google-maps#:actors/lukaskrivka_google-maps-with-contact-details
|
|
101
|
-
const repoUrl = spawnCommandInGhWorkspace(`git remote get-url origin`)
|
|
102
|
-
|
|
102
|
+
const repoUrl = spawnCommandInGhWorkspace(`git remote get-url origin`).replace(
|
|
103
|
+
/^https:\/\/github\.com\//,
|
|
104
|
+
'git@github.com:'
|
|
105
|
+
);
|
|
103
106
|
|
|
104
107
|
const builds = await runBuilds({
|
|
105
108
|
repoUrl,
|
|
@@ -108,23 +111,19 @@ await yargs()
|
|
|
108
111
|
dryRun: args.dryRun,
|
|
109
112
|
});
|
|
110
113
|
console.log(JSON.stringify(builds));
|
|
111
|
-
}
|
|
114
|
+
}
|
|
115
|
+
)
|
|
112
116
|
.command(
|
|
113
117
|
'release',
|
|
114
118
|
'',
|
|
115
|
-
(args) =>
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
(args) =>
|
|
120
|
+
args
|
|
121
|
+
.option('push-event-path', { type: 'string', demandOption: true })
|
|
122
|
+
.option('dry-run', { type: 'boolean', default: false }),
|
|
118
123
|
async (args) => {
|
|
119
|
-
const {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
repoUrl,
|
|
123
|
-
commits,
|
|
124
|
-
changelog,
|
|
125
|
-
repository,
|
|
126
|
-
author,
|
|
127
|
-
} = await getPushData(args.pushEventPath);
|
|
124
|
+
const { branch, changedFiles, repoUrl, commits, changelog, repository, author } = await getPushData(
|
|
125
|
+
args.pushEventPath
|
|
126
|
+
);
|
|
128
127
|
const isLatest = true;
|
|
129
128
|
const actorConfigs = await getRepoActors();
|
|
130
129
|
const { actorsChanged } = getChangedActors({
|
|
@@ -149,9 +148,10 @@ await yargs()
|
|
|
149
148
|
changelog,
|
|
150
149
|
repository,
|
|
151
150
|
dryRun,
|
|
152
|
-
author
|
|
151
|
+
author,
|
|
153
152
|
});
|
|
154
|
-
}
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
155
|
.strictCommands()
|
|
156
156
|
.demandCommand(1, 'Command is required')
|
|
157
157
|
.parse(hideBin(process.argv));
|
package/bin/slack.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { WebClient } from '@slack/web-api';
|
|
2
|
-
import { Commit } from './types';
|
|
2
|
+
import { Commit } from './types.js';
|
|
3
3
|
import { getEnvVar } from './utils.js';
|
|
4
4
|
|
|
5
5
|
type NotifyToSlackOptions = {
|
|
6
|
-
repository: string
|
|
7
|
-
changedFiles: string[]
|
|
8
|
-
changelog: string | null
|
|
9
|
-
commits: Commit[]
|
|
10
|
-
dryRun: boolean
|
|
11
|
-
author: string
|
|
12
|
-
}
|
|
6
|
+
repository: string;
|
|
7
|
+
changedFiles: string[];
|
|
8
|
+
changelog: string | null;
|
|
9
|
+
commits: Commit[];
|
|
10
|
+
dryRun: boolean;
|
|
11
|
+
author: string;
|
|
12
|
+
};
|
|
13
13
|
|
|
14
14
|
export const notifyToSlack = async ({
|
|
15
15
|
changedFiles,
|
|
@@ -17,7 +17,7 @@ export const notifyToSlack = async ({
|
|
|
17
17
|
changelog,
|
|
18
18
|
repository,
|
|
19
19
|
dryRun,
|
|
20
|
-
author
|
|
20
|
+
author,
|
|
21
21
|
}: NotifyToSlackOptions) => {
|
|
22
22
|
const slack = new WebClient(getEnvVar('SLACK_TOKEN_RELEASES_BOT'));
|
|
23
23
|
|
|
@@ -42,7 +42,9 @@ export const notifyToSlack = async ({
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
const commitsMessage = `${commits
|
|
45
|
+
const commitsMessage = `${commits
|
|
46
|
+
.map(({ author, message }, index) => `${index + 1}. Commit message: ${message}\n\tAuthor: ${author}.`)
|
|
47
|
+
.join('\n')}`;
|
|
46
48
|
const changedFilesMessage = `**Files changed**: ${changedFiles.join(', ')}`;
|
|
47
49
|
const longMessage = `${shortMessage}\n**Commit list**:\n${commitsMessage}\n\n${changedFilesMessage}`;
|
|
48
50
|
|
|
@@ -59,12 +61,7 @@ export const notifyToSlack = async ({
|
|
|
59
61
|
}
|
|
60
62
|
};
|
|
61
63
|
|
|
62
|
-
export const sendSlackMessage = async (
|
|
63
|
-
channel: string,
|
|
64
|
-
text: string,
|
|
65
|
-
blocks: string[],
|
|
66
|
-
token: string,
|
|
67
|
-
) => {
|
|
64
|
+
export const sendSlackMessage = async (channel: string, text: string, blocks: string[], token: string) => {
|
|
68
65
|
const slack = new WebClient(token);
|
|
69
66
|
const { ts } = await slack.chat.postMessage({ text, channel });
|
|
70
67
|
if (blocks.length > 0 && ts) {
|
package/dist/bin/git.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { Commit, Config } from './types';
|
|
1
|
+
import { Commit, Config } from './types.js';
|
|
2
2
|
export declare const GIT_FORMAT_SEPARATOR = "\u00BB\u00A6\u00AB";
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Gets the list of changed files between the given commits (inclusive).
|
|
5
|
+
*/
|
|
4
6
|
export declare const getChangedFiles: (commits: Commit[]) => string[];
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Gets the commits between sourceBranch and targetBranch (exclusive).
|
|
9
|
+
* - If baseCommit is provided, only returns commits after the baseCommit.
|
|
10
|
+
*/
|
|
11
|
+
export declare const getCommits: ({ sourceBranch, targetBranch, baseCommit: baseCommitSha }: Config) => Commit[];
|
|
7
12
|
export declare const getCommitInfo: (commitSha: string) => Commit;
|
|
8
13
|
export declare const parseCommit: (commitString: string) => Commit;
|
|
9
14
|
//# sourceMappingURL=git.d.ts.map
|
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,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../bin/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAG5C,eAAO,MAAM,oBAAoB,uBAAQ,CAAC;AAG1C;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,EAAE,aAMhD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,2DAA2D,MAAM,KAAG,MAAM,EAapG,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,WAAW,MAAM,KAAG,MAIjD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,cAAc,MAAM,KAAG,MAYlD,CAAC"}
|
package/dist/bin/git.js
CHANGED
|
@@ -1,47 +1,26 @@
|
|
|
1
1
|
import { spawnCommandInGhWorkspace } from './utils.js';
|
|
2
2
|
export const GIT_FORMAT_SEPARATOR = '»¦«';
|
|
3
3
|
const GIT_LOG_FORMAT = ['%H', '%aN<%aE>', '%aD', '%s'].join(GIT_FORMAT_SEPARATOR);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return commit;
|
|
8
|
-
};
|
|
4
|
+
/**
|
|
5
|
+
* Gets the list of changed files between the given commits (inclusive).
|
|
6
|
+
*/
|
|
9
7
|
export const getChangedFiles = (commits) => {
|
|
10
|
-
const changedFiles = commits.length
|
|
11
|
-
? spawnCommandInGhWorkspace(`git show --pretty='format:' --name-only ${commits[0].sha}`)
|
|
12
|
-
: spawnCommandInGhWorkspace(`git diff --name-only ${commits[0].sha}..${commits[commits.length - 1].sha}`);
|
|
8
|
+
const changedFiles = spawnCommandInGhWorkspace(`git diff --name-only ${commits[0].sha}~..${commits[commits.length - 1].sha}`);
|
|
13
9
|
return changedFiles.split('\n');
|
|
14
10
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
baseCommit = getCommitInfo(baseCommitSha);
|
|
22
|
-
}
|
|
23
|
-
catch (err) {
|
|
24
|
-
console.warn(`Failed to get base commit "${baseCommitSha}", it will not be used: ${err}`);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
// const baseCommit = baseCommitSha !== undefined ? : undefined;
|
|
28
|
-
// const gitOutputFormat = '{"sha":"%H","author":"%aN<%aE>","date":"%aD","message":"%f"}';
|
|
29
|
-
// console.log(`git log --pretty=format:"${gitOutputFormat}" ${targetBranch}..${sourceBranch}`);
|
|
30
|
-
// return [];
|
|
31
|
-
const base = getBaseCommit(sourceBranchCommit, targetBranchCommit);
|
|
32
|
-
const commitsStrings = spawnCommandInGhWorkspace(`git log --pretty=format:'${GIT_LOG_FORMAT}' ${base.sha}..${sourceBranchCommit.sha}`)
|
|
33
|
-
.split('\n');
|
|
11
|
+
/**
|
|
12
|
+
* Gets the commits between sourceBranch and targetBranch (exclusive).
|
|
13
|
+
* - If baseCommit is provided, only returns commits after the baseCommit.
|
|
14
|
+
*/
|
|
15
|
+
export const getCommits = ({ sourceBranch, targetBranch, baseCommit: baseCommitSha }) => {
|
|
16
|
+
const commitsStrings = spawnCommandInGhWorkspace(`git log --pretty=format:'${GIT_LOG_FORMAT}' ${targetBranch}..${sourceBranch}`).split('\n');
|
|
34
17
|
const commits = commitsStrings.map((commitString) => parseCommit(commitString));
|
|
35
18
|
commits.reverse();
|
|
36
|
-
const baseCommitIndex =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export const getBaseCommit = (target, source) => {
|
|
42
|
-
const baseCommitSha = spawnCommandInGhWorkspace(`git merge-base ${target.sha} ${source.sha}`);
|
|
43
|
-
const baseCommit = getCommitInfo(baseCommitSha);
|
|
44
|
-
return baseCommit;
|
|
19
|
+
const baseCommitIndex = commits.findIndex((commit) => commit.sha === baseCommitSha);
|
|
20
|
+
const hasBaseCommit = baseCommitIndex !== -1;
|
|
21
|
+
if (hasBaseCommit)
|
|
22
|
+
return commits.slice(baseCommitIndex + 1);
|
|
23
|
+
return commits;
|
|
45
24
|
};
|
|
46
25
|
export const getCommitInfo = (commitSha) => {
|
|
47
26
|
const commitString = spawnCommandInGhWorkspace(`git log -1 --pretty=format:'${GIT_LOG_FORMAT}' ${commitSha}`);
|
package/dist/bin/git.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../bin/git.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAC1C,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../bin/git.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAC1C,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,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AM,MAAM,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;IACzC,OAAO,MAAM,CAAC;AAClB,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/github.d.ts
CHANGED
package/dist/bin/github.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../bin/github.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../bin/github.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGrD,eAAO,MAAM,WAAW,GAAU,MAAM,MAAM;;;;;;;;EAyB7C,CAAC;AAEF,eAAO,MAAM,eAAe,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,eAAe,CAG3E,CAAC;AAOF,eAAO,MAAM,mBAAmB,GAAI,cAAc,MAAM,EAAE,EAAE,OAAO,eAAe,KAAG,MAAM,GAAG,IA0B7F,CAAC"}
|
package/dist/bin/github.js
CHANGED
|
@@ -3,7 +3,7 @@ import { spawnCommandInGhWorkspace } from './utils.js';
|
|
|
3
3
|
export const getPushData = async (path) => {
|
|
4
4
|
const event = await loadGitHubEvent(path);
|
|
5
5
|
const branch = event.ref.replace('refs/heads/', '');
|
|
6
|
-
const { commits: ghCommits, repository: { ssh_url: repoUrl, name }, head_commit: { author } } = event;
|
|
6
|
+
const { commits: ghCommits, repository: { ssh_url: repoUrl, name }, head_commit: { author }, } = event;
|
|
7
7
|
const commits = ghCommits.map(({ author, message, id, timestamp }) => ({
|
|
8
8
|
author: author.username,
|
|
9
9
|
sha: id,
|
|
@@ -19,7 +19,7 @@ export const getPushData = async (path) => {
|
|
|
19
19
|
repoUrl,
|
|
20
20
|
changelog,
|
|
21
21
|
repository: name,
|
|
22
|
-
author: author.name
|
|
22
|
+
author: author.name,
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
25
|
export const loadGitHubEvent = async (path) => {
|
|
@@ -36,13 +36,7 @@ export const getChangelogChanges = (changedFiles, event) => {
|
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
38
|
const { after, before } = event;
|
|
39
|
-
const diff = spawnCommandInGhWorkspace('git', [
|
|
40
|
-
'diff',
|
|
41
|
-
before,
|
|
42
|
-
after,
|
|
43
|
-
'--',
|
|
44
|
-
changelogPath,
|
|
45
|
-
]);
|
|
39
|
+
const diff = spawnCommandInGhWorkspace('git', ['diff', before, after, '--', changelogPath]);
|
|
46
40
|
const added = [];
|
|
47
41
|
let startedChangelog = false;
|
|
48
42
|
for (const line of diff.split('\n')) {
|
package/dist/bin/github.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.js","sourceRoot":"","sources":["../../bin/github.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAE7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,IAAY,EAAE,EAAE;IAC9C,MAAM,KAAK,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CA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,CAAC;YACxB,SAAS;QACb,CAAC;QACD,IAAI,gBAAgB,EAAE,CAAC;YACnB,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC1B,MAAM;YACV,CAAC;YACD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBACvB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;YACrC,CAAC;QACL,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;AACnC,CAAC,CAAC"}
|
package/dist/bin/main.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import process from 'process';
|
|
3
3
|
import yargs from 'yargs';
|
|
4
4
|
import { hideBin } from 'yargs/helpers';
|
|
5
|
-
import { getRepoActors, getChangedActors, spawnCommandInGhWorkspace, setCwd
|
|
5
|
+
import { getRepoActors, getChangedActors, spawnCommandInGhWorkspace, setCwd } from './utils.js';
|
|
6
6
|
import { runBuilds } from './build.js';
|
|
7
7
|
import { getChangedFiles, getCommits } from './git.js';
|
|
8
8
|
import { getPushData } from './github.js';
|
|
@@ -69,8 +69,7 @@ await yargs()
|
|
|
69
69
|
.option('repository', { type: 'string' }), async (args) => {
|
|
70
70
|
await reportTestRestuls(args);
|
|
71
71
|
})
|
|
72
|
-
.command('build', '', (args) => buildOptions(args)
|
|
73
|
-
.option('dry-run', { type: 'boolean', default: false }), async (args) => {
|
|
72
|
+
.command('build', '', (args) => buildOptions(args).option('dry-run', { type: 'boolean', default: false }), async (args) => {
|
|
74
73
|
const commits = getCommits(args);
|
|
75
74
|
const changedFiles = getChangedFiles(commits);
|
|
76
75
|
const actorConfigs = await getRepoActors();
|
|
@@ -80,8 +79,7 @@ await yargs()
|
|
|
80
79
|
});
|
|
81
80
|
// https://github.com/apify-store/google-maps#:actors/lukaskrivka_google-maps-with-contact-details
|
|
82
81
|
// git@github.com:apify-store/google-maps#:actors/lukaskrivka_google-maps-with-contact-details
|
|
83
|
-
const repoUrl = spawnCommandInGhWorkspace(`git remote get-url origin`)
|
|
84
|
-
.replace(/^https:\/\/github\.com\//, 'git@github.com:');
|
|
82
|
+
const repoUrl = spawnCommandInGhWorkspace(`git remote get-url origin`).replace(/^https:\/\/github\.com\//, 'git@github.com:');
|
|
85
83
|
const builds = await runBuilds({
|
|
86
84
|
repoUrl,
|
|
87
85
|
actorConfigs: actorsChanged,
|
|
@@ -93,7 +91,7 @@ await yargs()
|
|
|
93
91
|
.command('release', '', (args) => args
|
|
94
92
|
.option('push-event-path', { type: 'string', demandOption: true })
|
|
95
93
|
.option('dry-run', { type: 'boolean', default: false }), async (args) => {
|
|
96
|
-
const { branch, changedFiles, repoUrl, commits, changelog, repository, author
|
|
94
|
+
const { branch, changedFiles, repoUrl, commits, changelog, repository, author } = await getPushData(args.pushEventPath);
|
|
97
95
|
const isLatest = true;
|
|
98
96
|
const actorConfigs = await getRepoActors();
|
|
99
97
|
const { actorsChanged } = getChangedActors({
|
|
@@ -117,7 +115,7 @@ await yargs()
|
|
|
117
115
|
changelog,
|
|
118
116
|
repository,
|
|
119
117
|
dryRun,
|
|
120
|
-
author
|
|
118
|
+
author,
|
|
121
119
|
});
|
|
122
120
|
})
|
|
123
121
|
.strictCommands()
|
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,SAAS,CAAC;AAC9B,OAAO,
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../bin/main.ts"],"names":[],"mappings":";AAEA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,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QACT,UAAU;QACV,MAAM;QACN,MAAM;KACT,CAAC,CAAC;AACP,CAAC,CACJ;KACA,cAAc,EAAE;KAChB,aAAa,CAAC,CAAC,EAAE,qBAAqB,CAAC;KACvC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC"}
|
package/dist/bin/slack.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Commit } from './types';
|
|
1
|
+
import { Commit } from './types.js';
|
|
2
2
|
type NotifyToSlackOptions = {
|
|
3
3
|
repository: string;
|
|
4
4
|
changedFiles: string[];
|
|
@@ -7,7 +7,7 @@ type NotifyToSlackOptions = {
|
|
|
7
7
|
dryRun: boolean;
|
|
8
8
|
author: string;
|
|
9
9
|
};
|
|
10
|
-
export declare const notifyToSlack: ({ changedFiles, commits, changelog, repository, dryRun, author }: NotifyToSlackOptions) => Promise<void>;
|
|
10
|
+
export declare const notifyToSlack: ({ changedFiles, commits, changelog, repository, dryRun, author, }: NotifyToSlackOptions) => Promise<void>;
|
|
11
11
|
export declare const sendSlackMessage: (channel: string, text: string, blocks: string[], token: string) => Promise<void>;
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=slack.d.ts.map
|
package/dist/bin/slack.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../../bin/slack.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../../bin/slack.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGpC,KAAK,oBAAoB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,mEAOjC,oBAAoB,kBAyCtB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,SAAS,MAAM,EAAE,MAAM,MAAM,EAAE,QAAQ,MAAM,EAAE,EAAE,OAAO,MAAM,kBAUpG,CAAC"}
|