@trebired/git-host 2.2.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +103 -11
- package/dist/api/forge/actions/filters.d.ts +10 -0
- package/dist/api/forge/actions/filters.d.ts.map +1 -0
- package/dist/api/forge/actions/filters.js +63 -0
- package/dist/api/forge/actions/filters.js.map +1 -0
- package/dist/api/forge/actions/run.d.ts +8 -0
- package/dist/api/forge/actions/run.d.ts.map +1 -0
- package/dist/api/forge/actions/run.js +129 -0
- package/dist/api/forge/actions/run.js.map +1 -0
- package/dist/api/forge/actions.d.ts +3 -12
- package/dist/api/forge/actions.d.ts.map +1 -1
- package/dist/api/forge/actions.js +2 -216
- package/dist/api/forge/actions.js.map +1 -1
- package/dist/api/handler/response.d.ts.map +1 -1
- package/dist/api/handler/response.js +55 -1
- package/dist/api/handler/response.js.map +1 -1
- package/dist/core/actions/environment.d.ts +9 -0
- package/dist/core/actions/environment.d.ts.map +1 -0
- package/dist/core/actions/environment.js +64 -0
- package/dist/core/actions/environment.js.map +1 -0
- package/dist/core/actions/expressions/read.d.ts +7 -0
- package/dist/core/actions/expressions/read.d.ts.map +1 -0
- package/dist/core/actions/expressions/read.js +148 -0
- package/dist/core/actions/expressions/read.js.map +1 -0
- package/dist/core/actions/expressions/tokenize.d.ts +4 -0
- package/dist/core/actions/expressions/tokenize.d.ts.map +1 -0
- package/dist/core/actions/expressions/tokenize.js +112 -0
- package/dist/core/actions/expressions/tokenize.js.map +1 -0
- package/dist/core/actions/expressions/types.d.ts +38 -0
- package/dist/core/actions/expressions/types.d.ts.map +1 -0
- package/dist/core/actions/expressions/types.js +2 -0
- package/dist/core/actions/expressions/types.js.map +1 -0
- package/dist/core/actions/expressions.d.ts +2 -9
- package/dist/core/actions/expressions.d.ts.map +1 -1
- package/dist/core/actions/expressions.js +2 -256
- package/dist/core/actions/expressions.js.map +1 -1
- package/dist/core/actions/local_runner.d.ts +5 -0
- package/dist/core/actions/local_runner.d.ts.map +1 -1
- package/dist/core/actions/local_runner.js +70 -18
- package/dist/core/actions/local_runner.js.map +1 -1
- package/dist/core/actions/node_runner.d.ts.map +1 -1
- package/dist/core/actions/node_runner.js +2 -1
- package/dist/core/actions/node_runner.js.map +1 -1
- package/dist/core/actions/normalize/finalize.d.ts +7 -0
- package/dist/core/actions/normalize/finalize.d.ts.map +1 -0
- package/dist/core/actions/normalize/finalize.js +70 -0
- package/dist/core/actions/normalize/finalize.js.map +1 -0
- package/dist/core/actions/normalize/shared.d.ts +19 -0
- package/dist/core/actions/normalize/shared.d.ts.map +1 -0
- package/dist/core/actions/normalize/shared.js +289 -0
- package/dist/core/actions/normalize/shared.js.map +1 -0
- package/dist/core/actions/normalize.d.ts +1 -3
- package/dist/core/actions/normalize.d.ts.map +1 -1
- package/dist/core/actions/normalize.js +2 -354
- package/dist/core/actions/normalize.js.map +1 -1
- package/dist/core/actions/redaction.d.ts +13 -2
- package/dist/core/actions/redaction.d.ts.map +1 -1
- package/dist/core/actions/redaction.js +20 -5
- package/dist/core/actions/redaction.js.map +1 -1
- package/dist/core/actions/release_assets.d.ts.map +1 -1
- package/dist/core/actions/release_assets.js.map +1 -1
- package/dist/core/actions/runner/launch.d.ts.map +1 -1
- package/dist/core/actions/runner/launch.js +12 -8
- package/dist/core/actions/runner/launch.js.map +1 -1
- package/dist/core/actions/sandbox.d.ts +4 -0
- package/dist/core/actions/sandbox.d.ts.map +1 -0
- package/dist/core/actions/sandbox.js +46 -0
- package/dist/core/actions/sandbox.js.map +1 -0
- package/dist/core/archive/commit.d.ts +6 -0
- package/dist/core/archive/commit.d.ts.map +1 -0
- package/dist/core/archive/commit.js +34 -0
- package/dist/core/archive/commit.js.map +1 -0
- package/dist/core/archive/context.d.ts +32 -0
- package/dist/core/archive/context.d.ts.map +1 -0
- package/dist/core/archive/context.js +61 -0
- package/dist/core/archive/context.js.map +1 -0
- package/dist/core/archive/generation.d.ts +11 -0
- package/dist/core/archive/generation.d.ts.map +1 -0
- package/dist/core/archive/generation.js +62 -0
- package/dist/core/archive/generation.js.map +1 -0
- package/dist/core/archive/links.d.ts +5 -0
- package/dist/core/archive/links.d.ts.map +1 -0
- package/dist/core/archive/links.js +62 -0
- package/dist/core/archive/links.js.map +1 -0
- package/dist/core/archive/open.d.ts +15 -0
- package/dist/core/archive/open.d.ts.map +1 -0
- package/dist/core/archive/open.js +159 -0
- package/dist/core/archive/open.js.map +1 -0
- package/dist/core/archive/read.d.ts +19 -0
- package/dist/core/archive/read.d.ts.map +1 -0
- package/dist/core/archive/read.js +62 -0
- package/dist/core/archive/read.js.map +1 -0
- package/dist/core/archive/resolve.d.ts +8 -0
- package/dist/core/archive/resolve.d.ts.map +1 -0
- package/dist/core/archive/resolve.js +67 -0
- package/dist/core/archive/resolve.js.map +1 -0
- package/dist/core/archive/shared.d.ts +50 -0
- package/dist/core/archive/shared.d.ts.map +1 -0
- package/dist/core/archive/shared.js +119 -0
- package/dist/core/archive/shared.js.map +1 -0
- package/dist/core/archive.d.ts +2 -18
- package/dist/core/archive.d.ts.map +1 -1
- package/dist/core/archive.js +16 -556
- package/dist/core/archive.js.map +1 -1
- package/dist/core/create/git/forge/base_methods.d.ts +5 -0
- package/dist/core/create/git/forge/base_methods.d.ts.map +1 -0
- package/dist/core/create/git/forge/base_methods.js +59 -0
- package/dist/core/create/git/forge/base_methods.js.map +1 -0
- package/dist/core/create/git/forge/context.d.ts +38 -0
- package/dist/core/create/git/forge/context.d.ts.map +1 -0
- package/dist/core/create/git/forge/context.js +174 -0
- package/dist/core/create/git/forge/context.js.map +1 -0
- package/dist/core/create/git/forge/fork_methods.d.ts +5 -0
- package/dist/core/create/git/forge/fork_methods.d.ts.map +1 -0
- package/dist/core/create/git/forge/fork_methods.js +133 -0
- package/dist/core/create/git/forge/fork_methods.js.map +1 -0
- package/dist/core/create/git/forge/release_methods.d.ts +5 -0
- package/dist/core/create/git/forge/release_methods.d.ts.map +1 -0
- package/dist/core/create/git/forge/release_methods.js +116 -0
- package/dist/core/create/git/forge/release_methods.js.map +1 -0
- package/dist/core/create/git/forge/shared.d.ts +9 -0
- package/dist/core/create/git/forge/shared.d.ts.map +1 -0
- package/dist/core/create/git/forge/shared.js +80 -0
- package/dist/core/create/git/forge/shared.js.map +1 -0
- package/dist/core/create/git/forge/social_methods.d.ts +5 -0
- package/dist/core/create/git/forge/social_methods.d.ts.map +1 -0
- package/dist/core/create/git/forge/social_methods.js +31 -0
- package/dist/core/create/git/forge/social_methods.js.map +1 -0
- package/dist/core/create/git/forge.d.ts.map +1 -1
- package/dist/core/create/git/forge.js +10 -594
- package/dist/core/create/git/forge.js.map +1 -1
- package/dist/core/create/git/host.d.ts.map +1 -1
- package/dist/core/create/git/host.js +139 -114
- package/dist/core/create/git/host.js.map +1 -1
- package/dist/core/create_git_host/remote_methods.d.ts.map +1 -1
- package/dist/core/create_git_host/remote_methods.js +92 -97
- package/dist/core/create_git_host/remote_methods.js.map +1 -1
- package/dist/core/forge_actions/job/release_asset.d.ts +17 -0
- package/dist/core/forge_actions/job/release_asset.d.ts.map +1 -0
- package/dist/core/forge_actions/job/release_asset.js +62 -0
- package/dist/core/forge_actions/job/release_asset.js.map +1 -0
- package/dist/core/forge_actions/job/steps.d.ts +37 -0
- package/dist/core/forge_actions/job/steps.d.ts.map +1 -0
- package/dist/core/forge_actions/job/steps.js +228 -0
- package/dist/core/forge_actions/job/steps.js.map +1 -0
- package/dist/core/forge_actions/runtime/api.d.ts +26 -0
- package/dist/core/forge_actions/runtime/api.d.ts.map +1 -0
- package/dist/core/forge_actions/runtime/api.js +210 -0
- package/dist/core/forge_actions/runtime/api.js.map +1 -0
- package/dist/core/forge_actions/runtime/engine.d.ts +25 -0
- package/dist/core/forge_actions/runtime/engine.d.ts.map +1 -0
- package/dist/core/forge_actions/runtime/engine.js +28 -0
- package/dist/core/forge_actions/runtime/engine.js.map +1 -0
- package/dist/core/forge_actions/runtime/job/execute.d.ts +19 -0
- package/dist/core/forge_actions/runtime/job/execute.d.ts.map +1 -0
- package/dist/core/forge_actions/runtime/job/execute.js +191 -0
- package/dist/core/forge_actions/runtime/job/execute.js.map +1 -0
- package/dist/core/forge_actions/runtime/job/step/execute.d.ts +7 -0
- package/dist/core/forge_actions/runtime/job/step/execute.d.ts.map +1 -0
- package/dist/core/forge_actions/runtime/job/step/execute.js +176 -0
- package/dist/core/forge_actions/runtime/job/step/execute.js.map +1 -0
- package/dist/core/forge_actions/runtime/queue.d.ts +11 -0
- package/dist/core/forge_actions/runtime/queue.d.ts.map +1 -0
- package/dist/core/forge_actions/runtime/queue.js +144 -0
- package/dist/core/forge_actions/runtime/queue.js.map +1 -0
- package/dist/core/forge_actions/runtime/run/execute.d.ts +9 -0
- package/dist/core/forge_actions/runtime/run/execute.d.ts.map +1 -0
- package/dist/core/forge_actions/runtime/run/execute.js +191 -0
- package/dist/core/forge_actions/runtime/run/execute.js.map +1 -0
- package/dist/core/forge_actions/runtime/types.d.ts +24 -0
- package/dist/core/forge_actions/runtime/types.d.ts.map +1 -0
- package/dist/core/forge_actions/runtime/types.js +2 -0
- package/dist/core/forge_actions/runtime/types.js.map +1 -0
- package/dist/core/forge_actions/runtime_support.d.ts +57 -0
- package/dist/core/forge_actions/runtime_support.d.ts.map +1 -0
- package/dist/core/forge_actions/runtime_support.js +276 -0
- package/dist/core/forge_actions/runtime_support.js.map +1 -0
- package/dist/core/forge_actions/shared.d.ts +92 -0
- package/dist/core/forge_actions/shared.d.ts.map +1 -0
- package/dist/core/forge_actions/shared.js +204 -0
- package/dist/core/forge_actions/shared.js.map +1 -0
- package/dist/core/forge_actions.d.ts +17 -24
- package/dist/core/forge_actions.d.ts.map +1 -1
- package/dist/core/forge_actions.js +33 -1459
- package/dist/core/forge_actions.js.map +1 -1
- package/dist/core/git_forge/storage_memory/actions.d.ts +5 -0
- package/dist/core/git_forge/storage_memory/actions.d.ts.map +1 -0
- package/dist/core/git_forge/storage_memory/actions.js +155 -0
- package/dist/core/git_forge/storage_memory/actions.js.map +1 -0
- package/dist/core/git_forge/storage_memory/adapter.d.ts +4 -0
- package/dist/core/git_forge/storage_memory/adapter.d.ts.map +1 -0
- package/dist/core/git_forge/storage_memory/adapter.js +118 -0
- package/dist/core/git_forge/storage_memory/adapter.js.map +1 -0
- package/dist/core/git_forge/storage_memory/state.d.ts +27 -0
- package/dist/core/git_forge/storage_memory/state.d.ts.map +1 -0
- package/dist/core/git_forge/storage_memory/state.js +53 -0
- package/dist/core/git_forge/storage_memory/state.js.map +1 -0
- package/dist/core/git_forge/storage_memory.d.ts +1 -3
- package/dist/core/git_forge/storage_memory.d.ts.map +1 -1
- package/dist/core/git_forge/storage_memory.js +1 -352
- package/dist/core/git_forge/storage_memory.js.map +1 -1
- package/dist/core/inspect/history.d.ts +13 -0
- package/dist/core/inspect/history.d.ts.map +1 -0
- package/dist/core/inspect/history.js +176 -0
- package/dist/core/inspect/history.js.map +1 -0
- package/dist/core/inspect/linguist.d.ts +12 -0
- package/dist/core/inspect/linguist.d.ts.map +1 -0
- package/dist/core/inspect/linguist.js +128 -0
- package/dist/core/inspect/linguist.js.map +1 -0
- package/dist/core/inspect/search_archive.d.ts +16 -0
- package/dist/core/inspect/search_archive.d.ts.map +1 -0
- package/dist/core/inspect/search_archive.js +88 -0
- package/dist/core/inspect/search_archive.js.map +1 -0
- package/dist/core/inspect/shared.d.ts +5 -0
- package/dist/core/inspect/shared.d.ts.map +1 -0
- package/dist/core/inspect/shared.js +47 -0
- package/dist/core/inspect/shared.js.map +1 -0
- package/dist/core/inspect/tree_blob.d.ts +16 -0
- package/dist/core/inspect/tree_blob.d.ts.map +1 -0
- package/dist/core/inspect/tree_blob.js +80 -0
- package/dist/core/inspect/tree_blob.js.map +1 -0
- package/dist/core/inspect.d.ts +3 -46
- package/dist/core/inspect.d.ts.map +1 -1
- package/dist/core/inspect.js +3 -546
- package/dist/core/inspect.js.map +1 -1
- package/dist/core/inspection/analysis.d.ts +4 -0
- package/dist/core/inspection/analysis.d.ts.map +1 -0
- package/dist/core/inspection/analysis.js +25 -0
- package/dist/core/inspection/analysis.js.map +1 -0
- package/dist/core/inspection/shared.d.ts +18 -0
- package/dist/core/inspection/shared.d.ts.map +1 -0
- package/dist/core/inspection/shared.js +112 -0
- package/dist/core/inspection/shared.js.map +1 -0
- package/dist/core/inspection/snapshots.d.ts +6 -0
- package/dist/core/inspection/snapshots.d.ts.map +1 -0
- package/dist/core/inspection/snapshots.js +270 -0
- package/dist/core/inspection/snapshots.js.map +1 -0
- package/dist/core/inspection/target.d.ts +4 -0
- package/dist/core/inspection/target.d.ts.map +1 -0
- package/dist/core/inspection/target.js +97 -0
- package/dist/core/inspection/target.js.map +1 -0
- package/dist/core/inspection/tree.d.ts +6 -0
- package/dist/core/inspection/tree.d.ts.map +1 -0
- package/dist/core/inspection/tree.js +103 -0
- package/dist/core/inspection/tree.js.map +1 -0
- package/dist/core/inspection.d.ts +6 -10
- package/dist/core/inspection.d.ts.map +1 -1
- package/dist/core/inspection.js +6 -592
- package/dist/core/inspection.js.map +1 -1
- package/dist/http/handler.d.ts.map +1 -1
- package/dist/http/handler.js +157 -133
- package/dist/http/handler.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/ssh/server.d.ts.map +1 -1
- package/dist/ssh/server.js +171 -243
- package/dist/ssh/server.js.map +1 -1
- package/dist/types/forge/workflows/actions.d.ts +70 -0
- package/dist/types/forge/workflows/actions.d.ts.map +1 -0
- package/dist/types/forge/workflows/actions.js +3 -0
- package/dist/types/forge/workflows/actions.js.map +1 -0
- package/dist/types/forge/workflows/definition.d.ts +115 -0
- package/dist/types/forge/workflows/definition.d.ts.map +1 -0
- package/dist/types/forge/workflows/definition.js +2 -0
- package/dist/types/forge/workflows/definition.js.map +1 -0
- package/dist/types/forge/workflows/runs.d.ts +184 -0
- package/dist/types/forge/workflows/runs.d.ts.map +1 -0
- package/dist/types/forge/workflows/runs.js +2 -0
- package/dist/types/forge/workflows/runs.js.map +1 -0
- package/dist/types/forge/workflows.d.ts +3 -331
- package/dist/types/forge/workflows.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/{bin → native}/git-host-actions-runner-darwin-arm64 +0 -0
- package/{bin → native}/git-host-actions-runner-darwin-x64 +0 -0
- package/{bin → native}/git-host-actions-runner-linux-arm64-gnu +0 -0
- package/{bin → native}/git-host-actions-runner-linux-x64-gnu +0 -0
- package/package.json +63 -11
- package/dist/frontend/js/utils/text.d.ts +0 -2
- package/dist/frontend/js/utils/text.d.ts.map +0 -1
- package/dist/frontend/js/utils/text.js +0 -4
- package/dist/frontend/js/utils/text.js.map +0 -1
- /package/{bin → native}/.gitkeep +0 -0
|
@@ -15,29 +15,37 @@ import { createContentMethods } from "../../create_git_host/content_methods.js";
|
|
|
15
15
|
import { createRemoteMethods } from "../../create_git_host/remote_methods.js";
|
|
16
16
|
import { createWorkingTreeMethods } from "../../create_git_host/working_tree_methods.js";
|
|
17
17
|
import { normalizeManagedExcludePatterns, toGitHostError } from "../../create_git_host/shared.js";
|
|
18
|
-
function
|
|
18
|
+
function validateCreateGitHostOptions(options) {
|
|
19
19
|
if (!options || typeof options.resolveRepository !== "function") {
|
|
20
20
|
throw new TypeError("createGitHost() requires a resolveRepository() function.");
|
|
21
21
|
}
|
|
22
|
+
}
|
|
23
|
+
function createGitHostRuntime(options) {
|
|
22
24
|
const logger = resolveLogger(options.logger, options.loggerAdapter);
|
|
23
|
-
const logGroup = "git-host";
|
|
24
25
|
logPackageInitialized({
|
|
25
26
|
adapter: options.loggerAdapter,
|
|
26
27
|
fallback: "console",
|
|
27
|
-
group:
|
|
28
|
+
group: "git-host",
|
|
28
29
|
logger: options.logger,
|
|
29
30
|
source: "@trebired/git-host",
|
|
30
31
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
return {
|
|
33
|
+
archiveService: createGitArchiveService({
|
|
34
|
+
archiveOptions: options.archive,
|
|
35
|
+
logger,
|
|
36
|
+
verbose: options.verbose === true,
|
|
37
|
+
}),
|
|
38
|
+
lockManager: new RepositoryLockManager(),
|
|
39
|
+
logGroup: "git-host",
|
|
35
40
|
logger,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
managedExcludeHeader: text(options.managedExcludeHeader, DEFAULT_MANAGED_EXCLUDE_HEADER),
|
|
42
|
+
managedExcludePatterns: normalizeManagedExcludePatterns(options.managedExcludePatterns),
|
|
43
|
+
options,
|
|
44
|
+
verbose: options.verbose === true,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function createResolveRepository(options) {
|
|
48
|
+
return async (repositoryId) => {
|
|
41
49
|
const resolved = await options.resolveRepository(text(repositoryId));
|
|
42
50
|
if (!resolved) {
|
|
43
51
|
throw new GitHostError("repository_not_found", `Repository "${text(repositoryId)}" was not found.`, {
|
|
@@ -48,129 +56,146 @@ function createGitHost(options) {
|
|
|
48
56
|
id: text(resolved.id, text(repositoryId)),
|
|
49
57
|
path: assertAbsoluteRepositoryPath(resolved.path),
|
|
50
58
|
};
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function createRepositorySummaryReader() {
|
|
62
|
+
return async (repository, commitLimit) => {
|
|
63
|
+
try {
|
|
64
|
+
return await buildRepositorySummary(repository, { commitLimit });
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
throw toGitHostError(error, "git_command_failed", "Failed to read repository summary.");
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
async function cloneIntoRepository(runtime, repository, ensureOptions) {
|
|
72
|
+
const cloneUrl = text(ensureOptions.cloneUrl);
|
|
73
|
+
const remoteUrl = text(ensureOptions.remoteUrl);
|
|
74
|
+
if (!cloneUrl && !remoteUrl)
|
|
75
|
+
return false;
|
|
76
|
+
if (runtime.verbose)
|
|
77
|
+
runtime.logger.info(runtime.logGroup, "cloning repository", { cloneUrl: cloneUrl || remoteUrl, path: repository.path, repositoryId: repository.id });
|
|
78
|
+
if (!isDirectoryEmpty(repository.path)) {
|
|
79
|
+
throw new GitHostError("repository_clone_target_not_empty", "Repository clone target is not empty.", {
|
|
80
|
+
path: repository.path,
|
|
81
|
+
repositoryId: repository.id,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
const cloneRes = await cloneRepository({
|
|
85
|
+
args: buildRemoteGitArgs({ httpHeaders: ensureOptions.httpHeaders, remoteCredentials: ensureOptions.remoteCredentials }),
|
|
86
|
+
cloneUrl: cloneUrl || remoteUrl,
|
|
87
|
+
remoteUrl: remoteUrl || cloneUrl,
|
|
88
|
+
env: buildRemoteGitEnv({
|
|
89
|
+
actor: ensureOptions.actor || runtime.options.defaultActor || null,
|
|
90
|
+
env: ensureOptions.env,
|
|
91
|
+
remoteCredentials: ensureOptions.remoteCredentials,
|
|
92
|
+
sshCommand: ensureOptions.sshCommand,
|
|
93
|
+
}),
|
|
94
|
+
workspaceRoot: repository.path,
|
|
95
|
+
});
|
|
96
|
+
if (!cloneRes.ok) {
|
|
97
|
+
runtime.logger.error(runtime.logGroup, "repository clone failed", { path: repository.path, repositoryId: repository.id, stderr: text(cloneRes.stderr) });
|
|
98
|
+
throw new GitHostError("git_command_failed", text(cloneRes.stderr, "Failed to clone repository."), {
|
|
99
|
+
args: ["clone"],
|
|
100
|
+
repositoryId: repository.id,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
async function initializeRepository(runtime, repository, ensureOptions) {
|
|
106
|
+
if (runtime.verbose)
|
|
107
|
+
runtime.logger.info(runtime.logGroup, "initializing repository", { path: repository.path, repositoryId: repository.id });
|
|
108
|
+
const initRes = await initRepository(repository.path, text(ensureOptions.initialBranch, DEFAULT_BRANCH));
|
|
109
|
+
if (!initRes.ok) {
|
|
110
|
+
runtime.logger.error(runtime.logGroup, "repository initialization failed", { path: repository.path, repositoryId: repository.id, stderr: text(initRes.stderr) });
|
|
111
|
+
throw new GitHostError("git_command_failed", text(initRes.stderr, "Failed to initialize repository."), {
|
|
112
|
+
args: ["init"],
|
|
113
|
+
repositoryId: repository.id,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
if (!workspaceHasTrackableFiles(repository.path))
|
|
117
|
+
return;
|
|
118
|
+
const commitRes = await createInitialCommit(repository.path, ensureOptions.actor || runtime.options.defaultActor || null, text(ensureOptions.initialCommitMessage, DEFAULT_COMMIT_MESSAGE));
|
|
119
|
+
if (!commitRes.ok) {
|
|
120
|
+
runtime.logger.error(runtime.logGroup, "initial repository commit failed", { path: repository.path, repositoryId: repository.id, stderr: text(commitRes.stderr) });
|
|
121
|
+
throw new GitHostError("git_command_failed", text(commitRes.stderr, "Failed to create the initial repository commit."), {
|
|
122
|
+
args: ["commit"],
|
|
123
|
+
repositoryId: repository.id,
|
|
124
|
+
});
|
|
51
125
|
}
|
|
52
|
-
|
|
126
|
+
}
|
|
127
|
+
async function ensureHostedRepository(runtime, repository, ensureOptions) {
|
|
128
|
+
const hostedConfigRes = await ensureHostedRepositoryConfig(repository.path);
|
|
129
|
+
if (!hostedConfigRes.ok) {
|
|
130
|
+
runtime.logger.error(runtime.logGroup, "hosted repository configuration failed", { path: repository.path, repositoryId: repository.id, stderr: text(hostedConfigRes.stderr) });
|
|
131
|
+
throw new GitHostError("git_command_failed", text(hostedConfigRes.stderr, "Failed to configure the repository for hosted Git access."), {
|
|
132
|
+
repositoryId: repository.id,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
if (ensureOptions.includeManagedExclude === false)
|
|
136
|
+
return;
|
|
137
|
+
await ensureManagedExcludeFile(repository.path, {
|
|
138
|
+
header: runtime.managedExcludeHeader,
|
|
139
|
+
patterns: runtime.managedExcludePatterns,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
function createEnsureRepositoryInner(runtime, resolveRepository) {
|
|
143
|
+
return async (repositoryId, ensureOptions = {}) => {
|
|
53
144
|
const repository = await resolveRepository(repositoryId);
|
|
54
145
|
fs.mkdirSync(repository.path, { recursive: true });
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const remoteUrl = text(ensureOptions.remoteUrl);
|
|
58
|
-
if (!hasRepository && (cloneUrl || remoteUrl)) {
|
|
59
|
-
if (verbose)
|
|
60
|
-
logger.info(logGroup, "cloning repository", { cloneUrl: cloneUrl || remoteUrl, path: repository.path, repositoryId: repository.id });
|
|
61
|
-
if (!isDirectoryEmpty(repository.path)) {
|
|
62
|
-
throw new GitHostError("repository_clone_target_not_empty", "Repository clone target is not empty.", {
|
|
63
|
-
path: repository.path,
|
|
64
|
-
repositoryId: repository.id,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
const cloneRes = await cloneRepository({
|
|
68
|
-
args: buildRemoteGitArgs({
|
|
69
|
-
httpHeaders: ensureOptions.httpHeaders,
|
|
70
|
-
remoteCredentials: ensureOptions.remoteCredentials,
|
|
71
|
-
}),
|
|
72
|
-
cloneUrl: cloneUrl || remoteUrl,
|
|
73
|
-
remoteUrl: remoteUrl || cloneUrl,
|
|
74
|
-
env: buildRemoteGitEnv({
|
|
75
|
-
actor: ensureOptions.actor || options.defaultActor || null,
|
|
76
|
-
env: ensureOptions.env,
|
|
77
|
-
remoteCredentials: ensureOptions.remoteCredentials,
|
|
78
|
-
sshCommand: ensureOptions.sshCommand,
|
|
79
|
-
}),
|
|
80
|
-
workspaceRoot: repository.path,
|
|
81
|
-
});
|
|
82
|
-
if (!cloneRes.ok) {
|
|
83
|
-
logger.error(logGroup, "repository clone failed", { path: repository.path, repositoryId: repository.id, stderr: text(cloneRes.stderr) });
|
|
84
|
-
throw new GitHostError("git_command_failed", text(cloneRes.stderr, "Failed to clone repository."), {
|
|
85
|
-
args: ["clone"],
|
|
86
|
-
repositoryId: repository.id,
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
else if (!hasRepository) {
|
|
91
|
-
if (verbose)
|
|
92
|
-
logger.info(logGroup, "initializing repository", { path: repository.path, repositoryId: repository.id });
|
|
93
|
-
const initRes = await initRepository(repository.path, text(ensureOptions.initialBranch, DEFAULT_BRANCH));
|
|
94
|
-
if (!initRes.ok) {
|
|
95
|
-
logger.error(logGroup, "repository initialization failed", { path: repository.path, repositoryId: repository.id, stderr: text(initRes.stderr) });
|
|
96
|
-
throw new GitHostError("git_command_failed", text(initRes.stderr, "Failed to initialize repository."), {
|
|
97
|
-
args: ["init"],
|
|
98
|
-
repositoryId: repository.id,
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
if (workspaceHasTrackableFiles(repository.path)) {
|
|
102
|
-
const commitRes = await createInitialCommit(repository.path, ensureOptions.actor || options.defaultActor || null, text(ensureOptions.initialCommitMessage, DEFAULT_COMMIT_MESSAGE));
|
|
103
|
-
if (!commitRes.ok) {
|
|
104
|
-
logger.error(logGroup, "initial repository commit failed", { path: repository.path, repositoryId: repository.id, stderr: text(commitRes.stderr) });
|
|
105
|
-
throw new GitHostError("git_command_failed", text(commitRes.stderr, "Failed to create the initial repository commit."), {
|
|
106
|
-
args: ["commit"],
|
|
107
|
-
repositoryId: repository.id,
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
const hostedConfigRes = await ensureHostedRepositoryConfig(repository.path);
|
|
113
|
-
if (!hostedConfigRes.ok) {
|
|
114
|
-
logger.error(logGroup, "hosted repository configuration failed", { path: repository.path, repositoryId: repository.id, stderr: text(hostedConfigRes.stderr) });
|
|
115
|
-
throw new GitHostError("git_command_failed", text(hostedConfigRes.stderr, "Failed to configure the repository for hosted Git access."), {
|
|
116
|
-
repositoryId: repository.id,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
if (ensureOptions.includeManagedExclude !== false) {
|
|
120
|
-
await ensureManagedExcludeFile(repository.path, {
|
|
121
|
-
header: managedExcludeHeader,
|
|
122
|
-
patterns: managedExcludePatterns,
|
|
123
|
-
});
|
|
146
|
+
if (!(await repositoryExists(repository.path)) && !(await cloneIntoRepository(runtime, repository, ensureOptions))) {
|
|
147
|
+
await initializeRepository(runtime, repository, ensureOptions);
|
|
124
148
|
}
|
|
149
|
+
await ensureHostedRepository(runtime, repository, ensureOptions);
|
|
125
150
|
return repository;
|
|
126
|
-
}
|
|
127
|
-
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function createReadSummaryInner(resolveRepository, readSummaryForRepository) {
|
|
154
|
+
return async (repositoryId, summaryOptions = {}) => {
|
|
128
155
|
const repository = await resolveRepository(repositoryId);
|
|
129
|
-
|
|
130
|
-
if (!hasRepository) {
|
|
156
|
+
if (!(await repositoryExists(repository.path))) {
|
|
131
157
|
throw new GitHostError("repository_not_initialized", `Repository "${repository.id}" is not initialized.`, {
|
|
132
158
|
path: repository.path,
|
|
133
159
|
repositoryId: repository.id,
|
|
134
160
|
});
|
|
135
161
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
async function readSummaryForRepository(repository, commitLimit) {
|
|
144
|
-
try {
|
|
145
|
-
return await buildRepositorySummary(repository, { commitLimit });
|
|
146
|
-
}
|
|
147
|
-
catch (error) {
|
|
148
|
-
throw toGitHostError(error, "git_command_failed", "Failed to read repository summary.");
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
const methodContext = {
|
|
152
|
-
archiveService,
|
|
162
|
+
return await readSummaryForRepository(repository, summaryOptions.commitLimit);
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function createMethodContext(runtime, resolveRepository) {
|
|
166
|
+
const readSummaryForRepository = createRepositorySummaryReader();
|
|
167
|
+
const ensureRepositoryInner = createEnsureRepositoryInner(runtime, resolveRepository);
|
|
168
|
+
return {
|
|
153
169
|
ensureRepositoryInner,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
170
|
+
methodContext: {
|
|
171
|
+
archiveService: runtime.archiveService,
|
|
172
|
+
ensureRepositoryInner,
|
|
173
|
+
lockManager: runtime.lockManager,
|
|
174
|
+
logGroup: runtime.logGroup,
|
|
175
|
+
logger: runtime.logger,
|
|
176
|
+
options: runtime.options,
|
|
177
|
+
readSummaryForRepository,
|
|
178
|
+
resolveRepository,
|
|
179
|
+
verbose: runtime.verbose,
|
|
180
|
+
},
|
|
158
181
|
readSummaryForRepository,
|
|
159
|
-
resolveRepository,
|
|
160
|
-
verbose,
|
|
161
182
|
};
|
|
183
|
+
}
|
|
184
|
+
function createGitHost(options) {
|
|
185
|
+
validateCreateGitHostOptions(options);
|
|
186
|
+
const runtime = createGitHostRuntime(options);
|
|
187
|
+
const resolveRepository = createResolveRepository(options);
|
|
188
|
+
const { ensureRepositoryInner, methodContext, readSummaryForRepository } = createMethodContext(runtime, resolveRepository);
|
|
189
|
+
const readSummaryInner = createReadSummaryInner(resolveRepository, readSummaryForRepository);
|
|
162
190
|
return {
|
|
163
191
|
async ensureRepository(repositoryId, ensureOptions = {}) {
|
|
164
|
-
return await lockManager.withLock(text(repositoryId), async () =>
|
|
165
|
-
const repository = await ensureRepositoryInner(repositoryId, ensureOptions);
|
|
166
|
-
return await readSummaryForRepository(repository, ensureOptions.commitLimit);
|
|
167
|
-
});
|
|
192
|
+
return await runtime.lockManager.withLock(text(repositoryId), async () => await readSummaryForRepository(await ensureRepositoryInner(repositoryId, ensureOptions), ensureOptions.commitLimit));
|
|
168
193
|
},
|
|
169
194
|
async readSummary(repositoryId, summaryOptions = {}) {
|
|
170
195
|
return await readSummaryInner(repositoryId, summaryOptions);
|
|
171
196
|
},
|
|
172
197
|
async withRepositoryLock(repositoryId, operation) {
|
|
173
|
-
return await lockManager.withLock(text(repositoryId), operation);
|
|
198
|
+
return await runtime.lockManager.withLock(text(repositoryId), operation);
|
|
174
199
|
},
|
|
175
200
|
...createBranchMethods(methodContext),
|
|
176
201
|
...createWorkingTreeMethods(methodContext),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.js","sourceRoot":"","sources":["../../../../src/core/create/git/host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAS9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,4BAA4B,EAC5B,wBAAwB,EACxB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,+BAA+B,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../../../../src/core/create/git/host.ts"],"names":[],"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QACrC,GAAG,oBAAoB,CAAC,aAAa,CAAC;KACvC,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote_methods.d.ts","sourceRoot":"","sources":["../../../src/core/create_git_host/remote_methods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,OAAO,EAAiD,MAAM,eAAe,CAAC;AAI1G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"remote_methods.d.ts","sourceRoot":"","sources":["../../../src/core/create_git_host/remote_methods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,OAAO,EAAiD,MAAM,eAAe,CAAC;AAI1G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AA6GxD,iBAAS,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,CAMpG;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1,107 +1,102 @@
|
|
|
1
1
|
import { text } from "../../utils/text.js";
|
|
2
2
|
import { readRepositoryActivityContext } from "../activity.js";
|
|
3
3
|
import { fetchRepository, pullRepository, pushRepository } from "../remote.js";
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
function compactMetadata(metadata) {
|
|
5
|
+
return Object.fromEntries(Object.entries(metadata).filter(([, value]) => {
|
|
6
|
+
if (value === undefined)
|
|
7
|
+
return false;
|
|
8
|
+
return typeof value !== "string" || value.trim() !== "";
|
|
9
|
+
}));
|
|
10
|
+
}
|
|
11
|
+
async function recordRemoteActivity(context, repository, input) {
|
|
12
|
+
if (!context.options.activity)
|
|
13
|
+
return;
|
|
14
|
+
const repositoryContext = await readRepositoryActivityContext(repository);
|
|
15
|
+
await context.options.activity.recordActivity({
|
|
16
|
+
actor_id: text(input.actor?.id),
|
|
17
|
+
actor_label: text(input.actor?.name, input.actor?.id),
|
|
18
|
+
kind: input.kind,
|
|
19
|
+
metadata: {
|
|
20
|
+
...repositoryContext,
|
|
21
|
+
...compactMetadata(input.metadata),
|
|
22
|
+
},
|
|
23
|
+
repository_id: repository.id,
|
|
24
|
+
source: "api",
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function logRemoteOperation(context, repositoryId, action, remote) {
|
|
28
|
+
if (!context.verbose)
|
|
29
|
+
return;
|
|
30
|
+
context.logger.info(context.logGroup, `${action} repository remote`, {
|
|
31
|
+
remote: text(remote, "origin"),
|
|
32
|
+
repositoryId,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function createFetchMethod(context) {
|
|
36
|
+
return async (repositoryId, options = {}) => await context.lockManager.withLock(text(repositoryId), async () => {
|
|
37
|
+
const repository = await context.ensureRepositoryInner(repositoryId);
|
|
38
|
+
logRemoteOperation(context, repository.id, "fetching", options.remote);
|
|
39
|
+
await fetchRepository(repository, options);
|
|
40
|
+
await recordRemoteActivity(context, repository, {
|
|
41
|
+
kind: "repository.fetch",
|
|
42
|
+
metadata: {
|
|
43
|
+
operation: "fetch",
|
|
44
|
+
prune: options.prune === true,
|
|
45
|
+
remote: text(options.remote, "origin"),
|
|
46
|
+
remote_url: text(options.remoteUrl),
|
|
47
|
+
remote_username: text(options.remoteCredentials?.username),
|
|
48
|
+
tags: options.tags === true,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
return await context.readSummaryForRepository(repository);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function createPullMethod(context) {
|
|
55
|
+
return async (repositoryId, options = {}) => await context.lockManager.withLock(text(repositoryId), async () => {
|
|
56
|
+
const repository = await context.ensureRepositoryInner(repositoryId);
|
|
57
|
+
logRemoteOperation(context, repository.id, "pulling", options.remote);
|
|
58
|
+
await pullRepository(repository, options);
|
|
59
|
+
await recordRemoteActivity(context, repository, {
|
|
60
|
+
actor: options.actor,
|
|
61
|
+
kind: "repository.pull",
|
|
21
62
|
metadata: {
|
|
22
|
-
|
|
23
|
-
|
|
63
|
+
branch: text(options.branch),
|
|
64
|
+
ff_only: options.ffOnly !== false,
|
|
65
|
+
operation: "pull",
|
|
66
|
+
rebase: options.rebase === true,
|
|
67
|
+
remote: text(options.remote, "origin"),
|
|
68
|
+
remote_url: text(options.remoteUrl),
|
|
69
|
+
remote_username: text(options.remoteCredentials?.username),
|
|
24
70
|
},
|
|
25
|
-
repository_id: repository.id,
|
|
26
|
-
source: "api",
|
|
27
71
|
});
|
|
28
|
-
|
|
72
|
+
return await context.readSummaryForRepository(repository);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function createPushMethod(context) {
|
|
76
|
+
return async (repositoryId, options = {}) => await context.lockManager.withLock(text(repositoryId), async () => {
|
|
77
|
+
const repository = await context.ensureRepositoryInner(repositoryId);
|
|
78
|
+
logRemoteOperation(context, repository.id, "pushing", options.remote);
|
|
79
|
+
await pushRepository(repository, options);
|
|
80
|
+
await recordRemoteActivity(context, repository, {
|
|
81
|
+
actor: options.actor,
|
|
82
|
+
kind: "repository.push",
|
|
83
|
+
metadata: {
|
|
84
|
+
branch: text(options.branch),
|
|
85
|
+
operation: "push",
|
|
86
|
+
remote: text(options.remote, "origin"),
|
|
87
|
+
remote_url: text(options.remoteUrl),
|
|
88
|
+
remote_username: text(options.remoteCredentials?.username),
|
|
89
|
+
set_upstream: options.setUpstream === true,
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
return await context.readSummaryForRepository(repository);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function createRemoteMethods(context) {
|
|
29
96
|
return {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (verbose) {
|
|
34
|
-
logger.info(logGroup, "fetching repository remote", {
|
|
35
|
-
remote: text(options.remote, "origin"),
|
|
36
|
-
repositoryId: repository.id,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
await fetchRepository(repository, options);
|
|
40
|
-
await recordRemoteActivity(repository, {
|
|
41
|
-
kind: "repository.fetch",
|
|
42
|
-
metadata: {
|
|
43
|
-
operation: "fetch",
|
|
44
|
-
prune: options.prune === true,
|
|
45
|
-
remote: text(options.remote, "origin"),
|
|
46
|
-
remote_url: text(options.remoteUrl),
|
|
47
|
-
remote_username: text(options.remoteCredentials?.username),
|
|
48
|
-
tags: options.tags === true,
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
return await readSummaryForRepository(repository);
|
|
52
|
-
});
|
|
53
|
-
},
|
|
54
|
-
async pull(repositoryId, options = {}) {
|
|
55
|
-
return await lockManager.withLock(text(repositoryId), async () => {
|
|
56
|
-
const repository = await ensureRepositoryInner(repositoryId);
|
|
57
|
-
if (verbose) {
|
|
58
|
-
logger.info(logGroup, "pulling repository remote", {
|
|
59
|
-
remote: text(options.remote, "origin"),
|
|
60
|
-
repositoryId: repository.id,
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
await pullRepository(repository, options);
|
|
64
|
-
await recordRemoteActivity(repository, {
|
|
65
|
-
actor: options.actor,
|
|
66
|
-
kind: "repository.pull",
|
|
67
|
-
metadata: {
|
|
68
|
-
branch: text(options.branch),
|
|
69
|
-
ff_only: options.ffOnly !== false,
|
|
70
|
-
operation: "pull",
|
|
71
|
-
rebase: options.rebase === true,
|
|
72
|
-
remote: text(options.remote, "origin"),
|
|
73
|
-
remote_url: text(options.remoteUrl),
|
|
74
|
-
remote_username: text(options.remoteCredentials?.username),
|
|
75
|
-
},
|
|
76
|
-
});
|
|
77
|
-
return await readSummaryForRepository(repository);
|
|
78
|
-
});
|
|
79
|
-
},
|
|
80
|
-
async push(repositoryId, options = {}) {
|
|
81
|
-
return await lockManager.withLock(text(repositoryId), async () => {
|
|
82
|
-
const repository = await ensureRepositoryInner(repositoryId);
|
|
83
|
-
if (verbose) {
|
|
84
|
-
logger.info(logGroup, "pushing repository remote", {
|
|
85
|
-
remote: text(options.remote, "origin"),
|
|
86
|
-
repositoryId: repository.id,
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
await pushRepository(repository, options);
|
|
90
|
-
await recordRemoteActivity(repository, {
|
|
91
|
-
actor: options.actor,
|
|
92
|
-
kind: "repository.push",
|
|
93
|
-
metadata: {
|
|
94
|
-
branch: text(options.branch),
|
|
95
|
-
operation: "push",
|
|
96
|
-
remote: text(options.remote, "origin"),
|
|
97
|
-
remote_url: text(options.remoteUrl),
|
|
98
|
-
remote_username: text(options.remoteCredentials?.username),
|
|
99
|
-
set_upstream: options.setUpstream === true,
|
|
100
|
-
},
|
|
101
|
-
});
|
|
102
|
-
return await readSummaryForRepository(repository);
|
|
103
|
-
});
|
|
104
|
-
},
|
|
97
|
+
fetch: createFetchMethod(context),
|
|
98
|
+
pull: createPullMethod(context),
|
|
99
|
+
push: createPushMethod(context),
|
|
105
100
|
};
|
|
106
101
|
}
|
|
107
102
|
export { createRemoteMethods };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote_methods.js","sourceRoot":"","sources":["../../../src/core/create_git_host/remote_methods.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGhF,SAAS,
|
|
1
|
+
{"version":3,"file":"remote_methods.js","sourceRoot":"","sources":["../../../src/core/create_git_host/remote_methods.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,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AC;QACrE,kBAAkB,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACtE,MAAM,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAC1C,MAAM,oBAAoB,CAAC,OAAO,EAAE,UAAU,EAAE;YAC9C,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,IAAI,EAAE,iBAAiB;YACvB,QAAQ,EAAE;gBACR,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;gBAC5B,SAAS,EAAE,MAAM;gBACjB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC;gBACtC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;gBACnC,eAAe,EAAE,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,QAAQ,CAAC;gBAC1D,YAAY,EAAE,OAAO,CAAC,WAAW,KAAK,IAAI;aAC3C;SACF,CAAC,CAAC;QACH,OAAO,MAAM,OAAO,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,mBAAmB,CAAC,OAA6B;IACxD,OAAO;QACL,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC;QACjC,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC;QAC/B,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC;KAChC,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { GitForgeWorkflowRun, GitForgeWorkflowRunJob, GitForgeWorkflowRunStep } from "../../../types.js";
|
|
2
|
+
type ReleaseAssetContext = {
|
|
3
|
+
emitRunEvent: (run: GitForgeWorkflowRun, input: Omit<import("../../../types.js").GitForgeWorkflowRunEvent, "created_at" | "id" | "repository_id" | "run_id" | "sequence" | "workflow_id">) => Promise<import("../../../types.js").GitForgeWorkflowRunEvent>;
|
|
4
|
+
options: import("../shared.js").CreateGitForgeActionsRuntimeOptions;
|
|
5
|
+
};
|
|
6
|
+
declare function executePublishReleaseAssetStep(context: ReleaseAssetContext, input: {
|
|
7
|
+
jobRun: GitForgeWorkflowRunJob;
|
|
8
|
+
run: GitForgeWorkflowRun;
|
|
9
|
+
stepRun: GitForgeWorkflowRunStep;
|
|
10
|
+
stepWith: Record<string, string>;
|
|
11
|
+
workspacePath: string;
|
|
12
|
+
}): Promise<{
|
|
13
|
+
outputPreview: string;
|
|
14
|
+
summary: string;
|
|
15
|
+
}>;
|
|
16
|
+
export { executePublishReleaseAssetStep };
|
|
17
|
+
//# sourceMappingURL=release_asset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release_asset.d.ts","sourceRoot":"","sources":["../../../../src/core/forge_actions/job/release_asset.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,eAAe,CAAC;AAOvB,KAAK,mBAAmB,GAAG;IACzB,YAAY,EAAE,CACZ,GAAG,EAAE,mBAAmB,EACxB,KAAK,EAAE,IAAI,CAAC,OAAO,eAAe,EAAE,wBAAwB,EAAE,YAAY,GAAG,IAAI,GAAG,eAAe,GAAG,QAAQ,GAAG,UAAU,GAAG,aAAa,CAAC,KACzI,OAAO,CAAC,OAAO,eAAe,EAAE,wBAAwB,CAAC,CAAC;IAC/D,OAAO,EAAE,OAAO,eAAe,EAAE,mCAAmC,CAAC;CACtE,CAAC;AAoCF,iBAAe,8BAA8B,CAAC,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE;IACjF,MAAM,EAAE,sBAAsB,CAAC;IAC/B,GAAG,EAAE,mBAAmB,CAAC;IACzB,OAAO,EAAE,uBAAuB,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;CACvB;;;GA8BA;AAED,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
|