nx 23.3.0-beta.7 → 23.3.0-beta.8
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/README.md +1 -1
- package/dist/nx-cloud-internals.d.ts +1 -1
- package/dist/nx-cloud-internals.js +4 -4
- package/dist/src/command-line/migrate/agentic/master/run-master-session.d.ts +6 -2
- package/dist/src/command-line/migrate/agentic/master/run-master-session.js +88 -14
- package/dist/src/command-line/migrate/command-object.d.ts +1 -0
- package/dist/src/command-line/migrate/command-object.js +6 -1
- package/dist/src/command-line/migrate/migrate-analytics.d.ts +34 -9
- package/dist/src/command-line/migrate/migrate-analytics.js +71 -10
- package/dist/src/command-line/migrate/migrate-config.d.ts +5 -2
- package/dist/src/command-line/migrate/migrate-config.js +19 -11
- package/dist/src/command-line/migrate/migrate.d.ts +2 -0
- package/dist/src/command-line/migrate/migrate.js +152 -45
- package/dist/src/command-line/migrate/resolve-package-version.js +2 -19
- package/dist/src/command-line/migrate/run/broker.d.ts +14 -2
- package/dist/src/command-line/migrate/run/broker.js +95 -34
- package/dist/src/command-line/migrate/run/existing-run-report.d.ts +55 -0
- package/dist/src/command-line/migrate/run/existing-run-report.js +225 -0
- package/dist/src/command-line/migrate/run/give-up.d.ts +41 -0
- package/dist/src/command-line/migrate/run/give-up.js +148 -0
- package/dist/src/command-line/migrate/run/index.d.ts +6 -4
- package/dist/src/command-line/migrate/run/index.js +15 -2
- package/dist/src/command-line/migrate/run/issues.d.ts +14 -0
- package/dist/src/command-line/migrate/run/issues.js +59 -0
- package/dist/src/command-line/migrate/run/orchestrator.d.ts +40 -1
- package/dist/src/command-line/migrate/run/orchestrator.js +509 -160
- package/dist/src/command-line/migrate/run/run-id.d.ts +0 -8
- package/dist/src/command-line/migrate/run/run-id.js +0 -30
- package/dist/src/command-line/migrate/run/run-state.d.ts +11 -9
- package/dist/src/command-line/migrate/run/run-state.js +25 -12
- package/dist/src/command-line/migrate/run/runbook.js +9 -4
- package/dist/src/command-line/migrate/run/state-lock.d.ts +31 -0
- package/dist/src/command-line/migrate/run/state-lock.js +126 -0
- package/dist/src/command-line/migrate/run/state-machine.d.ts +15 -0
- package/dist/src/command-line/migrate/run/state-machine.js +137 -10
- package/dist/src/command-line/migrate/run/util.d.ts +1 -0
- package/dist/src/command-line/migrate/run/util.js +21 -0
- package/dist/src/command-line/migrate/run/worker.js +3 -0
- package/dist/src/command-line/migrate/step-actions.d.ts +1 -1
- package/dist/src/command-line/migrate/step-actions.js +7 -1
- package/dist/src/command-line/migrate/text.d.ts +6 -0
- package/dist/src/command-line/migrate/text.js +25 -0
- package/dist/src/command-line/release/utils/release-graph.js +1 -1
- package/dist/src/command-line/release/utils/remote-release-clients/github.js +2 -5
- package/dist/src/command-line/release/utils/remote-release-clients/remote-release-client.d.ts +2 -2
- package/dist/src/command-line/release/utils/remote-release-clients/remote-release-client.js +4 -5
- package/dist/src/command-line/release/version/version-actions.d.ts +3 -0
- package/dist/src/command-line/reset/reset.js +3 -0
- package/dist/src/config/task-graph.d.ts +1 -1
- package/dist/src/config/workspace-json-project-json.d.ts +4 -4
- package/dist/src/daemon/client/client.d.ts +3 -3
- package/dist/src/daemon/client/client.js +4 -4
- package/dist/src/daemon/message-types/ultracache-configuration-version.d.ts +8 -0
- package/dist/src/daemon/server/handle-hash-tasks.d.ts +2 -2
- package/dist/src/daemon/server/handle-hash-tasks.js +3 -3
- package/dist/src/daemon/server/handle-select-affected-tasks.js +4 -2
- package/dist/src/daemon/server/ultracache-configuration-state.d.ts +7 -0
- package/dist/src/daemon/server/{io-snapshots-state.js → ultracache-configuration-state.js} +5 -4
- package/dist/src/hasher/create-task-hasher.d.ts +3 -3
- package/dist/src/hasher/create-task-hasher.js +6 -6
- package/dist/src/hasher/hash-task.d.ts +2 -2
- package/dist/src/hasher/hash-task.js +5 -5
- package/dist/src/hasher/native-task-hasher-impl.d.ts +7 -7
- package/dist/src/hasher/native-task-hasher-impl.js +19 -19
- package/dist/src/hasher/task-hasher.d.ts +14 -14
- package/dist/src/hasher/task-hasher.js +13 -13
- package/dist/src/native/index.d.ts +95 -102
- package/dist/src/native/native-bindings.js +4 -5
- package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
- package/dist/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +15 -8
- package/dist/src/nx-cloud/update-manager.d.ts +3 -3
- package/dist/src/nx-cloud/update-manager.js +19 -13
- package/dist/src/nx-cloud/utilities/is-workspace-claimed.js +2 -1
- package/dist/src/nx-cloud/utilities/nx-cloud-http-client.d.ts +5 -0
- package/dist/src/nx-cloud/utilities/nx-cloud-http-client.js +16 -0
- package/dist/src/nx-cloud/utilities/url-shorten.js +17 -10
- package/dist/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +22 -18
- package/dist/src/project-graph/affected/affected-tasks.d.ts +11 -10
- package/dist/src/project-graph/affected/affected-tasks.js +16 -20
- package/dist/src/tasks-runner/init-tasks-runner.d.ts +5 -5
- package/dist/src/tasks-runner/init-tasks-runner.js +8 -15
- package/dist/src/tasks-runner/run-command.d.ts +7 -7
- package/dist/src/tasks-runner/run-command.js +18 -23
- package/dist/src/ultracache/config.d.ts +21 -0
- package/dist/src/ultracache/config.js +29 -0
- package/dist/src/ultracache/fetch.d.ts +21 -0
- package/dist/src/{io-snapshots → ultracache}/fetch.js +9 -9
- package/dist/src/ultracache/overrides.d.ts +17 -0
- package/dist/src/{io-snapshots → ultracache}/overrides.js +14 -13
- package/dist/src/ultracache/report.d.ts +13 -0
- package/dist/src/{io-snapshots → ultracache}/report.js +15 -21
- package/dist/src/ultracache/store.d.ts +40 -0
- package/dist/src/{io-snapshots → ultracache}/store.js +45 -45
- package/dist/src/utils/ab-testing.js +11 -12
- package/dist/src/utils/db-connection.d.ts +1 -0
- package/dist/src/utils/db-connection.js +1 -0
- package/dist/src/utils/git-utils.d.ts +7 -0
- package/dist/src/utils/git-utils.js +21 -9
- package/dist/src/utils/http-client.d.ts +27 -0
- package/dist/src/utils/http-client.js +193 -0
- package/package.json +12 -38
- package/dist/src/daemon/message-types/io-snapshot-version.d.ts +0 -5
- package/dist/src/daemon/server/io-snapshots-state.d.ts +0 -7
- package/dist/src/io-snapshots/config.d.ts +0 -23
- package/dist/src/io-snapshots/config.js +0 -32
- package/dist/src/io-snapshots/fetch.d.ts +0 -21
- package/dist/src/io-snapshots/outputs.d.ts +0 -12
- package/dist/src/io-snapshots/outputs.js +0 -33
- package/dist/src/io-snapshots/overrides.d.ts +0 -17
- package/dist/src/io-snapshots/report.d.ts +0 -13
- package/dist/src/io-snapshots/store.d.ts +0 -37
- package/dist/src/nx-cloud/utilities/axios.d.ts +0 -4
- package/dist/src/nx-cloud/utilities/axios.js +0 -17
- /package/dist/src/daemon/message-types/{io-snapshot-version.js → ultracache-configuration-version.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const store_1 = require("../../
|
|
3
|
+
exports.getUltracacheConfigurationsForVersion = getUltracacheConfigurationsForVersion;
|
|
4
|
+
const store_1 = require("../../ultracache/store");
|
|
5
5
|
// One handle at a time: entries read for a request serve the next one while
|
|
6
6
|
// the version holds, and another version replaces it, so nothing accumulates
|
|
7
7
|
// over a long-lived daemon.
|
|
@@ -10,7 +10,7 @@ let remembered;
|
|
|
10
10
|
* Exactly the version the client hashes from, never a newer import for the
|
|
11
11
|
* same commit. `undefined` when it is not stored, e.g. after `nx reset`.
|
|
12
12
|
*/
|
|
13
|
-
function
|
|
13
|
+
function getUltracacheConfigurationsForVersion(version) {
|
|
14
14
|
if (!version) {
|
|
15
15
|
return undefined;
|
|
16
16
|
}
|
|
@@ -26,7 +26,8 @@ function getIoSnapshotsForVersion(version) {
|
|
|
26
26
|
}
|
|
27
27
|
function readStored({ commit, fetchedAt, }) {
|
|
28
28
|
try {
|
|
29
|
-
return (0, store_1.
|
|
29
|
+
return ((0, store_1.getUltracacheConfigurationStore)().getVersion(commit, fetchedAt) ??
|
|
30
|
+
undefined);
|
|
30
31
|
}
|
|
31
32
|
catch {
|
|
32
33
|
// An unusable database hashes natively rather than failing the request.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { NxJsonConfiguration } from '../config/nx-json';
|
|
2
2
|
import { ProjectGraph } from '../config/project-graph';
|
|
3
|
-
import type {
|
|
3
|
+
import type { UltracacheConfigurations } from '../native';
|
|
4
4
|
import type { TaskPlanningContext } from './task-planning-context';
|
|
5
5
|
import { TaskHasher } from './task-hasher';
|
|
6
6
|
/**
|
|
7
|
-
* `
|
|
7
|
+
* `ultracacheConfigurations` is this run's set (see `loadUltracacheConfigurationsForRun`); undefined
|
|
8
8
|
* hashes natively. The daemon gets its version, so it hashes from the same
|
|
9
9
|
* set even after a newer one is imported for the commit.
|
|
10
10
|
*/
|
|
11
|
-
export declare function createTaskHasher(projectGraph: ProjectGraph, nxJson: NxJsonConfiguration, runnerOptions?: any,
|
|
11
|
+
export declare function createTaskHasher(projectGraph: ProjectGraph, nxJson: NxJsonConfiguration, runnerOptions?: any, ultracacheConfigurations?: UltracacheConfigurations, planningContext?: TaskPlanningContext): TaskHasher;
|
|
@@ -5,21 +5,21 @@ const client_1 = require("../daemon/client/client");
|
|
|
5
5
|
const build_project_graph_1 = require("../project-graph/build-project-graph");
|
|
6
6
|
const task_hasher_1 = require("./task-hasher");
|
|
7
7
|
/**
|
|
8
|
-
* `
|
|
8
|
+
* `ultracacheConfigurations` is this run's set (see `loadUltracacheConfigurationsForRun`); undefined
|
|
9
9
|
* hashes natively. The daemon gets its version, so it hashes from the same
|
|
10
10
|
* set even after a newer one is imported for the commit.
|
|
11
11
|
*/
|
|
12
|
-
function createTaskHasher(projectGraph, nxJson, runnerOptions,
|
|
12
|
+
function createTaskHasher(projectGraph, nxJson, runnerOptions, ultracacheConfigurations, planningContext) {
|
|
13
13
|
if (client_1.daemonClient.enabled()) {
|
|
14
|
-
return new task_hasher_1.DaemonBasedTaskHasher(client_1.daemonClient, runnerOptions,
|
|
14
|
+
return new task_hasher_1.DaemonBasedTaskHasher(client_1.daemonClient, runnerOptions, ultracacheConfigurations
|
|
15
15
|
? {
|
|
16
|
-
commit:
|
|
17
|
-
fetchedAt:
|
|
16
|
+
commit: ultracacheConfigurations.commit,
|
|
17
|
+
fetchedAt: ultracacheConfigurations.resolution.fetchedAt,
|
|
18
18
|
}
|
|
19
19
|
: undefined);
|
|
20
20
|
}
|
|
21
21
|
else {
|
|
22
22
|
const { rustReferences } = (0, build_project_graph_1.getFileMap)();
|
|
23
|
-
return new task_hasher_1.InProcessTaskHasher(projectGraph, nxJson, rustReferences, runnerOptions, planningContext,
|
|
23
|
+
return new task_hasher_1.InProcessTaskHasher(projectGraph, nxJson, rustReferences, runnerOptions, planningContext, ultracacheConfigurations);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { NxJsonConfiguration } from '../config/nx-json';
|
|
2
2
|
import { ProjectGraph } from '../config/project-graph';
|
|
3
3
|
import { Task, TaskGraph } from '../config/task-graph';
|
|
4
|
-
import { type
|
|
4
|
+
import { type UltracacheConfigurations, TaskDetails } from '../native';
|
|
5
5
|
import { TaskHasher } from './task-hasher';
|
|
6
6
|
export declare function getTaskDetails(): TaskDetails | null;
|
|
7
|
-
export declare function hashTasksThatDoNotDependOnOutputsOfOtherTasks(hasher: TaskHasher, projectGraph: ProjectGraph, taskGraph: TaskGraph, nxJson: NxJsonConfiguration, tasksDetails: TaskDetails | null,
|
|
7
|
+
export declare function hashTasksThatDoNotDependOnOutputsOfOtherTasks(hasher: TaskHasher, projectGraph: ProjectGraph, taskGraph: TaskGraph, nxJson: NxJsonConfiguration, tasksDetails: TaskDetails | null, ultracacheConfigurations?: UltracacheConfigurations): Promise<void>;
|
|
8
8
|
export declare function hashTask(hasher: TaskHasher, projectGraph: ProjectGraph, taskGraph: TaskGraph, task: Task, env: NodeJS.ProcessEnv, taskDetails: TaskDetails | null): Promise<void>;
|
|
9
9
|
/**
|
|
10
10
|
* Batch-hash `tasks`. `perTaskEnvs` must contain an entry keyed by
|
|
@@ -23,13 +23,13 @@ function getTaskDetails() {
|
|
|
23
23
|
}
|
|
24
24
|
return taskDetails;
|
|
25
25
|
}
|
|
26
|
-
async function hashTasksThatDoNotDependOnOutputsOfOtherTasks(hasher, projectGraph, taskGraph, nxJson, tasksDetails,
|
|
26
|
+
async function hashTasksThatDoNotDependOnOutputsOfOtherTasks(hasher, projectGraph, taskGraph, nxJson, tasksDetails, ultracacheConfigurations) {
|
|
27
27
|
performance.mark('hashMultipleTasks:start');
|
|
28
28
|
const projects = (0, project_graph_1.readProjectsConfigurationFromProjectGraph)(projectGraph).projects;
|
|
29
|
-
//
|
|
29
|
+
// An Ultracache configuration can make a task depend on producer outputs its declared
|
|
30
30
|
// inputs never mentioned; those hash after their producers too.
|
|
31
|
-
const
|
|
32
|
-
? new Set((0, native_1.
|
|
31
|
+
const deferredByConfiguration = ultracacheConfigurations
|
|
32
|
+
? new Set((0, native_1.getUltracacheDeferredTaskIds)(ultracacheConfigurations, taskGraph))
|
|
33
33
|
: null;
|
|
34
34
|
const tasks = Object.values(taskGraph.tasks);
|
|
35
35
|
const tasksWithHashers = await Promise.all(tasks.map(async (task) => {
|
|
@@ -42,7 +42,7 @@ async function hashTasksThatDoNotDependOnOutputsOfOtherTasks(hasher, projectGrap
|
|
|
42
42
|
// a continuous server, which only planning reveals.
|
|
43
43
|
const candidates = tasksWithHashers
|
|
44
44
|
.filter(({ task, customHasher }) => !customHasher &&
|
|
45
|
-
!
|
|
45
|
+
!deferredByConfiguration?.has(task.id) &&
|
|
46
46
|
!readsDependencyOutputs(task, taskGraph, projectGraph, nxJson))
|
|
47
47
|
.map((t) => t.task);
|
|
48
48
|
const perTaskEnvs = {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NxJsonConfiguration } from '../config/nx-json';
|
|
2
2
|
import { ProjectGraph } from '../config/project-graph';
|
|
3
3
|
import { Task, TaskGraph } from '../config/task-graph';
|
|
4
|
-
import { ExternalObject, FileData, HasherOptions, HashPlanner,
|
|
4
|
+
import { ExternalObject, FileData, HasherOptions, HashPlanner, UltracacheConfigurations, ProjectGraph as NativeProjectGraph, NxWorkspaceFilesExternals, TaskHasher } from '../native';
|
|
5
5
|
import type { IgnoredIndexReader } from '../native';
|
|
6
6
|
import type { TaskPlanningContext } from './task-planning-context';
|
|
7
7
|
import { PartialHash, TaskHasherImpl } from './task-hasher';
|
|
@@ -22,13 +22,13 @@ export declare class NativeTaskHasherImpl implements TaskHasherImpl {
|
|
|
22
22
|
constructor(workspaceRoot: string, nxJson: NxJsonConfiguration, projectGraph: ProjectGraph, externals: NxWorkspaceFilesExternals, options: {
|
|
23
23
|
selectivelyHashTsConfig: boolean;
|
|
24
24
|
}, planningContext?: TaskPlanningContext);
|
|
25
|
-
hashTask(task: Task, taskGraph: TaskGraph, env: NodeJS.ProcessEnv, cwd?: string, collectInputs?: boolean,
|
|
26
|
-
hashTasks(tasks: Task[], taskGraph: TaskGraph, perTaskEnvs: Record<string, NodeJS.ProcessEnv>, cwd?: string, collectInputs?: boolean,
|
|
25
|
+
hashTask(task: Task, taskGraph: TaskGraph, env: NodeJS.ProcessEnv, cwd?: string, collectInputs?: boolean, ultracacheConfigurations?: UltracacheConfigurations): Promise<PartialHash>;
|
|
26
|
+
hashTasks(tasks: Task[], taskGraph: TaskGraph, perTaskEnvs: Record<string, NodeJS.ProcessEnv>, cwd?: string, collectInputs?: boolean, ultracacheConfigurations?: UltracacheConfigurations): Promise<PartialHash[]>;
|
|
27
27
|
/**
|
|
28
|
-
* Plans through the native planner. With
|
|
29
|
-
* custom-hashed or opted out ride along so the
|
|
30
|
-
* withholds their
|
|
28
|
+
* Plans through the native planner. With Ultracache configurations, the
|
|
29
|
+
* tasks JS resolves as custom-hashed or opted out ride along so the
|
|
30
|
+
* planner's eligibility walk withholds their entries.
|
|
31
31
|
*/
|
|
32
32
|
private plan;
|
|
33
|
-
hashTasksUpfront(tasks: Task[], taskGraph: TaskGraph, perTaskEnvs: Record<string, NodeJS.ProcessEnv>, cwd?: string, collectInputs?: boolean,
|
|
33
|
+
hashTasksUpfront(tasks: Task[], taskGraph: TaskGraph, perTaskEnvs: Record<string, NodeJS.ProcessEnv>, cwd?: string, collectInputs?: boolean, ultracacheConfigurations?: UltracacheConfigurations): Promise<Record<string, PartialHash>>;
|
|
34
34
|
}
|
|
@@ -6,7 +6,7 @@ const transform_objects_1 = require("../native/transform-objects");
|
|
|
6
6
|
const typescript_1 = require("../plugins/js/utils/typescript");
|
|
7
7
|
const task_io_service_1 = require("../tasks-runner/task-io-service");
|
|
8
8
|
const fileutils_1 = require("../utils/fileutils");
|
|
9
|
-
const overrides_1 = require("../
|
|
9
|
+
const overrides_1 = require("../ultracache/overrides");
|
|
10
10
|
class NativeTaskHasherImpl {
|
|
11
11
|
constructor(workspaceRoot, nxJson, projectGraph, externals, options, planningContext) {
|
|
12
12
|
this.projectGraph = projectGraph;
|
|
@@ -36,11 +36,11 @@ class NativeTaskHasherImpl {
|
|
|
36
36
|
planningContext?.planner ?? new native_1.HashPlanner(nxJson, this.projectGraphRef);
|
|
37
37
|
this.hasher = new native_1.TaskHasher(workspaceRoot, this.projectGraphRef, this.projectFileMapRef, this.allWorkspaceFilesRef, Buffer.from(JSON.stringify(tsconfig)), paths, rootTsConfigPath, options, this.ignoredIndexRef);
|
|
38
38
|
}
|
|
39
|
-
async hashTask(task, taskGraph, env, cwd, collectInputs,
|
|
40
|
-
const hashes = await this.hashTasks([task], taskGraph, { [task.id]: env }, cwd, collectInputs,
|
|
39
|
+
async hashTask(task, taskGraph, env, cwd, collectInputs, ultracacheConfigurations) {
|
|
40
|
+
const hashes = await this.hashTasks([task], taskGraph, { [task.id]: env }, cwd, collectInputs, ultracacheConfigurations);
|
|
41
41
|
return hashes[0];
|
|
42
42
|
}
|
|
43
|
-
async hashTasks(tasks, taskGraph, perTaskEnvs, cwd, collectInputs,
|
|
43
|
+
async hashTasks(tasks, taskGraph, perTaskEnvs, cwd, collectInputs, ultracacheConfigurations) {
|
|
44
44
|
const envs = perTaskEnvs;
|
|
45
45
|
const shouldCollectInputs = collectInputs ?? (0, task_io_service_1.getTaskIOService)().hasTaskInputSubscribers();
|
|
46
46
|
const resolvedCwd = cwd ?? process.cwd();
|
|
@@ -49,31 +49,31 @@ class NativeTaskHasherImpl {
|
|
|
49
49
|
if (this.upfrontPlans &&
|
|
50
50
|
unplanned.some((id) => this.upfrontPlans.taskIds.has(id)) &&
|
|
51
51
|
this.upfrontPlans.fingerprint ===
|
|
52
|
-
taskGraphFingerprint(taskGraph,
|
|
52
|
+
taskGraphFingerprint(taskGraph, ultracacheConfigurations)) {
|
|
53
53
|
Object.assign(hashes, this.hasher.hashPlansFor(this.upfrontPlans.plans, unplanned, envs, resolvedCwd, shouldCollectInputs));
|
|
54
54
|
unplanned = unplanned.filter((id) => !(id in hashes));
|
|
55
55
|
}
|
|
56
56
|
if (unplanned.length > 0) {
|
|
57
|
-
const plans = this.plan(unplanned, taskGraph,
|
|
57
|
+
const plans = this.plan(unplanned, taskGraph, ultracacheConfigurations);
|
|
58
58
|
Object.assign(hashes, this.hasher.hashPlans(plans, envs, resolvedCwd, shouldCollectInputs));
|
|
59
59
|
}
|
|
60
60
|
return tasks.map((t) => hashes[t.id]);
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
|
-
* Plans through the native planner. With
|
|
64
|
-
* custom-hashed or opted out ride along so the
|
|
65
|
-
* withholds their
|
|
63
|
+
* Plans through the native planner. With Ultracache configurations, the
|
|
64
|
+
* tasks JS resolves as custom-hashed or opted out ride along so the
|
|
65
|
+
* planner's eligibility walk withholds their entries.
|
|
66
66
|
*/
|
|
67
|
-
plan(taskIds, taskGraph,
|
|
68
|
-
if (!
|
|
67
|
+
plan(taskIds, taskGraph, ultracacheConfigurations) {
|
|
68
|
+
if (!ultracacheConfigurations) {
|
|
69
69
|
return this.planner.getPlansReference(taskIds, taskGraph);
|
|
70
70
|
}
|
|
71
|
-
return this.planner.getPlansReference(taskIds, taskGraph,
|
|
71
|
+
return this.planner.getPlansReference(taskIds, taskGraph, ultracacheConfigurations, (0, overrides_1.ultracacheEligibilityOptions)(this.projectGraph, taskGraph));
|
|
72
72
|
}
|
|
73
|
-
async hashTasksUpfront(tasks, taskGraph, perTaskEnvs, cwd, collectInputs,
|
|
74
|
-
const plans = this.plan(tasks.map((t) => t.id), taskGraph,
|
|
73
|
+
async hashTasksUpfront(tasks, taskGraph, perTaskEnvs, cwd, collectInputs, ultracacheConfigurations) {
|
|
74
|
+
const plans = this.plan(tasks.map((t) => t.id), taskGraph, ultracacheConfigurations);
|
|
75
75
|
this.upfrontPlans = {
|
|
76
|
-
fingerprint: taskGraphFingerprint(taskGraph,
|
|
76
|
+
fingerprint: taskGraphFingerprint(taskGraph, ultracacheConfigurations),
|
|
77
77
|
taskIds: new Set(tasks.map((t) => t.id)),
|
|
78
78
|
plans,
|
|
79
79
|
};
|
|
@@ -84,16 +84,16 @@ class NativeTaskHasherImpl {
|
|
|
84
84
|
exports.NativeTaskHasherImpl = NativeTaskHasherImpl;
|
|
85
85
|
/**
|
|
86
86
|
* Everything the planner reads from a task graph: each task's target and
|
|
87
|
-
* outputs, and the graph's edges, plus the
|
|
87
|
+
* outputs, and the graph's edges, plus the Ultracache configurations the plans were
|
|
88
88
|
* built against. The project graph and nx.json are fixed for the life of a
|
|
89
89
|
* hasher, so equal fingerprints mean equal plans. A run's
|
|
90
90
|
* results (hash, timings) are left out so hashing one task does not
|
|
91
91
|
* invalidate the plans of the rest.
|
|
92
92
|
*/
|
|
93
|
-
function taskGraphFingerprint(taskGraph,
|
|
93
|
+
function taskGraphFingerprint(taskGraph, ultracacheConfigurations) {
|
|
94
94
|
const parts = [
|
|
95
|
-
|
|
96
|
-
? `${
|
|
95
|
+
ultracacheConfigurations
|
|
96
|
+
? `${ultracacheConfigurations.commit}@${ultracacheConfigurations.resolution.fetchedAt}`
|
|
97
97
|
: '',
|
|
98
98
|
];
|
|
99
99
|
for (const id of Object.keys(taskGraph.tasks).sort()) {
|
|
@@ -2,10 +2,10 @@ import { FileData, ProjectGraph, ProjectGraphProjectNode } from '../config/proje
|
|
|
2
2
|
import { NxJsonConfiguration } from '../config/nx-json';
|
|
3
3
|
import { Task, TaskGraph } from '../config/task-graph';
|
|
4
4
|
import { DaemonClient } from '../daemon/client/client';
|
|
5
|
-
import type {
|
|
5
|
+
import type { UltracacheConfigurationVersion } from '../daemon/message-types/ultracache-configuration-version';
|
|
6
6
|
import { InputDefinition } from '../config/workspace-json-project-json';
|
|
7
7
|
import type { TaskPlanningContext } from './task-planning-context';
|
|
8
|
-
import { HashInputs,
|
|
8
|
+
import { HashInputs, UltracacheConfigurations, NxWorkspaceFilesExternals } from '../native';
|
|
9
9
|
export { HashInputs };
|
|
10
10
|
/**
|
|
11
11
|
* A data structure returned by the default hasher.
|
|
@@ -76,16 +76,16 @@ export interface TaskHasherImpl {
|
|
|
76
76
|
* single shared env should construct `{ [task.id]: env }` for every
|
|
77
77
|
* task.
|
|
78
78
|
*/
|
|
79
|
-
hashTasks(tasks: Task[], taskGraph: TaskGraph, perTaskEnvs: Record<string, NodeJS.ProcessEnv>, cwd?: string, collectInputs?: boolean,
|
|
80
|
-
hashTask(task: Task, taskGraph: TaskGraph, env: NodeJS.ProcessEnv, cwd?: string, collectInputs?: boolean,
|
|
81
|
-
hashTasksUpfront(tasks: Task[], taskGraph: TaskGraph, perTaskEnvs: Record<string, NodeJS.ProcessEnv>, cwd?: string, collectInputs?: boolean,
|
|
79
|
+
hashTasks(tasks: Task[], taskGraph: TaskGraph, perTaskEnvs: Record<string, NodeJS.ProcessEnv>, cwd?: string, collectInputs?: boolean, ultracacheConfigurations?: UltracacheConfigurations): Promise<PartialHash[]>;
|
|
80
|
+
hashTask(task: Task, taskGraph: TaskGraph, env: NodeJS.ProcessEnv, cwd?: string, collectInputs?: boolean, ultracacheConfigurations?: UltracacheConfigurations): Promise<PartialHash>;
|
|
81
|
+
hashTasksUpfront(tasks: Task[], taskGraph: TaskGraph, perTaskEnvs: Record<string, NodeJS.ProcessEnv>, cwd?: string, collectInputs?: boolean, ultracacheConfigurations?: UltracacheConfigurations): Promise<Record<string, PartialHash>>;
|
|
82
82
|
}
|
|
83
83
|
export type Hasher = TaskHasher;
|
|
84
84
|
export declare class DaemonBasedTaskHasher implements TaskHasher {
|
|
85
85
|
private readonly daemonClient;
|
|
86
86
|
private readonly runnerOptions;
|
|
87
|
-
private readonly
|
|
88
|
-
constructor(daemonClient: DaemonClient, runnerOptions: any,
|
|
87
|
+
private readonly ultracacheConfigurationsVersion?;
|
|
88
|
+
constructor(daemonClient: DaemonClient, runnerOptions: any, ultracacheConfigurationsVersion?: UltracacheConfigurationVersion);
|
|
89
89
|
hashTasks(tasks: Task[], taskGraph: TaskGraph, envOrPerTaskEnvs: NodeJS.ProcessEnv | Record<string, NodeJS.ProcessEnv>): Promise<Hash[]>;
|
|
90
90
|
hashTasksUpfront(tasks: Task[], taskGraph: TaskGraph, perTaskEnvs: Record<string, NodeJS.ProcessEnv>): Promise<Record<string, Hash>>;
|
|
91
91
|
hashTask(task: Task, taskGraph?: TaskGraph, env?: NodeJS.ProcessEnv): Promise<Hash>;
|
|
@@ -96,15 +96,15 @@ export declare class InProcessTaskHasher implements TaskHasher {
|
|
|
96
96
|
private readonly externalRustReferences;
|
|
97
97
|
private readonly options;
|
|
98
98
|
private readonly planningContext?;
|
|
99
|
-
/** This run's
|
|
100
|
-
private readonly
|
|
99
|
+
/** This run's Ultracache configurations; the daemon passes them per request instead. */
|
|
100
|
+
private readonly ultracacheConfigurations?;
|
|
101
101
|
private taskHasher;
|
|
102
102
|
constructor(projectGraph: ProjectGraph, nxJson: NxJsonConfiguration, externalRustReferences: NxWorkspaceFilesExternals | null, options: any, planningContext?: TaskPlanningContext,
|
|
103
|
-
/** This run's
|
|
104
|
-
|
|
105
|
-
hashTasks(tasks: Task[], taskGraph: TaskGraph, envOrPerTaskEnvs: NodeJS.ProcessEnv | Record<string, NodeJS.ProcessEnv>, cwd?: string, collectInputs?: boolean,
|
|
106
|
-
hashTasksUpfront(tasks: Task[], taskGraph: TaskGraph, perTaskEnvs: Record<string, NodeJS.ProcessEnv>, cwd?: string, collectInputs?: boolean,
|
|
107
|
-
hashTask(task: Task, taskGraph?: TaskGraph, env?: NodeJS.ProcessEnv, cwd?: string, collectInputs?: boolean,
|
|
103
|
+
/** This run's Ultracache configurations; the daemon passes them per request instead. */
|
|
104
|
+
ultracacheConfigurations?: UltracacheConfigurations);
|
|
105
|
+
hashTasks(tasks: Task[], taskGraph: TaskGraph, envOrPerTaskEnvs: NodeJS.ProcessEnv | Record<string, NodeJS.ProcessEnv>, cwd?: string, collectInputs?: boolean, ultracacheConfigurations?: UltracacheConfigurations): Promise<Hash[]>;
|
|
106
|
+
hashTasksUpfront(tasks: Task[], taskGraph: TaskGraph, perTaskEnvs: Record<string, NodeJS.ProcessEnv>, cwd?: string, collectInputs?: boolean, ultracacheConfigurations?: UltracacheConfigurations): Promise<Record<string, Hash>>;
|
|
107
|
+
hashTask(task: Task, taskGraph?: TaskGraph, env?: NodeJS.ProcessEnv, cwd?: string, collectInputs?: boolean, ultracacheConfigurations?: UltracacheConfigurations): Promise<Hash>;
|
|
108
108
|
private createHashDetails;
|
|
109
109
|
private hashCommand;
|
|
110
110
|
}
|
|
@@ -44,18 +44,18 @@ function normalizePerTaskEnvs(tasks, arg) {
|
|
|
44
44
|
return arg;
|
|
45
45
|
}
|
|
46
46
|
class DaemonBasedTaskHasher {
|
|
47
|
-
constructor(daemonClient, runnerOptions,
|
|
47
|
+
constructor(daemonClient, runnerOptions, ultracacheConfigurationsVersion) {
|
|
48
48
|
this.daemonClient = daemonClient;
|
|
49
49
|
this.runnerOptions = runnerOptions;
|
|
50
|
-
this.
|
|
50
|
+
this.ultracacheConfigurationsVersion = ultracacheConfigurationsVersion;
|
|
51
51
|
}
|
|
52
52
|
async hashTasks(tasks, taskGraph, envOrPerTaskEnvs) {
|
|
53
53
|
const collectInputs = (0, task_io_service_1.getTaskIOService)().hasTaskInputSubscribers();
|
|
54
|
-
return this.daemonClient.hashTasks(this.runnerOptions, tasks, taskGraph, normalizePerTaskEnvs(tasks, envOrPerTaskEnvs), process.cwd(), collectInputs, this.
|
|
54
|
+
return this.daemonClient.hashTasks(this.runnerOptions, tasks, taskGraph, normalizePerTaskEnvs(tasks, envOrPerTaskEnvs), process.cwd(), collectInputs, this.ultracacheConfigurationsVersion);
|
|
55
55
|
}
|
|
56
56
|
async hashTasksUpfront(tasks, taskGraph, perTaskEnvs) {
|
|
57
57
|
const collectInputs = (0, task_io_service_1.getTaskIOService)().hasTaskInputSubscribers();
|
|
58
|
-
return this.daemonClient.hashTasksUpfront(this.runnerOptions, tasks, taskGraph, perTaskEnvs, process.cwd(), collectInputs, this.
|
|
58
|
+
return this.daemonClient.hashTasksUpfront(this.runnerOptions, tasks, taskGraph, perTaskEnvs, process.cwd(), collectInputs, this.ultracacheConfigurationsVersion);
|
|
59
59
|
}
|
|
60
60
|
async hashTask(task, taskGraph, env) {
|
|
61
61
|
return (await this.hashTasks([task], taskGraph, {
|
|
@@ -66,24 +66,24 @@ class DaemonBasedTaskHasher {
|
|
|
66
66
|
exports.DaemonBasedTaskHasher = DaemonBasedTaskHasher;
|
|
67
67
|
class InProcessTaskHasher {
|
|
68
68
|
constructor(projectGraph, nxJson, externalRustReferences, options, planningContext,
|
|
69
|
-
/** This run's
|
|
70
|
-
|
|
69
|
+
/** This run's Ultracache configurations; the daemon passes them per request instead. */
|
|
70
|
+
ultracacheConfigurations) {
|
|
71
71
|
this.projectGraph = projectGraph;
|
|
72
72
|
this.nxJson = nxJson;
|
|
73
73
|
this.externalRustReferences = externalRustReferences;
|
|
74
74
|
this.options = options;
|
|
75
75
|
this.planningContext = planningContext;
|
|
76
|
-
this.
|
|
76
|
+
this.ultracacheConfigurations = ultracacheConfigurations;
|
|
77
77
|
this.taskHasher = new native_task_hasher_impl_1.NativeTaskHasherImpl(workspace_root_1.workspaceRoot, this.nxJson, this.projectGraph, this.externalRustReferences, {
|
|
78
78
|
selectivelyHashTsConfig: this.options?.selectivelyHashTsConfig ?? false,
|
|
79
79
|
}, this.planningContext);
|
|
80
80
|
}
|
|
81
|
-
async hashTasks(tasks, taskGraph, envOrPerTaskEnvs, cwd, collectInputs,
|
|
82
|
-
const hashes = await this.taskHasher.hashTasks(tasks, taskGraph, normalizePerTaskEnvs(tasks, envOrPerTaskEnvs), cwd ?? process.cwd(), collectInputs,
|
|
81
|
+
async hashTasks(tasks, taskGraph, envOrPerTaskEnvs, cwd, collectInputs, ultracacheConfigurations) {
|
|
82
|
+
const hashes = await this.taskHasher.hashTasks(tasks, taskGraph, normalizePerTaskEnvs(tasks, envOrPerTaskEnvs), cwd ?? process.cwd(), collectInputs, ultracacheConfigurations ?? this.ultracacheConfigurations);
|
|
83
83
|
return tasks.map((task, index) => this.createHashDetails(task, hashes[index]));
|
|
84
84
|
}
|
|
85
|
-
async hashTasksUpfront(tasks, taskGraph, perTaskEnvs, cwd, collectInputs,
|
|
86
|
-
const hashes = await this.taskHasher.hashTasksUpfront(tasks, taskGraph, perTaskEnvs, cwd ?? process.cwd(), collectInputs,
|
|
85
|
+
async hashTasksUpfront(tasks, taskGraph, perTaskEnvs, cwd, collectInputs, ultracacheConfigurations) {
|
|
86
|
+
const hashes = await this.taskHasher.hashTasksUpfront(tasks, taskGraph, perTaskEnvs, cwd ?? process.cwd(), collectInputs, ultracacheConfigurations ?? this.ultracacheConfigurations);
|
|
87
87
|
const result = {};
|
|
88
88
|
for (const task of tasks) {
|
|
89
89
|
if (hashes[task.id]) {
|
|
@@ -92,8 +92,8 @@ class InProcessTaskHasher {
|
|
|
92
92
|
}
|
|
93
93
|
return result;
|
|
94
94
|
}
|
|
95
|
-
async hashTask(task, taskGraph, env, cwd, collectInputs,
|
|
96
|
-
const res = await this.taskHasher.hashTask(task, taskGraph, env ?? process.env, cwd ?? process.cwd(), collectInputs,
|
|
95
|
+
async hashTask(task, taskGraph, env, cwd, collectInputs, ultracacheConfigurations) {
|
|
96
|
+
const res = await this.taskHasher.hashTask(task, taskGraph, env ?? process.env, cwd ?? process.cwd(), collectInputs, ultracacheConfigurations ?? this.ultracacheConfigurations);
|
|
97
97
|
return this.createHashDetails(task, res);
|
|
98
98
|
}
|
|
99
99
|
createHashDetails(task, res) {
|
|
@@ -97,13 +97,13 @@ export declare class HashPlanInspector {
|
|
|
97
97
|
export declare class HashPlanner {
|
|
98
98
|
constructor(nxJson: NxJson, projectGraph: ExternalObject<ProjectGraph>)
|
|
99
99
|
/**
|
|
100
|
-
* `
|
|
101
|
-
* entry hashes its observed reads instead of its declared filesets.
|
|
100
|
+
* `configurations` is this run's Ultracache configurations; a task with an
|
|
101
|
+
* eligible entry hashes its observed reads instead of its declared filesets.
|
|
102
102
|
* `options` carries the task ids decided in JS, where executors and
|
|
103
103
|
* target configuration are resolved.
|
|
104
104
|
*/
|
|
105
|
-
getPlans(taskIds: Array<string>, taskGraph: TaskGraph,
|
|
106
|
-
getPlansReference(taskIds: Array<string>, taskGraph: TaskGraph,
|
|
105
|
+
getPlans(taskIds: Array<string>, taskGraph: TaskGraph, configurations?: UltracacheConfigurations | undefined | null, options?: UltracacheEligibilityOptions | undefined | null): Record<string, string[]>
|
|
106
|
+
getPlansReference(taskIds: Array<string>, taskGraph: TaskGraph, configurations?: UltracacheConfigurations | undefined | null, options?: UltracacheEligibilityOptions | undefined | null): ExternalObject<Record<string, Array<HashInstruction>>>
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
export declare class HttpRemoteCache {
|
|
@@ -127,43 +127,6 @@ export declare class ImportResult {
|
|
|
127
127
|
staticImportExpressions: Array<string>
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
/**
|
|
131
|
-
* One stored version of a commit's snapshot set. Handed to the hash planner as-is.
|
|
132
|
-
* A fresh import holds every entry; a handle reopened from storage reads
|
|
133
|
-
* them per task as they are asked for and remembers them, so it costs the
|
|
134
|
-
* tasks it plans rather than the workspace's whole set.
|
|
135
|
-
*/
|
|
136
|
-
export declare class IoSnapshots {
|
|
137
|
-
get commit(): string
|
|
138
|
-
get resolution(): IoSnapshotResolution
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* The workspace database's snapshot sets. Each import is its own version,
|
|
143
|
-
* keyed by commit and fetch time, so a run that pinned one keeps reading it
|
|
144
|
-
* while a newer one is imported. Failures throw with a `code` JS maps to a
|
|
145
|
-
* skip reason: `STORE_UNAVAILABLE`, `INVALID_RESPONSE` or `WRITE_FAILED`.
|
|
146
|
-
*/
|
|
147
|
-
export declare class IoSnapshotStore {
|
|
148
|
-
constructor(db: ExternalObject<NxDbConnection>)
|
|
149
|
-
/**
|
|
150
|
-
* Stores the set the Nx Cloud client read for `requested_commit` as a new
|
|
151
|
-
* version, and returns it with every entry in hand.
|
|
152
|
-
*/
|
|
153
|
-
import(options: IoSnapshotImportOptions): IoSnapshots
|
|
154
|
-
/**
|
|
155
|
-
* The newest stored set for `commit`, without touching the network;
|
|
156
|
-
* `null` when none is stored, its row cannot be read, or it was fetched
|
|
157
|
-
* more than `max_age_ms` ago. Reads only the version's summary row.
|
|
158
|
-
*/
|
|
159
|
-
get(commit: string, maxAgeMs?: number | undefined | null): IoSnapshots | null
|
|
160
|
-
/**
|
|
161
|
-
* Exactly the version of `commit` fetched at `fetched_at`; `null` when it
|
|
162
|
-
* is not stored or its row cannot be read.
|
|
163
|
-
*/
|
|
164
|
-
getVersion(commit: string, fetchedAt: number): IoSnapshots | null
|
|
165
|
-
}
|
|
166
|
-
|
|
167
130
|
export declare class NxCache {
|
|
168
131
|
cacheDirectory: string
|
|
169
132
|
constructor(workspaceRoot: string, cachePath: string, dbConnection: ExternalObject<NxDbConnection>, linkTaskDetails?: boolean | undefined | null, maxCacheSize?: number | undefined | null)
|
|
@@ -325,6 +288,43 @@ export declare class TaskInvocationTracker {
|
|
|
325
288
|
cleanupStale(): void
|
|
326
289
|
}
|
|
327
290
|
|
|
291
|
+
/**
|
|
292
|
+
* One stored version of a commit's Ultracache configurations. Handed to the hash planner as-is.
|
|
293
|
+
* A fresh import holds every entry; a handle reopened from storage reads
|
|
294
|
+
* them per task as they are asked for and remembers them, so it costs the
|
|
295
|
+
* tasks it plans rather than the workspace's whole set.
|
|
296
|
+
*/
|
|
297
|
+
export declare class UltracacheConfigurations {
|
|
298
|
+
get commit(): string
|
|
299
|
+
get resolution(): UltracacheConfigurationResolution
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* The workspace database's Ultracache configurations. Each import is its own version,
|
|
304
|
+
* keyed by commit and fetch time, so a run that pinned one keeps reading it
|
|
305
|
+
* while a newer one is imported. Failures throw with a `code` JS maps to a
|
|
306
|
+
* skip reason: `STORE_UNAVAILABLE`, `INVALID_RESPONSE` or `WRITE_FAILED`.
|
|
307
|
+
*/
|
|
308
|
+
export declare class UltracacheConfigurationStore {
|
|
309
|
+
constructor(db: ExternalObject<NxDbConnection>)
|
|
310
|
+
/**
|
|
311
|
+
* Stores the set the Nx Cloud client read for `requested_commit` as a new
|
|
312
|
+
* version, and returns it with every entry in hand.
|
|
313
|
+
*/
|
|
314
|
+
import(options: UltracacheConfigurationImportOptions): UltracacheConfigurations
|
|
315
|
+
/**
|
|
316
|
+
* The newest stored set for `commit`, without touching the network;
|
|
317
|
+
* `null` when none is stored, its row cannot be read, or it was fetched
|
|
318
|
+
* more than `max_age_ms` ago. Reads only the version's summary row.
|
|
319
|
+
*/
|
|
320
|
+
get(commit: string, maxAgeMs?: number | undefined | null): UltracacheConfigurations | null
|
|
321
|
+
/**
|
|
322
|
+
* Exactly the version of `commit` fetched at `fetched_at`; `null` when it
|
|
323
|
+
* is not stored or its row cannot be read.
|
|
324
|
+
*/
|
|
325
|
+
getVersion(commit: string, fetchedAt: number): UltracacheConfigurations | null
|
|
326
|
+
}
|
|
327
|
+
|
|
328
328
|
export declare class WorkspaceContext {
|
|
329
329
|
workspaceRoot: string
|
|
330
330
|
constructor(workspaceRoot: string, cacheDir: string, options?: WorkspaceContextOptions | undefined | null)
|
|
@@ -712,31 +712,26 @@ export declare function getFilesForOutputsBatch(directory: string, entriesBatch:
|
|
|
712
712
|
*/
|
|
713
713
|
export declare function getHardcodedIgnorePatterns(): Array<string>
|
|
714
714
|
|
|
715
|
-
/**
|
|
716
|
-
* Tasks whose snapshot read another task's outputs: they hash after their
|
|
717
|
-
* producers ran, because those files only exist then. Needs no project graph,
|
|
718
|
-
* so the client can call it before the first hashing wave on the daemon path.
|
|
719
|
-
* Opted-out and custom-hasher tasks are not excluded: deferring a task that
|
|
720
|
-
* ends up hashed natively only delays its hash, it never changes it.
|
|
721
|
-
*/
|
|
722
|
-
export declare function getIoSnapshotDeferredTaskIds(snapshots: IoSnapshots, taskGraph: TaskGraph): Array<string>
|
|
723
|
-
|
|
724
|
-
/** The eligibility report, for the run summary. */
|
|
725
|
-
export declare function getIoSnapshotReport(snapshots: IoSnapshots, tasks: Record<string, TaskUltracacheConfiguration | null>, options?: IoSnapshotEligibilityOptions | undefined | null): IoSnapshotReport
|
|
726
|
-
|
|
727
715
|
/**
|
|
728
716
|
* If `workspace_root` is inside a git worktree, returns the main repo root.
|
|
729
717
|
* Returns `None` when already in the main repo (or not in a git repo at all).
|
|
730
718
|
*/
|
|
731
719
|
export declare function getMainWorktreeRoot(workspaceRoot: string): string | null
|
|
732
720
|
|
|
721
|
+
export declare function getTransformableOutputs(outputs: Array<string>): Array<string>
|
|
722
|
+
|
|
733
723
|
/**
|
|
734
|
-
*
|
|
735
|
-
*
|
|
724
|
+
* Tasks whose Ultracache configuration read another task's outputs: they
|
|
725
|
+
* hash after their producers ran, because those files only exist then. Needs
|
|
726
|
+
* no project graph, so the client can call it before the first hashing wave
|
|
727
|
+
* on the daemon path.
|
|
728
|
+
* Opted-out and custom-hasher tasks are not excluded: deferring a task that
|
|
729
|
+
* ends up hashed natively only delays its hash, it never changes it.
|
|
736
730
|
*/
|
|
737
|
-
export declare function
|
|
731
|
+
export declare function getUltracacheDeferredTaskIds(configurations: UltracacheConfigurations, taskGraph: TaskGraph): Array<string>
|
|
738
732
|
|
|
739
|
-
|
|
733
|
+
/** The eligibility report, for the run summary. */
|
|
734
|
+
export declare function getUltracacheReport(configurations: UltracacheConfigurations, tasks: Record<string, TaskUltracacheSettings | null>, options?: UltracacheEligibilityOptions | undefined | null): UltracacheReport
|
|
740
735
|
|
|
741
736
|
/**
|
|
742
737
|
* Group information - union of different process group types
|
|
@@ -830,46 +825,6 @@ export interface InvocationRecord {
|
|
|
830
825
|
taskId: string
|
|
831
826
|
}
|
|
832
827
|
|
|
833
|
-
/**
|
|
834
|
-
* Why a task (or the whole run) hashes natively; `reason` is rendered by the
|
|
835
|
-
* run summary.
|
|
836
|
-
*/
|
|
837
|
-
export interface IoSnapshotDiagnostic {
|
|
838
|
-
reason: string
|
|
839
|
-
taskId?: string
|
|
840
|
-
glob?: string
|
|
841
|
-
message?: string
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
/** What JS knows about a run's tasks that the eligibility walk needs. */
|
|
845
|
-
export interface IoSnapshotEligibilityOptions {
|
|
846
|
-
/** Tasks whose executor ships a custom hasher. */
|
|
847
|
-
customHasherTaskIds?: Array<string>
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
/** The snapshot set the Nx Cloud client read for HEAD, as JS hands it over. */
|
|
851
|
-
export interface IoSnapshotImportOptions {
|
|
852
|
-
requestedCommit: string
|
|
853
|
-
/** `Record<taskId, { commit, inputs, outputs }>` as JSON. */
|
|
854
|
-
snapshotsJson: string
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
export interface IoSnapshotReport {
|
|
858
|
-
/** Task ids hashed from their snapshot. */
|
|
859
|
-
used: Array<string>
|
|
860
|
-
/** Subset of `used` whose snapshot also contributes observed outputs. */
|
|
861
|
-
tasksWithOutputs: Array<string>
|
|
862
|
-
diagnostics: Array<IoSnapshotDiagnostic>
|
|
863
|
-
resolution: IoSnapshotResolution
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
/** What was resolved for a commit; stored beside its entries. */
|
|
867
|
-
export interface IoSnapshotResolution {
|
|
868
|
-
requestedCommit: string
|
|
869
|
-
fetchedAt: number
|
|
870
|
-
tasks: number
|
|
871
|
-
}
|
|
872
|
-
|
|
873
828
|
export const IS_WASM: boolean
|
|
874
829
|
|
|
875
830
|
/**
|
|
@@ -1134,8 +1089,8 @@ export interface Task {
|
|
|
1134
1089
|
parallelism?: boolean
|
|
1135
1090
|
/** This denotes if the task runs continuously */
|
|
1136
1091
|
continuous?: boolean
|
|
1137
|
-
/** The target's
|
|
1138
|
-
ultracache?:
|
|
1092
|
+
/** The target's Ultracache settings, if declared */
|
|
1093
|
+
ultracache?: TaskUltracacheSettings
|
|
1139
1094
|
}
|
|
1140
1095
|
|
|
1141
1096
|
/** Graph of Tasks to be executed */
|
|
@@ -1204,8 +1159,8 @@ export interface TaskTarget {
|
|
|
1204
1159
|
configuration?: string
|
|
1205
1160
|
}
|
|
1206
1161
|
|
|
1207
|
-
/** Ultracache
|
|
1208
|
-
export interface
|
|
1162
|
+
/** Ultracache settings of a task's target */
|
|
1163
|
+
export interface TaskUltracacheSettings {
|
|
1209
1164
|
/** How this target's tasks participate. Defaults to `on`. */
|
|
1210
1165
|
mode?: 'on' | 'warn' | 'error' | 'off'
|
|
1211
1166
|
/**
|
|
@@ -1257,8 +1212,39 @@ export interface TuiConfig {
|
|
|
1257
1212
|
suppressHints?: boolean
|
|
1258
1213
|
}
|
|
1259
1214
|
|
|
1215
|
+
/** The Ultracache configurations the Nx Cloud client read for HEAD, as JS hands them over. */
|
|
1216
|
+
export interface UltracacheConfigurationImportOptions {
|
|
1217
|
+
requestedCommit: string
|
|
1218
|
+
/** `Record<taskId, { commit, inputs, outputs }>` as JSON. */
|
|
1219
|
+
configurationsJson: string
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
/** What was resolved for a commit; stored beside its entries. */
|
|
1223
|
+
export interface UltracacheConfigurationResolution {
|
|
1224
|
+
requestedCommit: string
|
|
1225
|
+
fetchedAt: number
|
|
1226
|
+
tasks: number
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1260
1229
|
/**
|
|
1261
|
-
*
|
|
1230
|
+
* Why a task (or the whole run) hashes natively; `reason` is rendered by the
|
|
1231
|
+
* run summary.
|
|
1232
|
+
*/
|
|
1233
|
+
export interface UltracacheDiagnostic {
|
|
1234
|
+
reason: string
|
|
1235
|
+
taskId?: string
|
|
1236
|
+
glob?: string
|
|
1237
|
+
message?: string
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
/** What JS knows about a run's tasks that the eligibility walk needs. */
|
|
1241
|
+
export interface UltracacheEligibilityOptions {
|
|
1242
|
+
/** Tasks whose executor ships a custom hasher. */
|
|
1243
|
+
customHasherTaskIds?: Array<string>
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
/**
|
|
1247
|
+
* How a target's tasks participate in Ultracache. Nx Cloud only: nothing in
|
|
1262
1248
|
* the OSS runner records or applies IO, so every mode behaves as `Off` without
|
|
1263
1249
|
* it.
|
|
1264
1250
|
*/
|
|
@@ -1282,6 +1268,13 @@ export declare const enum UltracacheMode {
|
|
|
1282
1268
|
Off = 'off'
|
|
1283
1269
|
}
|
|
1284
1270
|
|
|
1271
|
+
export interface UltracacheReport {
|
|
1272
|
+
/** Task ids hashed from their Ultracache configuration. */
|
|
1273
|
+
used: Array<string>
|
|
1274
|
+
diagnostics: Array<UltracacheDiagnostic>
|
|
1275
|
+
resolution: UltracacheConfigurationResolution
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1285
1278
|
export interface UpdatedWorkspaceFiles {
|
|
1286
1279
|
fileMap: FileMap
|
|
1287
1280
|
externalReferences: NxWorkspaceFilesExternals
|