apify-test-tools 0.10.2-beta.1 → 0.10.2-beta.10
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/.gitattributes +2 -0
- package/.github/actions/checkout-restore-dependencies/action.yaml +64 -27
- package/.github/cli/apify-test-tools.mjs +360 -0
- package/.github/scripts/check-major-tag-refs.mjs +1 -1
- package/.github/scripts/mask-config-secrets.sh +17 -0
- package/.github/scripts/run-with-apify-tokens.mjs +37 -12
- package/.github/workflows/_check_code.yaml +25 -0
- package/.github/workflows/_move_major_tag.yaml +3 -81
- package/.github/workflows/_tests.yaml +34 -0
- package/.github/workflows/_update_release_metadata.yaml +0 -12
- package/.github/workflows/manual_move_major_tag.yaml +3 -3
- package/.github/workflows/manual_release_stable.yaml +3 -13
- package/.github/workflows/on_master.yaml +9 -5
- package/.github/workflows/on_pull_request.yaml +3 -48
- package/.github/workflows/public_platform-tests-claude-investigate-and-fix.yaml +13 -2
- package/.github/workflows/public_platform-tests.yaml +24 -1
- package/.github/workflows/public_pr-build-test.yaml +61 -25
- package/.github/workflows/public_push-build-latest.yaml +41 -8
- package/.husky/pre-commit +5 -0
- package/.prettierignore +3 -0
- package/CHANGELOG.md +16 -0
- package/CONTRIBUTING.md +105 -21
- package/README.md +218 -600
- package/bin/affected-actors.ts +198 -0
- package/bin/build-from-local.ts +65 -13
- package/bin/build.ts +123 -41
- package/bin/diff-changes.ts +32 -23
- package/bin/diff-json-schema.ts +5 -6
- package/bin/git.ts +69 -99
- package/bin/main.ts +96 -135
- package/bin/slack.ts +43 -10
- package/bin/stdin-input.ts +65 -0
- package/bin/test-report.ts +6 -9
- package/bin/types.ts +15 -0
- package/dist/bin/affected-actors.d.ts +46 -0
- package/dist/bin/affected-actors.d.ts.map +1 -0
- package/dist/bin/affected-actors.js +135 -0
- package/dist/bin/affected-actors.js.map +1 -0
- package/dist/bin/build-from-local.d.ts +12 -3
- package/dist/bin/build-from-local.d.ts.map +1 -1
- package/dist/bin/build-from-local.js +34 -12
- package/dist/bin/build-from-local.js.map +1 -1
- package/dist/bin/build.d.ts +30 -7
- package/dist/bin/build.d.ts.map +1 -1
- package/dist/bin/build.js +85 -26
- package/dist/bin/build.js.map +1 -1
- package/dist/bin/diff-changes.d.ts +11 -4
- package/dist/bin/diff-changes.d.ts.map +1 -1
- package/dist/bin/diff-changes.js +19 -19
- package/dist/bin/diff-changes.js.map +1 -1
- package/dist/bin/diff-json-schema.d.ts +2 -2
- package/dist/bin/diff-json-schema.d.ts.map +1 -1
- package/dist/bin/diff-json-schema.js +1 -4
- package/dist/bin/diff-json-schema.js.map +1 -1
- package/dist/bin/git.d.ts +23 -21
- package/dist/bin/git.d.ts.map +1 -1
- package/dist/bin/git.js +60 -83
- package/dist/bin/git.js.map +1 -1
- package/dist/bin/main.js +82 -105
- package/dist/bin/main.js.map +1 -1
- package/dist/bin/slack.d.ts +14 -4
- package/dist/bin/slack.d.ts.map +1 -1
- package/dist/bin/slack.js +39 -6
- package/dist/bin/slack.js.map +1 -1
- package/dist/bin/stdin-input.d.ts +17 -0
- package/dist/bin/stdin-input.d.ts.map +1 -0
- package/dist/bin/stdin-input.js +54 -0
- package/dist/bin/stdin-input.js.map +1 -0
- package/dist/bin/test-report.d.ts.map +1 -1
- package/dist/bin/test-report.js +6 -8
- package/dist/bin/test-report.js.map +1 -1
- package/dist/bin/types.d.ts +13 -0
- package/dist/bin/types.d.ts.map +1 -1
- package/dist/lib/extend-expect.d.ts.map +1 -1
- package/dist/lib/extend-expect.js +37 -218
- package/dist/lib/extend-expect.js.map +1 -1
- package/dist/lib/lib.d.ts +1 -2
- package/dist/lib/lib.d.ts.map +1 -1
- package/dist/lib/lib.js +15 -22
- package/dist/lib/lib.js.map +1 -1
- package/dist/lib/run-checks.d.ts +14 -0
- package/dist/lib/run-checks.d.ts.map +1 -0
- package/dist/lib/run-checks.js +82 -0
- package/dist/lib/run-checks.js.map +1 -0
- package/dist/lib/run-test-result.d.ts +3 -6
- package/dist/lib/run-test-result.d.ts.map +1 -1
- package/dist/lib/run-test-result.js +41 -54
- package/dist/lib/run-test-result.js.map +1 -1
- package/dist/test/bundle/cli-bundle.test.d.ts +2 -0
- package/dist/test/bundle/cli-bundle.test.d.ts.map +1 -0
- package/dist/test/bundle/cli-bundle.test.js +190 -0
- package/dist/test/bundle/cli-bundle.test.js.map +1 -0
- package/dist/test/e2e/cli-bundle.e2e.test.d.ts +2 -0
- package/dist/test/e2e/cli-bundle.e2e.test.d.ts.map +1 -0
- package/dist/test/e2e/cli-bundle.e2e.test.js +138 -0
- package/dist/test/e2e/cli-bundle.e2e.test.js.map +1 -0
- package/dist/test/e2e/git-build-release.e2e.test.d.ts +2 -0
- package/dist/test/e2e/git-build-release.e2e.test.d.ts.map +1 -0
- package/dist/test/e2e/git-build-release.e2e.test.js +87 -0
- package/dist/test/e2e/git-build-release.e2e.test.js.map +1 -0
- package/dist/test/e2e/helpers.d.ts +37 -0
- package/dist/test/e2e/helpers.d.ts.map +1 -0
- package/dist/test/e2e/helpers.js +57 -0
- package/dist/test/e2e/helpers.js.map +1 -0
- package/dist/test/unit/bin/affected-actors-cli.test.d.ts +2 -0
- package/dist/test/unit/bin/affected-actors-cli.test.d.ts.map +1 -0
- package/dist/test/unit/bin/affected-actors-cli.test.js +167 -0
- package/dist/test/unit/bin/affected-actors-cli.test.js.map +1 -0
- package/dist/test/unit/bin/affected-actors.test.d.ts +2 -0
- package/dist/test/unit/bin/affected-actors.test.d.ts.map +1 -0
- package/dist/test/unit/bin/affected-actors.test.js +141 -0
- package/dist/test/unit/bin/affected-actors.test.js.map +1 -0
- package/dist/test/unit/bin/build-cli.test.d.ts +2 -0
- package/dist/test/unit/bin/build-cli.test.d.ts.map +1 -0
- package/dist/test/unit/bin/build-cli.test.js +44 -0
- package/dist/test/unit/bin/build-cli.test.js.map +1 -0
- package/dist/test/unit/bin/build-from-local.test.js +65 -1
- package/dist/test/unit/bin/build-from-local.test.js.map +1 -1
- package/dist/test/unit/bin/build.test.js +223 -3
- package/dist/test/unit/bin/build.test.js.map +1 -1
- package/dist/test/unit/bin/compiled-cli.d.ts +6 -0
- package/dist/test/unit/bin/compiled-cli.d.ts.map +1 -0
- package/dist/test/unit/bin/compiled-cli.js +16 -0
- package/dist/test/unit/bin/compiled-cli.js.map +1 -0
- package/dist/test/unit/bin/diff-changes.test.js +130 -101
- package/dist/test/unit/bin/diff-changes.test.js.map +1 -1
- package/dist/test/unit/bin/diff.test.js +25 -28
- package/dist/test/unit/bin/diff.test.js.map +1 -1
- package/dist/test/unit/bin/git.test.js +69 -152
- package/dist/test/unit/bin/git.test.js.map +1 -1
- package/dist/test/unit/bin/slack.test.d.ts +2 -0
- package/dist/test/unit/bin/slack.test.d.ts.map +1 -0
- package/dist/test/unit/bin/slack.test.js +71 -0
- package/dist/test/unit/bin/slack.test.js.map +1 -0
- package/dist/test/unit/bin/stdin-input.test.d.ts +2 -0
- package/dist/test/unit/bin/stdin-input.test.d.ts.map +1 -0
- package/dist/test/unit/bin/stdin-input.test.js +50 -0
- package/dist/test/unit/bin/stdin-input.test.js.map +1 -0
- package/dist/test/unit/github-scripts/mask-config-secrets.test.d.ts +2 -0
- package/dist/test/unit/github-scripts/mask-config-secrets.test.d.ts.map +1 -0
- package/dist/test/unit/github-scripts/mask-config-secrets.test.js +50 -0
- package/dist/test/unit/github-scripts/mask-config-secrets.test.js.map +1 -0
- package/dist/test/unit/github-scripts/run-with-apify-tokens.test.d.ts +2 -0
- package/dist/test/unit/github-scripts/run-with-apify-tokens.test.d.ts.map +1 -0
- package/dist/test/unit/github-scripts/run-with-apify-tokens.test.js +102 -0
- package/dist/test/unit/github-scripts/run-with-apify-tokens.test.js.map +1 -0
- package/dist/test/unit/run-checks.test.d.ts +2 -0
- package/dist/test/unit/run-checks.test.d.ts.map +1 -0
- package/dist/test/unit/run-checks.test.js +62 -0
- package/dist/test/unit/run-checks.test.js.map +1 -0
- package/dist/test/unit/run-test-result.test.d.ts +2 -0
- package/dist/test/unit/run-test-result.test.d.ts.map +1 -0
- package/dist/test/unit/run-test-result.test.js +34 -0
- package/dist/test/unit/run-test-result.test.js.map +1 -0
- package/dist/test/unit/should-built-and-test.test.js +41 -38
- package/dist/test/unit/should-built-and-test.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/cli.md +373 -0
- package/docs/lib.md +271 -0
- package/docs/workflows.md +367 -0
- package/lib/extend-expect.ts +48 -258
- package/lib/lib.ts +24 -28
- package/lib/run-checks.ts +101 -0
- package/lib/run-test-result.ts +45 -55
- package/package.json +13 -3
- package/test/bundle/cli-bundle.test.ts +235 -0
- package/test/e2e/cli-bundle.e2e.test.ts +207 -0
- package/test/e2e/git-build-release.e2e.test.ts +113 -0
- package/test/e2e/helpers.ts +82 -0
- package/test/unit/bin/affected-actors-cli.test.ts +201 -0
- package/test/unit/bin/affected-actors.test.ts +182 -0
- package/test/unit/bin/build-cli.test.ts +55 -0
- package/test/unit/bin/build-from-local.test.ts +71 -0
- package/test/unit/bin/build.test.ts +279 -3
- package/test/unit/bin/compiled-cli.ts +17 -0
- package/test/unit/bin/diff-changes.test.ts +139 -101
- package/test/unit/bin/diff.test.ts +25 -28
- package/test/unit/bin/git.test.ts +85 -176
- package/test/unit/bin/slack.test.ts +84 -0
- package/test/unit/bin/stdin-input.test.ts +61 -0
- package/test/unit/github-scripts/mask-config-secrets.test.ts +61 -0
- package/test/unit/github-scripts/run-with-apify-tokens.test.ts +115 -0
- package/test/unit/run-checks.test.ts +76 -0
- package/test/unit/run-test-result.test.ts +44 -0
- package/test/unit/should-built-and-test.test.ts +46 -39
- package/.github/scripts/check-package-version-bump.mjs +0 -74
- package/.github/workflows-package-version +0 -1
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import type { ActorConfig,
|
|
1
|
+
import type { ActorConfig, GitRange } from './types.js';
|
|
2
2
|
interface ShouldBuildAndTestOptions {
|
|
3
3
|
filepathsChanged: string[];
|
|
4
4
|
actorConfigs: ActorConfig[];
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/** The range the files changed in, to compare `.actor` JSON files across. */
|
|
6
|
+
range: GitRange;
|
|
7
7
|
testFilesGlob?: string;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export interface ChangedActors {
|
|
10
|
+
/** Actors with at least one functional change. They need a new build and tests. */
|
|
11
|
+
functional: ActorConfig[];
|
|
12
|
+
/** Actors whose changes are all cosmetic. They only need a new build when released. */
|
|
13
|
+
cosmetic: ActorConfig[];
|
|
14
|
+
}
|
|
15
|
+
/** Finds the Actors the changed files belong to, split by the most impactful change each Actor has. */
|
|
16
|
+
export declare const getChangedActors: ({ filepathsChanged, actorConfigs, range, testFilesGlob, }: ShouldBuildAndTestOptions) => Promise<ChangedActors>;
|
|
10
17
|
export {};
|
|
11
18
|
//# sourceMappingURL=diff-changes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-changes.d.ts","sourceRoot":"","sources":["../../bin/diff-changes.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"diff-changes.d.ts","sourceRoot":"","sources":["../../bin/diff-changes.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGxD,UAAU,yBAAyB;IAC/B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,6EAA6E;IAC7E,KAAK,EAAE,QAAQ,CAAC;IAEhB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAwJD,MAAM,WAAW,aAAa;IAC1B,mFAAmF;IACnF,UAAU,EAAE,WAAW,EAAE,CAAC;IAC1B,uFAAuF;IACvF,QAAQ,EAAE,WAAW,EAAE,CAAC;CAC3B;AAED,uGAAuG;AACvG,eAAO,MAAM,gBAAgB,GAAU,2DAKpC,yBAAyB,KAAG,OAAO,CAAC,aAAa,CAuDnD,CAAC"}
|
package/dist/bin/diff-changes.js
CHANGED
|
@@ -30,7 +30,7 @@ const isIgnoredTopLevelFile = (filePath, contextPath) => {
|
|
|
30
30
|
* 6. .json inside the actor's own `.actor/` dir with only cosmetic schema diffs → cosmetic (semantically verified)
|
|
31
31
|
* 7. Everything else → functional
|
|
32
32
|
*/
|
|
33
|
-
const classifyFileChange = async (changedFile, actorConfig,
|
|
33
|
+
const classifyFileChange = async (changedFile, actorConfig, range, dockerIgnoreMatcher, isTestFile) => {
|
|
34
34
|
const lowercaseFilePath = changedFile.path.toLowerCase();
|
|
35
35
|
// TODO: hardcodes that there's a single repo-wide changelog belonging to every actor. Should instead
|
|
36
36
|
// be derived from parsing actor.json (readme, changelog, schema paths), see
|
|
@@ -58,7 +58,7 @@ const classifyFileChange = async (changedFile, actorConfig, commits, dockerIgnor
|
|
|
58
58
|
return isInActorFolder ? { impact: 'cosmetic', semanticallyVerified: false } : { impact: 'ignored' };
|
|
59
59
|
}
|
|
60
60
|
if (lowercaseFilePath.endsWith('.json') && isUnderActorDotDir) {
|
|
61
|
-
const isCosmetic = await isCosmeticOnlyJsonSchemaChange(
|
|
61
|
+
const isCosmetic = await isCosmeticOnlyJsonSchemaChange(range, changedFile.path);
|
|
62
62
|
if (isCosmetic)
|
|
63
63
|
return { impact: 'cosmetic', semanticallyVerified: true };
|
|
64
64
|
}
|
|
@@ -118,7 +118,8 @@ const logChangeGroups = (groups) => {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
|
-
|
|
121
|
+
/** Finds the Actors the changed files belong to, split by the most impactful change each Actor has. */
|
|
122
|
+
export const getChangedActors = async ({ filepathsChanged, actorConfigs, range, testFilesGlob, }) => {
|
|
122
123
|
const actorsChangedMap = new Map();
|
|
123
124
|
const testFilesInContext = new Set();
|
|
124
125
|
const isTestFile = testFilesGlob ? picomatch(testFilesGlob, { nocase: true, dot: true }) : () => false;
|
|
@@ -129,36 +130,35 @@ export const getChangedActors = async ({ filepathsChanged, actorConfigs, isLates
|
|
|
129
130
|
if (isExcludedBySibling(filePath, actorConfig, actorConfigs)) {
|
|
130
131
|
continue;
|
|
131
132
|
}
|
|
132
|
-
const change = await classifyFileChange(filePath, actorConfig,
|
|
133
|
+
const change = await classifyFileChange(filePath, actorConfig, range, dockerIgnoreMatcher, isTestFile);
|
|
133
134
|
if (change.impact !== 'outside-context' && isTestFile(originalFilePath)) {
|
|
134
135
|
testFilesInContext.add(originalFilePath);
|
|
135
136
|
}
|
|
136
137
|
if (change.impact === 'ignored' || change.impact === 'outside-context')
|
|
137
138
|
continue;
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
const entry = actorsChangedMap.get(actorConfig.folder.path) ?? {
|
|
140
|
+
actorConfig,
|
|
141
|
+
files: [],
|
|
142
|
+
hasFunctionalChange: false,
|
|
143
|
+
};
|
|
141
144
|
entry.files.push(originalFilePath);
|
|
145
|
+
entry.hasFunctionalChange ||= change.impact === 'functional';
|
|
142
146
|
actorsChangedMap.set(actorConfig.folder.path, entry);
|
|
143
147
|
}
|
|
144
148
|
}
|
|
145
|
-
const actorsChanged = Array.from(actorsChangedMap.values()).map((entry) => entry.actorConfig);
|
|
146
149
|
// Log changes grouped by actor set, so changes shared across actors are logged once
|
|
147
150
|
// instead of being repeated per actor.
|
|
148
|
-
|
|
149
|
-
const groups = groupFilesByActorSet(fileToActors);
|
|
150
|
-
logChangeGroups(groups);
|
|
151
|
+
logChangeGroups(groupFilesByActorSet(buildFileToActorsMap(actorsChangedMap)));
|
|
151
152
|
for (const testFile of filepathsChanged.filter((filePath) => isTestFile(filePath) && !testFilesInContext.has(filePath))) {
|
|
152
153
|
logger.warn(`[DIFF]: Test file ${testFile} is outside every Actor's context, so changing only it builds and tests nothing. ` +
|
|
153
154
|
`Add its folder to "overrideActorContext" of the Actors it tests.`);
|
|
154
155
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
return actorsChanged;
|
|
156
|
+
const entries = Array.from(actorsChangedMap.values());
|
|
157
|
+
const functional = entries.filter((entry) => entry.hasFunctionalChange).map((entry) => entry.actorConfig);
|
|
158
|
+
const cosmetic = entries.filter((entry) => !entry.hasFunctionalChange).map((entry) => entry.actorConfig);
|
|
159
|
+
const names = (configs) => configs.map((config) => config.actorFullName).join(', ') || 'none';
|
|
160
|
+
logger.info(`[DIFF]: Actors with functional changes: ${names(functional)}`);
|
|
161
|
+
logger.info(`[DIFF]: Actors with only cosmetic changes: ${names(cosmetic)}`);
|
|
162
|
+
return { functional, cosmetic };
|
|
163
163
|
};
|
|
164
164
|
//# sourceMappingURL=diff-changes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-changes.js","sourceRoot":"","sources":["../../bin/diff-changes.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAA4B,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAoB,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAW/E,MAAM,uBAAuB,GAAG;IAC5B,UAAU;IACV,YAAY;IACZ,SAAS;IACT,WAAW;IACX,mBAAmB;IACnB,aAAa;IACb,eAAe;CAClB,CAAC;AAEF,MAAM,qBAAqB,GAAG,CAAC,QAAsB,EAAE,WAAwB,EAAW,EAAE;IACxF,MAAM,iBAAiB,GAAG,WAAW,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;IAClF,OAAO,uBAAuB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,iBAAiB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;AAC5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AmB,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAC1G,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAEzG,MAAM,KAAK,GAAG,CAAC,OAAsB,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC;IAC7G,MAAM,CAAC,IAAI,CAAC,2CAA2C,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC5E,MAAM,CAAC,IAAI,CAAC,8CAA8C,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAE7E,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;AACpC,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GitRange } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Returns true if the two JSON strings differ only in cosmetic fields
|
|
4
4
|
* (title, description, example, enumTitles, sectionCaption, sectionDescription).
|
|
5
5
|
*/
|
|
6
|
-
export declare const isCosmeticOnlyJsonSchemaChange: (
|
|
6
|
+
export declare const isCosmeticOnlyJsonSchemaChange: ({ fromRef: oldRef, toRef: newRef }: GitRange, changedFilepath: string) => Promise<boolean>;
|
|
7
7
|
//# sourceMappingURL=diff-json-schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-json-schema.d.ts","sourceRoot":"","sources":["../../bin/diff-json-schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"diff-json-schema.d.ts","sourceRoot":"","sources":["../../bin/diff-json-schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AA0B3C;;;GAGG;AACH,eAAO,MAAM,8BAA8B,GACvC,oCAAoC,QAAQ,EAC5C,iBAAiB,MAAM,KACxB,OAAO,CAAC,OAAO,CAgBjB,CAAC"}
|
|
@@ -25,10 +25,7 @@ const isCosmeticObjectChange = (oldVal, newVal, currentKey) => {
|
|
|
25
25
|
* Returns true if the two JSON strings differ only in cosmetic fields
|
|
26
26
|
* (title, description, example, enumTitles, sectionCaption, sectionDescription).
|
|
27
27
|
*/
|
|
28
|
-
export const isCosmeticOnlyJsonSchemaChange = async (
|
|
29
|
-
// TODO: validate this is the right commit range
|
|
30
|
-
const oldRef = `${commits[0].sha}~`;
|
|
31
|
-
const newRef = commits[commits.length - 1].sha;
|
|
28
|
+
export const isCosmeticOnlyJsonSchemaChange = async ({ fromRef: oldRef, toRef: newRef }, changedFilepath) => {
|
|
32
29
|
const [oldJson, newJson] = await Promise.all([
|
|
33
30
|
runGitCommand(['show', `${oldRef}:${changedFilepath}`])
|
|
34
31
|
.then(JSON.parse)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-json-schema.js","sourceRoot":"","sources":["../../bin/diff-json-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC;IACtC,OAAO;IACP,aAAa;IACb,SAAS;IACT,YAAY;IACZ,gBAAgB;IAChB,oBAAoB;CACvB,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,CAAC,GAAY,EAAkC,EAAE,CACnE,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GA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C,SAAS,CAAC;QAC3B,aAAa,CAAC,CAAC,MAAM,EAAE,GAAG,MAAM,IAAI,eAAe,EAAE,CAAC,CAAC;aAClD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;aAChB,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;KAC9B,CAAC,CAAC;IACH,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;QACvB,MAAM,CAAC,IAAI,CACP,kCAAkC,eAAe,YAAY,MAAM,QAAQ,MAAM,0EAA0E,CAC9J,CAAC;QACF,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,OAAO,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC,CAAC"}
|
package/dist/bin/git.d.ts
CHANGED
|
@@ -1,26 +1,35 @@
|
|
|
1
1
|
import type { 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).
|
|
4
|
+
* Gets the list of changed files between the given commits (inclusive), so it diffs from the parent of the oldest.
|
|
5
5
|
*/
|
|
6
6
|
export declare const getChangedFiles: (commits: Commit[]) => Promise<string[]>;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* Files that differ between two commits, i.e. changed by the commits in the range (fromRef, toRef]. fromRef's own
|
|
9
|
+
* changes are not included: to include them, pass its parent, `${sha}~` (as getChangedFiles does).
|
|
10
|
+
* Diffing the endpoints, rather than walking a commit list, is what keeps merges right: the oldest commit of a
|
|
11
|
+
* merged branch can predate fromRef, and its changes are already in fromRef.
|
|
11
12
|
*/
|
|
12
|
-
export declare const
|
|
13
|
+
export declare const getChangedFilesBetween: (fromRef: string, toRef: string) => Promise<string[]>;
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
15
|
+
* The commit `git diff base...head` compares against: where `head` forked from `base`, or the last commit of `base`
|
|
16
|
+
* that `head` merged in. The diff from it holds only what `head` itself changed, like GitHub's "Files changed" tab.
|
|
17
|
+
* With criss-cross merges there are several such commits and git picks one.
|
|
16
18
|
*/
|
|
17
|
-
export declare const
|
|
19
|
+
export declare const getMergeBase: (base: string, head: string) => Promise<string>;
|
|
20
|
+
/** Resolves a ref to a commit, or undefined when it isn't in the local history (e.g. it was force-pushed away). */
|
|
21
|
+
export declare const findCommitSha: (ref: string) => Promise<string | undefined>;
|
|
18
22
|
/**
|
|
19
23
|
*
|
|
20
24
|
* @param shaOrCommit Supports both a SHA string or a Commit object in JSON format. Can be empty.
|
|
21
25
|
* @returns The SHA string if valid, otherwise throws an error.
|
|
22
26
|
*/
|
|
23
27
|
export declare const parseBaseCommit: (shaOrCommit: string | undefined) => string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Commits reachable from toRef but not from fromRef, oldest first: the range (fromRef, toRef], so fromRef itself is
|
|
30
|
+
* not included. To include it, pass its parent, `${sha}~`.
|
|
31
|
+
*/
|
|
32
|
+
export declare const getCommitsBetween: (fromRef: string, toRef: string) => Promise<Commit[]>;
|
|
24
33
|
/**
|
|
25
34
|
* Gets the commits between sourceBranch and targetBranch (exclusive).
|
|
26
35
|
* - If baseCommit is provided, only returns commits after the baseCommit.
|
|
@@ -28,10 +37,12 @@ export declare const parseBaseCommit: (shaOrCommit: string | undefined) => strin
|
|
|
28
37
|
export declare const getCommits: ({ sourceBranch, targetBranch, baseCommit, }: Pick<Config, "sourceBranch" | "targetBranch" | "baseCommit">) => Promise<Commit[]>;
|
|
29
38
|
export declare const parseCommit: (commitString: string) => Commit;
|
|
30
39
|
/**
|
|
31
|
-
* Returns the currently checked-out branch.
|
|
40
|
+
* Returns the currently checked-out branch. Builds point the Actor version at this branch,
|
|
32
41
|
* so a detached HEAD (no branch to point at) is an error rather than a guess.
|
|
33
42
|
*/
|
|
34
43
|
export declare const getCurrentBranch: () => Promise<string>;
|
|
44
|
+
/** Resolves a ref (branch, remote branch, SHA, HEAD, ...) to the full SHA of the commit it points to. */
|
|
45
|
+
export declare const resolveCommitSha: (ref: string) => Promise<string>;
|
|
35
46
|
/**
|
|
36
47
|
* Picks the repo URL to build from. By default it's the `origin` remote, and runBuilds then checks it against
|
|
37
48
|
* each Actor's default version, so a fork or mirror remote can't repoint a published Actor. An explicit
|
|
@@ -55,16 +66,7 @@ export declare const getRepoName: (repoUrl: string) => string;
|
|
|
55
66
|
* Unlike the PR path (getCommits), there is no lenient fallback. Falling back to "everything"
|
|
56
67
|
* would rebuild the latest build of every Actor and post it to Slack, so every problem is an error.
|
|
57
68
|
*/
|
|
58
|
-
export declare const resolveReleaseBaseCommit: (baseCommit: string) => Promise<string>;
|
|
59
|
-
/**
|
|
60
|
-
|
|
61
|
-
* are no new commits. Changed files come from diffing the range directly instead of from the commit
|
|
62
|
-
* list: with a merge commit, the oldest commit of the merged branch can be older than baseSha, and
|
|
63
|
-
* diffing from its parent would pull in already-released changes.
|
|
64
|
-
*/
|
|
65
|
-
export declare const getReleaseChanges: (baseSha: string) => Promise<{
|
|
66
|
-
commits: Commit[];
|
|
67
|
-
changedFiles: string[];
|
|
68
|
-
changelog: string | null;
|
|
69
|
-
} | null>;
|
|
69
|
+
export declare const resolveReleaseBaseCommit: (baseCommit: string, head?: string) => Promise<string>;
|
|
70
|
+
/** Returns the lines added to the root CHANGELOG.md between fromRef and toRef, or null if it didn't change. */
|
|
71
|
+
export declare const getChangelogAdditions: (fromRef: string, toRef: string, changedFiles: string[]) => Promise<string | null>;
|
|
70
72
|
//# 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":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGjD,eAAO,MAAM,oBAAoB,uBAAQ,CAAC;
|
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AM,GAAG,SAAS;;;EAGtE,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,KAAG,MAUlD,CAAC;AAEF,sGAAsG;AACtG,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,KAAG,MAE7C,CAAC;AAKF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAU,YAAY,MAAM,EAAE,aAAa,KAAG,OAAO,CAAC,MAAM,CAuChG,CAAC;AAIF,+GAA+G;AAC/G,eAAO,MAAM,qBAAqB,GAC9B,SAAS,MAAM,EACf,OAAO,MAAM,EACb,cAAc,MAAM,EAAE,KACvB,OAAO,CAAC,MAAM,GAAG,IAAI,CA0BvB,CAAC"}
|
package/dist/bin/git.js
CHANGED
|
@@ -2,66 +2,49 @@ import { logger } from './logger.js';
|
|
|
2
2
|
import { GitCommandError, runGitCommand } from './utils.js';
|
|
3
3
|
export const GIT_FORMAT_SEPARATOR = '»¦«';
|
|
4
4
|
const GIT_LOG_FORMAT = ['%H', '%aN<%aE>', '%aD', '%s'].join(GIT_FORMAT_SEPARATOR);
|
|
5
|
+
// Lists the changed paths. With rename detection (on by default) a moved file is listed only under its new path,
|
|
6
|
+
// so the Actor whose context it left wouldn't count as changed. --no-renames lists it as deleted and added instead.
|
|
7
|
+
const LIST_CHANGED_PATHS = ['--name-only', '--no-renames'];
|
|
5
8
|
/**
|
|
6
|
-
* Gets the list of changed files between the given commits (inclusive).
|
|
9
|
+
* Gets the list of changed files between the given commits (inclusive), so it diffs from the parent of the oldest.
|
|
7
10
|
*/
|
|
8
11
|
export const getChangedFiles = async (commits) => {
|
|
9
|
-
// getCommits never returns an empty list (
|
|
10
|
-
//
|
|
12
|
+
// getCommits never returns an empty list (it throws on an empty range, and the rerun check returns all
|
|
13
|
+
// commits when the base commit is the branch HEAD), so this signals a programmer error
|
|
11
14
|
if (commits.length === 0) {
|
|
12
15
|
throw new Error('Cannot get changed files: the commit list is empty. This should never happen.');
|
|
13
16
|
}
|
|
14
|
-
|
|
15
|
-
const changedFiles = changedFilesString.split('\n').filter(Boolean);
|
|
16
|
-
logger.info(`Changed files (up to 50): ${changedFiles.slice(0, 50).join(', ')}`);
|
|
17
|
-
return changedFiles;
|
|
17
|
+
return getChangedFilesBetween(`${commits[0].sha}~`, commits[commits.length - 1].sha);
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* Files that differ between two commits, i.e. changed by the commits in the range (fromRef, toRef]. fromRef's own
|
|
21
|
+
* changes are not included: to include them, pass its parent, `${sha}~` (as getChangedFiles does).
|
|
22
|
+
* Diffing the endpoints, rather than walking a commit list, is what keeps merges right: the oldest commit of a
|
|
23
|
+
* merged branch can predate fromRef, and its changes are already in fromRef.
|
|
23
24
|
*/
|
|
24
|
-
export const
|
|
25
|
-
const
|
|
26
|
-
operation: '
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const parents = (await runGitCommand(['log', '-1', '--pretty=format:%P', sha], {
|
|
32
|
-
operation: 'get parents of a merge commit',
|
|
33
|
-
})).split(' ');
|
|
34
|
-
for (const parent of parents) {
|
|
35
|
-
// git merge-base A B outputs the common ancestor.
|
|
36
|
-
// If that equals A, then A is an ancestor of B (i.e. parent is reachable from targetBranch).
|
|
37
|
-
let mergeBase;
|
|
38
|
-
try {
|
|
39
|
-
mergeBase = await runGitCommand(['merge-base', parent, targetBranch], {
|
|
40
|
-
operation: 'check whether a merge parent is reachable from the target branch',
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
catch (error) {
|
|
44
|
-
// Exit code 1 on merge-base means the histories have no common ancestor.
|
|
45
|
-
if (error instanceof GitCommandError && error.exitCode === 1) {
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
throw error;
|
|
49
|
-
}
|
|
50
|
-
if (mergeBase === parent) {
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return false;
|
|
25
|
+
export const getChangedFilesBetween = async (fromRef, toRef) => {
|
|
26
|
+
const changedFilesString = await runGitCommand(['diff', ...LIST_CHANGED_PATHS, `${fromRef}..${toRef}`], {
|
|
27
|
+
operation: 'get the list of changed files between commits',
|
|
28
|
+
});
|
|
29
|
+
const changedFiles = changedFilesString.split('\n').filter(Boolean);
|
|
30
|
+
logger.info(`Changed files (up to 50): ${changedFiles.slice(0, 50).join(', ')}`);
|
|
31
|
+
return changedFiles;
|
|
56
32
|
};
|
|
57
33
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
34
|
+
* The commit `git diff base...head` compares against: where `head` forked from `base`, or the last commit of `base`
|
|
35
|
+
* that `head` merged in. The diff from it holds only what `head` itself changed, like GitHub's "Files changed" tab.
|
|
36
|
+
* With criss-cross merges there are several such commits and git picks one.
|
|
60
37
|
*/
|
|
61
|
-
export const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
38
|
+
export const getMergeBase = async (base, head) => runGitCommand(['merge-base', base, head], { operation: `find where ${head} forked from ${base}` });
|
|
39
|
+
/** Resolves a ref to a commit, or undefined when it isn't in the local history (e.g. it was force-pushed away). */
|
|
40
|
+
export const findCommitSha = async (ref) => runGitCommand(['rev-parse', '--verify', '--quiet', `${ref}^{commit}`], {
|
|
41
|
+
operation: `look up ${ref} in local Git history`,
|
|
42
|
+
}).catch((error) => {
|
|
43
|
+
// --quiet suppresses Git's error text for a missing commit, but Git still exits with code 1
|
|
44
|
+
if (error instanceof GitCommandError && error.exitCode === 1)
|
|
45
|
+
return undefined;
|
|
46
|
+
throw error;
|
|
47
|
+
});
|
|
65
48
|
const SHA_REGEX = /^[0-9a-f]{40}$/i;
|
|
66
49
|
/**
|
|
67
50
|
*
|
|
@@ -83,10 +66,16 @@ export const parseBaseCommit = (shaOrCommit) => {
|
|
|
83
66
|
}
|
|
84
67
|
return sha;
|
|
85
68
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Commits reachable from toRef but not from fromRef, oldest first: the range (fromRef, toRef], so fromRef itself is
|
|
71
|
+
* not included. To include it, pass its parent, `${sha}~`.
|
|
72
|
+
*/
|
|
73
|
+
export const getCommitsBetween = async (fromRef, toRef) => {
|
|
74
|
+
const output = await runGitCommand(['log', `--pretty=format:${GIT_LOG_FORMAT}`, `${fromRef}..${toRef}`], {
|
|
75
|
+
operation: 'list commits reachable from the source ref but absent from the target ref',
|
|
76
|
+
});
|
|
77
|
+
// An empty range (e.g. `x..x`) prints nothing
|
|
78
|
+
const commits = output.split('\n').filter(Boolean).map(parseCommit);
|
|
90
79
|
commits.reverse();
|
|
91
80
|
return commits;
|
|
92
81
|
};
|
|
@@ -96,7 +85,10 @@ const fetchAllBranchCommits = async (sourceBranch, targetBranch) => {
|
|
|
96
85
|
*/
|
|
97
86
|
export const getCommits = async ({ sourceBranch, targetBranch, baseCommit, }) => {
|
|
98
87
|
const baseCommitSha = parseBaseCommit(baseCommit);
|
|
99
|
-
const commits = await
|
|
88
|
+
const commits = await getCommitsBetween(targetBranch, sourceBranch);
|
|
89
|
+
if (commits.length === 0) {
|
|
90
|
+
throw new Error(`${sourceBranch} has no commits that are not on ${targetBranch}.`);
|
|
91
|
+
}
|
|
100
92
|
// The last validated (base) commit being the branch HEAD means nothing new was pushed since the last
|
|
101
93
|
// validation — the dev reran the workflow (or force-pushed to the same state) to trigger a clean test
|
|
102
94
|
const headSha = commits[commits.length - 1]?.sha;
|
|
@@ -131,18 +123,20 @@ export const parseCommit = (commitString) => {
|
|
|
131
123
|
};
|
|
132
124
|
};
|
|
133
125
|
/**
|
|
134
|
-
* Returns the currently checked-out branch.
|
|
126
|
+
* Returns the currently checked-out branch. Builds point the Actor version at this branch,
|
|
135
127
|
* so a detached HEAD (no branch to point at) is an error rather than a guess.
|
|
136
128
|
*/
|
|
137
129
|
export const getCurrentBranch = async () => {
|
|
138
130
|
const branch = await runGitCommand(['rev-parse', '--abbrev-ref', 'HEAD'], {
|
|
139
|
-
operation: 'determine the
|
|
131
|
+
operation: 'determine the checked-out branch',
|
|
140
132
|
});
|
|
141
133
|
if (branch === 'HEAD') {
|
|
142
|
-
throw new Error('Cannot determine the branch to
|
|
134
|
+
throw new Error('Cannot determine the branch to build from: HEAD is detached. Check out the branch you want to build.');
|
|
143
135
|
}
|
|
144
136
|
return branch;
|
|
145
137
|
};
|
|
138
|
+
/** Resolves a ref (branch, remote branch, SHA, HEAD, ...) to the full SHA of the commit it points to. */
|
|
139
|
+
export const resolveCommitSha = async (ref) => runGitCommand(['rev-parse', '--verify', `${ref}^{commit}`], { operation: `resolve ${ref} to a commit` });
|
|
146
140
|
/**
|
|
147
141
|
* Reads the repository URL from the `origin` remote, rewritten to the SSH form the Apify platform
|
|
148
142
|
* uses for Git repo sources, e.g. git@github.com:apify-store/google-maps
|
|
@@ -190,14 +184,14 @@ const ZERO_SHA_REGEX = /^0{40}$/;
|
|
|
190
184
|
* Unlike the PR path (getCommits), there is no lenient fallback. Falling back to "everything"
|
|
191
185
|
* would rebuild the latest build of every Actor and post it to Slack, so every problem is an error.
|
|
192
186
|
*/
|
|
193
|
-
export const resolveReleaseBaseCommit = async (baseCommit) => {
|
|
187
|
+
export const resolveReleaseBaseCommit = async (baseCommit, head = 'HEAD') => {
|
|
194
188
|
const sha = parseBaseCommit(baseCommit);
|
|
195
189
|
if (!sha) {
|
|
196
|
-
throw new Error('
|
|
190
|
+
throw new Error('A base commit is required for release. See the "Releasing Actors" section of docs/cli.md.');
|
|
197
191
|
}
|
|
198
192
|
if (ZERO_SHA_REGEX.test(sha)) {
|
|
199
193
|
throw new Error(`Base commit is ${sha}, which means the branch was just created and there is no previous release to diff against. ` +
|
|
200
|
-
`Rerun with
|
|
194
|
+
`Rerun with the base commit set to the last commit before the changes you want to release.`);
|
|
201
195
|
}
|
|
202
196
|
// --quiet suppresses Git's error text for a missing commit, but Git still exits with code 1.
|
|
203
197
|
const verifiedSha = await runGitCommand(['rev-parse', '--verify', '--quiet', `${sha}^{commit}`], {
|
|
@@ -212,27 +206,27 @@ export const resolveReleaseBaseCommit = async (baseCommit) => {
|
|
|
212
206
|
`(fetch the full history, e.g. fetch-depth: 0 in actions/checkout) or the branch was force-pushed.`);
|
|
213
207
|
}
|
|
214
208
|
// git merge-base A B outputs the common ancestor. If that equals A, then A is an ancestor of B.
|
|
215
|
-
const mergeBase = await runGitCommand(['merge-base', verifiedSha,
|
|
216
|
-
operation:
|
|
209
|
+
const mergeBase = await runGitCommand(['merge-base', verifiedSha, head], {
|
|
210
|
+
operation: `check whether the release base commit is an ancestor of ${head}`,
|
|
217
211
|
}).catch((error) => {
|
|
218
212
|
if (error instanceof GitCommandError && error.exitCode === 1)
|
|
219
213
|
return '';
|
|
220
214
|
throw error;
|
|
221
215
|
});
|
|
222
216
|
if (mergeBase !== sha) {
|
|
223
|
-
throw new Error(`Base commit ${sha} is not an ancestor of
|
|
224
|
-
`The changed files cannot be determined reliably. Rerun with
|
|
217
|
+
throw new Error(`Base commit ${sha} is not an ancestor of ${head}, most likely because the branch was force-pushed. ` +
|
|
218
|
+
`The changed files cannot be determined reliably. Rerun with the base commit set to an ancestor of ${head} ` +
|
|
225
219
|
`from before the changes you want to release.`);
|
|
226
220
|
}
|
|
227
221
|
return sha;
|
|
228
222
|
};
|
|
229
223
|
const CHANGELOG_PATH = 'CHANGELOG.md';
|
|
230
|
-
/** Returns the lines added to the root CHANGELOG.md between
|
|
231
|
-
const getChangelogAdditions = async (
|
|
224
|
+
/** Returns the lines added to the root CHANGELOG.md between fromRef and toRef, or null if it didn't change. */
|
|
225
|
+
export const getChangelogAdditions = async (fromRef, toRef, changedFiles) => {
|
|
232
226
|
if (!changedFiles.includes(CHANGELOG_PATH)) {
|
|
233
227
|
return null;
|
|
234
228
|
}
|
|
235
|
-
const diff = await runGitCommand(['diff',
|
|
229
|
+
const diff = await runGitCommand(['diff', fromRef, toRef, '--', CHANGELOG_PATH], {
|
|
236
230
|
operation: 'read changelog changes since the last release',
|
|
237
231
|
});
|
|
238
232
|
const added = [];
|
|
@@ -254,21 +248,4 @@ const getChangelogAdditions = async (baseSha, changedFiles) => {
|
|
|
254
248
|
}
|
|
255
249
|
return added.join('\n').trim();
|
|
256
250
|
};
|
|
257
|
-
/**
|
|
258
|
-
* Everything that changed since the last release (baseSha, exclusive) up to HEAD, or null when there
|
|
259
|
-
* are no new commits. Changed files come from diffing the range directly instead of from the commit
|
|
260
|
-
* list: with a merge commit, the oldest commit of the merged branch can be older than baseSha, and
|
|
261
|
-
* diffing from its parent would pull in already-released changes.
|
|
262
|
-
*/
|
|
263
|
-
export const getReleaseChanges = async (baseSha) => {
|
|
264
|
-
if ((await runGitCommand(['rev-parse', 'HEAD'], { operation: 'identify the current release commit' })) === baseSha) {
|
|
265
|
-
return null;
|
|
266
|
-
}
|
|
267
|
-
const commits = await fetchAllBranchCommits('HEAD', baseSha);
|
|
268
|
-
const changedFiles = await runGitCommand(['diff', '--name-only', baseSha, 'HEAD'], {
|
|
269
|
-
operation: 'list files changed since the last release',
|
|
270
|
-
}).then((output) => output.split('\n').filter(Boolean));
|
|
271
|
-
const changelog = await getChangelogAdditions(baseSha, changedFiles);
|
|
272
|
-
return { commits, changedFiles, changelog };
|
|
273
|
-
};
|
|
274
251
|
//# sourceMappingURL=git.js.map
|
package/dist/bin/git.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../bin/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE5D,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAC1C,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,oBAAoB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