@firestartr/cli 2.6.0-snapshot → 2.6.0-snapshot-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/build/index.js +46794 -54167
- package/build/packages/catalog_common/index.d.ts +9 -1
- package/build/packages/catalog_common/src/codeowners/index.d.ts +26 -0
- package/build/packages/catalog_common/src/types/envvars.d.ts +0 -4
- package/build/packages/cdk8s_renderer/src/charts/catalog/tfWorkspaceChart.d.ts +2 -2
- package/build/packages/cdk8s_renderer/src/normalizers/refValues.d.ts +6 -10
- package/build/packages/cdk8s_renderer/src/normalizers/tfworkspace.d.ts +1 -4
- package/build/packages/cdk8s_renderer/src/refsSorter/refsExtractor.d.ts +3 -6
- package/build/packages/gh_provisioner/src/entities/base.d.ts +5 -0
- package/build/packages/gh_provisioner/src/entities/ghrepo/helpers/branch_protections.d.ts +7 -0
- package/build/packages/gh_provisioner/src/entities/ghrepo/helpers/index.d.ts +1 -0
- package/build/packages/gh_provisioner/src/entities/ghrepo/index.d.ts +1 -0
- package/build/packages/gh_provisioner/src/tp_bridge.d.ts +3 -1
- package/build/packages/github/index.d.ts +1 -1
- package/build/packages/github/src/repository.d.ts +2 -2
- package/build/packages/importer/src/decanter/gh/github_repo.d.ts +2 -0
- package/build/packages/operator/src/definitions.d.ts +15 -1
- package/build/packages/operator/src/processItem.blocks.d.ts +40 -0
- package/build/packages/operator/src/processItem.d.ts +2 -1
- package/build/packages/operator/src/processItem.slot.d.ts +5 -2
- package/build/packages/operator/src/tfm_mirrors.d.ts +5 -0
- package/build/packages/terraform_provisioner/index.d.ts +21 -1
- package/build/packages/terraform_provisioner/src/index.d.ts +2 -0
- package/build/packages/terraform_provisioner/src/mirror-repos/index.d.ts +41 -0
- package/build/packages/terraform_provisioner/src/mirror-repos.d.ts +13 -0
- package/build/packages/terraform_provisioner/src/project_tf.d.ts +3 -0
- package/build/packages/terraform_provisioner/src/project_tf_remote.d.ts +2 -1
- package/build/packages/terraform_provisioner/src/schema.d.ts +5 -0
- package/build/packages/terraform_provisioner/src/utils.d.ts +33 -1
- package/package.json +1 -1
- package/build/202.index.js +0 -46
- package/build/697.index.js +0 -80
- package/build/87.index.js +0 -80
- package/build/902.index.js +0 -36
- package/build/915.index.js +0 -79
- package/build/packages/cdk8s_renderer/src/utils/tfwp-refs.d.ts +0 -13
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { SimpleTokenizer } from './src/tokenizer';
|
|
2
1
|
import { validateCron, isValidCron, getCronNextInterval } from './src/cron';
|
|
3
2
|
export type { IBackstageProfile } from './src/types/backstage';
|
|
4
3
|
export type { BranchStrategy } from './src/types/github';
|
|
@@ -105,6 +104,15 @@ declare const _default: {
|
|
|
105
104
|
tokenizer: {
|
|
106
105
|
SimpleTokenizer: typeof import("./src/tokenizer").SimpleTokenizer;
|
|
107
106
|
};
|
|
107
|
+
codeowners: {
|
|
108
|
+
parse: typeof import("./src/codeowners").parse;
|
|
109
|
+
format: typeof import("./src/codeowners").format;
|
|
110
|
+
validate: typeof import("./src/codeowners").validate;
|
|
111
|
+
updateRule: typeof import("./src/codeowners").updateRule;
|
|
112
|
+
remove: typeof import("./src/codeowners").remove;
|
|
113
|
+
getOwners: typeof import("./src/codeowners").getOwners;
|
|
114
|
+
resolveRefs: typeof import("./src/codeowners").resolveRefs;
|
|
115
|
+
};
|
|
108
116
|
cron: {
|
|
109
117
|
validateCron: typeof validateCron;
|
|
110
118
|
isValidCron: typeof isValidCron;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface CodeownersEntry {
|
|
2
|
+
type: 'rule' | 'comment' | 'blank';
|
|
3
|
+
pattern?: string;
|
|
4
|
+
owners?: string[];
|
|
5
|
+
raw: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function parse(raw: string): CodeownersEntry[];
|
|
8
|
+
export declare function format(entries: CodeownersEntry[]): string;
|
|
9
|
+
export declare function validate(raw: string): {
|
|
10
|
+
valid: boolean;
|
|
11
|
+
errors: string[];
|
|
12
|
+
};
|
|
13
|
+
export declare function updateRule(entries: CodeownersEntry[], pattern: string, owners: string[]): CodeownersEntry[];
|
|
14
|
+
export declare function remove(entries: CodeownersEntry[], pattern: string): CodeownersEntry[];
|
|
15
|
+
export declare function getOwners(entries: CodeownersEntry[]): string[];
|
|
16
|
+
export declare function resolveRefs(raw: string, replacements: Record<string, string>): string;
|
|
17
|
+
declare const _default: {
|
|
18
|
+
parse: typeof parse;
|
|
19
|
+
format: typeof format;
|
|
20
|
+
validate: typeof validate;
|
|
21
|
+
updateRule: typeof updateRule;
|
|
22
|
+
remove: typeof remove;
|
|
23
|
+
getOwners: typeof getOwners;
|
|
24
|
+
resolveRefs: typeof resolveRefs;
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
|
@@ -25,11 +25,7 @@ export declare enum envVars {
|
|
|
25
25
|
s3Bucket = "S3_BUCKET",
|
|
26
26
|
s3Lock = "S3_LOCK",
|
|
27
27
|
s3Region = "S3_REGION",
|
|
28
|
-
cdktfConfigFiles = "CDKTF_CONFIG_FILES",
|
|
29
28
|
exclusionsYamlPath = "EXCLUSIONS_PATH",
|
|
30
|
-
cdktfEntityPath = "FIRESTARTR_CDKTF_ENTITY_PATH",
|
|
31
|
-
cdktfDepsPath = "FIRESTARTR_CDKTF_DEPS_PATH",
|
|
32
|
-
cdktfIsImport = "FIRESTARTR_CDKTF_IS_IMPORT",
|
|
33
29
|
githubAppId = "GITHUB_APP_ID",
|
|
34
30
|
githubAppInstallationId = "GITHUB_APP_INSTALLATION_ID",
|
|
35
31
|
githubAppInstallationIdPrefapp = "GITHUB_APP_INSTALLATION_ID_PREFAPP",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseCatalogChart } from './base';
|
|
2
2
|
import { ApiObject, GroupVersionKind } from 'cdk8s';
|
|
3
3
|
export declare class CatalogTFWorkspaceChart extends BaseCatalogChart {
|
|
4
|
-
template():
|
|
4
|
+
template(): {
|
|
5
5
|
apiVersion: string;
|
|
6
6
|
kind: string;
|
|
7
7
|
metadata: {
|
|
@@ -32,7 +32,7 @@ export declare class CatalogTFWorkspaceChart extends BaseCatalogChart {
|
|
|
32
32
|
};
|
|
33
33
|
dependsOn: string[];
|
|
34
34
|
};
|
|
35
|
-
}
|
|
35
|
+
};
|
|
36
36
|
instanceApiObject(template: any): ApiObject;
|
|
37
37
|
gvk(): GroupVersionKind;
|
|
38
38
|
}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { ICustomResourcePatch } from '../patches';
|
|
2
2
|
import { Normalizer } from './base';
|
|
3
3
|
export declare class RefValuesNormalizer extends Normalizer {
|
|
4
|
+
applicableProviders: string[];
|
|
5
|
+
__validate(_schema: any): Promise<boolean>;
|
|
4
6
|
rsClaimRef: Function;
|
|
5
|
-
|
|
6
|
-
normalize(values: any): Promise<{
|
|
7
|
-
values: any;
|
|
8
|
-
references: any[];
|
|
9
|
-
}>;
|
|
10
|
-
__patches(claim: any, previousCR: any): Promise<ICustomResourcePatch[]>;
|
|
11
|
-
__validate(): Promise<any>;
|
|
12
|
-
static applicableProviders: string[];
|
|
13
|
-
get applicableProviders(): string[];
|
|
7
|
+
__patches(claim: any, _previousCR: any): Promise<ICustomResourcePatch[]>;
|
|
14
8
|
}
|
|
15
9
|
export declare function replaceReferences(providerValues: any, resolveRef: Function, references?: Map<string, any>): Promise<{
|
|
16
|
-
values:
|
|
10
|
+
values: {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
};
|
|
17
13
|
references: any[];
|
|
18
14
|
}>;
|
|
@@ -6,8 +6,5 @@ export declare class TFWorkspaceNormalizer extends Normalizer {
|
|
|
6
6
|
__validate(_schema: any): Promise<boolean>;
|
|
7
7
|
__patches(claim: any, _previousCR: any): Promise<ICustomResourcePatch[]>;
|
|
8
8
|
}
|
|
9
|
-
export declare function normalizeModuleContent(tfRootModulePath: string
|
|
10
|
-
content: string;
|
|
11
|
-
references: any[];
|
|
12
|
-
}>;
|
|
9
|
+
export declare function normalizeModuleContent(tfRootModulePath: string): Promise<string>;
|
|
13
10
|
export declare function validatek8sLimits(moduleContent: any): boolean;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { RenderClaims } from '../renderer/types';
|
|
2
|
-
export declare function extractRefs(renderClaims: RenderClaims, kind: string):
|
|
3
|
-
export declare function extractAllRefs(claimData: string):
|
|
2
|
+
export declare function extractRefs(renderClaims: RenderClaims, kind: string): any;
|
|
3
|
+
export declare function extractAllRefs(claimData: string): any[];
|
|
4
4
|
export declare function getGroupParentRef(parent: string, references?: any[]): any[];
|
|
5
|
-
export declare function
|
|
6
|
-
tfworkspaceRefs: string[];
|
|
7
|
-
secretsClaimRefs: string[];
|
|
8
|
-
}>;
|
|
5
|
+
export declare function getTfWorkspacesRefs(values: any, references?: any[], secretsRefs?: any[]): any[][];
|
|
9
6
|
export declare function getComponentVarsAndSecretsRefs(parsedClaim: any): string[];
|
|
@@ -12,6 +12,11 @@ type PatchData = {
|
|
|
12
12
|
};
|
|
13
13
|
export { PatchOperations, PatchData };
|
|
14
14
|
export declare abstract class Entity {
|
|
15
|
+
parent?: Entity;
|
|
16
|
+
_terraformHasRun?: boolean;
|
|
17
|
+
sessionId?: string;
|
|
18
|
+
sessionProjectPath?: string;
|
|
19
|
+
__ghProvisionerSessionWorkspaceInitialized?: boolean;
|
|
15
20
|
static refResolver: RefResolver;
|
|
16
21
|
static setRefResolver(refResolver: RefResolver): void;
|
|
17
22
|
_cr: EntityCR;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EntityGHRepo } from '../';
|
|
2
|
+
/**
|
|
3
|
+
* Adds branch protection config to the synthesized Terraform config,
|
|
4
|
+
* preserving legacy field semantics exactly (empty lists, explicit booleans, names).
|
|
5
|
+
* @param entity The EntityGHRepo instance
|
|
6
|
+
*/
|
|
7
|
+
export declare function provisionBranchProtections(entity: EntityGHRepo): void;
|
|
@@ -4,3 +4,4 @@ export { provisionVariables } from './variables';
|
|
|
4
4
|
export { provisionOIDCSubjectClaim } from './actions_oidc';
|
|
5
5
|
export { provisionPermissions } from './teams';
|
|
6
6
|
export { provisionLabels } from './labels';
|
|
7
|
+
export { provisionBranchProtections } from './branch_protections';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Entity } from './entities';
|
|
2
2
|
export declare function runOnTerraform(entity: Entity, command: string, customArgs?: any[], opts?: any): Promise<any>;
|
|
3
|
-
export declare function buildContext(entity: Entity): {
|
|
3
|
+
export declare function buildContext(entity: Entity, reuseExistingProjectOverride?: boolean, importMode?: boolean): {
|
|
4
4
|
type: string;
|
|
5
5
|
inline: string;
|
|
6
6
|
module: string;
|
|
@@ -12,4 +12,6 @@ export declare function buildContext(entity: Entity): {
|
|
|
12
12
|
tfStatePath: string;
|
|
13
13
|
references: {};
|
|
14
14
|
projectPath: string;
|
|
15
|
+
reuseExistingProject: boolean;
|
|
16
|
+
importMode: boolean;
|
|
15
17
|
};
|
|
@@ -32,8 +32,8 @@ declare const _default: {
|
|
|
32
32
|
getOIDCRepo: typeof import("./src/repository").getOIDCRepo;
|
|
33
33
|
addStatusCheck: typeof import("./src/repository").addStatusCheck;
|
|
34
34
|
addCommitStatus: typeof import("./src/repository").addCommitStatus;
|
|
35
|
-
tryCreateRef: typeof import("./src/repository").tryCreateRef;
|
|
36
35
|
getRepoIssuesLabels: typeof import("./src/repository").getRepoIssuesLabels;
|
|
36
|
+
isEmptyRepo: typeof import("./src/repository").isEmptyRepo;
|
|
37
37
|
};
|
|
38
38
|
team: {
|
|
39
39
|
getTeamMembers: typeof import("./src/team").getTeamMembers;
|
|
@@ -1322,12 +1322,12 @@ export declare function uploadFile(destinationPath: string, filePath: string, re
|
|
|
1322
1322
|
export declare function deleteFile(path: string, repo: string, owner?: string, branch?: string, message?: string): Promise<void>;
|
|
1323
1323
|
export declare function addStatusCheck(output: any, is_failure: boolean, head_sha: string, name: string, status: string, repo: string, owner?: string): Promise<void>;
|
|
1324
1324
|
export declare function addCommitStatus(state: commitStatusState, sha: string, repo: string, owner?: string, target_url?: string, description?: string, context?: string): Promise<void>;
|
|
1325
|
-
export declare function tryCreateRef(ref: string, sha: string, repo: string, owner?: string): Promise<boolean>;
|
|
1326
1325
|
export declare function getRepoIssuesLabels(owner: string, repo: string): Promise<{
|
|
1327
1326
|
name: string;
|
|
1328
1327
|
description: string;
|
|
1329
1328
|
color: string;
|
|
1330
1329
|
}[]>;
|
|
1330
|
+
export declare function isEmptyRepo(owner: string, name: string): Promise<boolean>;
|
|
1331
1331
|
declare const _default: {
|
|
1332
1332
|
listReleases: typeof listReleases;
|
|
1333
1333
|
getReleaseByTag: typeof getReleaseByTag;
|
|
@@ -1344,7 +1344,7 @@ declare const _default: {
|
|
|
1344
1344
|
getOIDCRepo: typeof getOIDCRepo;
|
|
1345
1345
|
addStatusCheck: typeof addStatusCheck;
|
|
1346
1346
|
addCommitStatus: typeof addCommitStatus;
|
|
1347
|
-
tryCreateRef: typeof tryCreateRef;
|
|
1348
1347
|
getRepoIssuesLabels: typeof getRepoIssuesLabels;
|
|
1348
|
+
isEmptyRepo: typeof isEmptyRepo;
|
|
1349
1349
|
};
|
|
1350
1350
|
export default _default;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BranchStrategiesInitializer, GithubRepositoryOverrider, InitializerDefault } from 'cdk8s_renderer';
|
|
2
2
|
import { GithubDecanter } from './base';
|
|
3
3
|
export default class RepoGithubDecanter extends GithubDecanter {
|
|
4
|
+
__gatherIsEmpty(): Promise<void>;
|
|
5
|
+
__decantValidateNotEmpty(): void;
|
|
4
6
|
githubTeams: any;
|
|
5
7
|
constructor(data: any, org: string, githubTeams?: any);
|
|
6
8
|
claimKind: string;
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
+
import type { Dependencies } from './resolver';
|
|
1
2
|
export declare function getKindFromPlural(plural: string): any;
|
|
2
3
|
export declare function getPluralFromKind(kind: string): string;
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Helper to extract the canonical identity (metadata.uid) from a WorkItem or its item.
|
|
6
|
+
*
|
|
7
|
+
* Use this helper when you need a stable identity key for WorkItems, e.g. for
|
|
8
|
+
* in-memory deferred-scheduling bookkeeping.
|
|
9
|
+
*
|
|
10
|
+
* Note: other subsystems may still use kind/namespace/name keys; this helper is
|
|
11
|
+
* specifically intended for UID-based WorkItem identity.
|
|
12
|
+
* Any future change to identity logic MUST be made here and nowhere else.
|
|
13
|
+
*
|
|
14
|
+
* Returns undefined if .metadata.uid is missing so scheduler/bookkeeping paths
|
|
15
|
+
* can safely short-circuit instead of throwing and aborting an entire pass.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getWorkItemIdentity(wi: WorkItem): string | undefined;
|
|
4
18
|
export declare enum OperationType {
|
|
5
19
|
RENAMED = "RENAMED",
|
|
6
20
|
UPDATED = "UPDATED",
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { WorkItem } from './definitions';
|
|
2
|
+
/**
|
|
3
|
+
* Maximum number of blocked attempts allowed before an item is moved to the deferred segment.
|
|
4
|
+
* An item becomes deferred once its blocked-attempt count exceeds this value.
|
|
5
|
+
*/
|
|
6
|
+
export declare const MAX_BLOCKED_ATTEMPTS_BEFORE_DEFER = 5;
|
|
7
|
+
export declare const SUPPORTED_PARENT_KINDS: Set<string>;
|
|
8
|
+
/**
|
|
9
|
+
* Encapsulates all deferred-scheduling bookkeeping state for one scheduler queue.
|
|
10
|
+
* Instantiate once per queue (alongside processItemSlotsManager) inside loop().
|
|
11
|
+
*/
|
|
12
|
+
export declare class DeferredSchedulingBookkeeper {
|
|
13
|
+
private _blockedAttempts;
|
|
14
|
+
private _deferredEntryOrder;
|
|
15
|
+
private _deferredOrderCounter;
|
|
16
|
+
/**
|
|
17
|
+
* Returns true only for supported parent kinds AND only for deletion operations.
|
|
18
|
+
* Per spec Definition 2: applicable when operation is MARKED_TO_DELETION,
|
|
19
|
+
* or RETRY with metadata.deletionTimestamp set.
|
|
20
|
+
*/
|
|
21
|
+
isDeferredSchedulingApplicable(item: WorkItem): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Increments block counter for item (only call when item has been detected as blocked).
|
|
24
|
+
* Returns new value. Promotes item to deferred segment if threshold crossed.
|
|
25
|
+
*/
|
|
26
|
+
incrementBlockedAttempt(item: WorkItem): number;
|
|
27
|
+
getBlockedAttempts(item: WorkItem): number;
|
|
28
|
+
isDeferred(item: WorkItem): boolean;
|
|
29
|
+
getDeferredOrder(item: WorkItem): number | undefined;
|
|
30
|
+
removeBookkeeping(item: WorkItem): void;
|
|
31
|
+
/**
|
|
32
|
+
* Splits queue into non-deferred and deferred, preserving original order,
|
|
33
|
+
* but sorts deferred by stable insertion order.
|
|
34
|
+
*/
|
|
35
|
+
partitionQueueByDeferred<T extends WorkItem>(queue: T[]): {
|
|
36
|
+
nonDeferred: T[];
|
|
37
|
+
deferred: T[];
|
|
38
|
+
};
|
|
39
|
+
clearAllBookkeeping(): void;
|
|
40
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { WorkItem } from './informer';
|
|
2
|
+
import { DeferredSchedulingBookkeeper } from './processItem.blocks';
|
|
2
3
|
export declare function getQueueMetrics(): {
|
|
3
4
|
nItems: number;
|
|
4
5
|
nItemsFinished: number;
|
|
@@ -25,4 +26,4 @@ export declare function processItem(workItem: WorkItem): Promise<void>;
|
|
|
25
26
|
* Periodically checks the queue for finished WorkItems and removes them
|
|
26
27
|
* @param {WorkItem[]} queue - Queue of WorkItems
|
|
27
28
|
*/
|
|
28
|
-
export declare function workItemGarbageCollector(queue: WorkItem[]): Promise<void>;
|
|
29
|
+
export declare function workItemGarbageCollector(queue: WorkItem[], bookkeeper?: DeferredSchedulingBookkeeper): Promise<void>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { WorkItem } from './definitions';
|
|
2
2
|
import { ProcessItemSlotMetrics } from './metrics/processItem.slot.metrics';
|
|
3
|
-
export declare function initProcessItemsSlots(nSlots: number, initMetrics?: boolean): ProcessItemSlots;
|
|
3
|
+
export declare function initProcessItemsSlots(nSlots: number, initMetrics?: boolean, onWorkItemBlockedByHandler?: (workItem: WorkItem) => void): ProcessItemSlots;
|
|
4
4
|
export declare class ProcessItemSlots {
|
|
5
5
|
_slots: ProcessItemSlot[];
|
|
6
6
|
_nSlots: number;
|
|
7
7
|
_guardRails: GuardRails;
|
|
8
|
-
constructor(nSlots: number, initMetrics: boolean);
|
|
8
|
+
constructor(nSlots: number, initMetrics: boolean, onWorkItemBlockedByHandler?: (workItem: WorkItem) => void);
|
|
9
9
|
getIdleSlots(): Generator<ProcessItemSlot, void, unknown>;
|
|
10
10
|
allSlotsAreIdle(): boolean;
|
|
11
11
|
isWorkItemBlocked(workItem: WorkItem): boolean;
|
|
@@ -24,16 +24,19 @@ export declare class ProcessItemSlot {
|
|
|
24
24
|
_actions: {
|
|
25
25
|
blockItem: (item: any) => void;
|
|
26
26
|
unblockItem: (item: any) => void;
|
|
27
|
+
onWorkItemBlockedByHandler?: (workItem: WorkItem) => void;
|
|
27
28
|
} | undefined;
|
|
28
29
|
_metrics: ProcessItemSlotMetrics;
|
|
29
30
|
constructor(id: number);
|
|
30
31
|
set actions(actions: {
|
|
31
32
|
blockItem: (item: any) => void;
|
|
32
33
|
unblockItem: (item: any) => void;
|
|
34
|
+
onWorkItemBlockedByHandler?: (workItem: WorkItem) => void;
|
|
33
35
|
});
|
|
34
36
|
get actions(): {
|
|
35
37
|
blockItem: (item: any) => void;
|
|
36
38
|
unblockItem: (item: any) => void;
|
|
39
|
+
onWorkItemBlockedByHandler?: (workItem: WorkItem) => void;
|
|
37
40
|
};
|
|
38
41
|
get idle(): boolean;
|
|
39
42
|
get id(): number;
|
|
@@ -1,5 +1,25 @@
|
|
|
1
|
-
export { TFProjectManager } from './src';
|
|
1
|
+
export { TFProjectManager, DEFAULT_MIRROR_WARMUP_LIST, initializeMirrors, } from './src';
|
|
2
2
|
import type { ProcessHandler } from './src/process_handler';
|
|
3
|
+
export interface WarmupMirrorsRefreshOptions {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
runEvery?: number;
|
|
6
|
+
beforeRefresh?: () => Promise<void>;
|
|
7
|
+
onError?: (error: Error) => void | Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export interface WarmupMirrorsResult {
|
|
10
|
+
success: string[];
|
|
11
|
+
failed: {
|
|
12
|
+
repo: string;
|
|
13
|
+
error: string;
|
|
14
|
+
}[];
|
|
15
|
+
initializeRefresher: (runEvery: number, beforeRefresh?: () => Promise<void>, onError?: (error: Error) => void | Promise<void>) => {
|
|
16
|
+
stop: () => void;
|
|
17
|
+
};
|
|
18
|
+
refresher?: {
|
|
19
|
+
stop: () => void;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export declare function warmupMirrors(repos?: ReadonlyArray<string>, refreshOptions?: WarmupMirrorsRefreshOptions): Promise<WarmupMirrorsResult>;
|
|
3
23
|
export declare function validateContext(context: any): void;
|
|
4
24
|
export declare function run(): Promise<void>;
|
|
5
25
|
export declare function runTerraformProvisioner(context: any, command?: string, streaming?: any, customArgs?: any, ctl?: ProcessHandler): Promise<any>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { TFProjectManager } from './project_tf';
|
|
2
2
|
export { getRefNameFromKey, resolveRef } from './resolutor';
|
|
3
|
+
export { DEFAULT_MIRROR_WARMUP_LIST, resolveMirroredModuleSource, } from './mirror-repos/index';
|
|
4
|
+
export { initializeMirrors } from './mirror-repos';
|
|
3
5
|
export { TFProjectManager };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare const MIRROR_ROOT = "/tmp/tfm_mirrors/";
|
|
2
|
+
/**
|
|
3
|
+
* Returns true if the mirror subsystem is enabled for this process
|
|
4
|
+
*/
|
|
5
|
+
export declare function areMirrorsEnabled(): boolean;
|
|
6
|
+
export declare function enableMirrors(): void;
|
|
7
|
+
export declare function getCanonicalRepoId(remoteUrl: string): string;
|
|
8
|
+
export declare function deriveMirrorPath(remoteUrl: string): string;
|
|
9
|
+
export declare function installMirrorForRepo(remoteUrl: string): Promise<string>;
|
|
10
|
+
export declare function translateModuleSource(source: string): string;
|
|
11
|
+
export declare function _getMirrorRegistry(): ReadonlyMap<string, string>;
|
|
12
|
+
export declare function resetMirrorRegistry(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Refresh an existing git mirror by running 'git fetch --prune'.
|
|
15
|
+
* Throws if the mirror is invalid or the fetch fails.
|
|
16
|
+
*/
|
|
17
|
+
export declare function refreshMirror(mirrorPath: string): Promise<void>;
|
|
18
|
+
export { initializeMirrors } from '../mirror-repos';
|
|
19
|
+
/**
|
|
20
|
+
* Default repository list to be warmed up (mirrored) by the warmup API.
|
|
21
|
+
* Callers can supply their own repo list to extend or override this default.
|
|
22
|
+
*/
|
|
23
|
+
export declare const DEFAULT_MIRROR_WARMUP_LIST: ReadonlyArray<string>;
|
|
24
|
+
/**
|
|
25
|
+
* Warmup function: Installs or updates mirrors for a provided repo list (default: DEFAULT_MIRROR_WARMUP_LIST).
|
|
26
|
+
* Returns a summary of success/failure for each repo.
|
|
27
|
+
*/
|
|
28
|
+
export declare function warmupMirrors(repos?: ReadonlyArray<string>): Promise<{
|
|
29
|
+
success: string[];
|
|
30
|
+
failed: {
|
|
31
|
+
repo: string;
|
|
32
|
+
error: string;
|
|
33
|
+
}[];
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Resolves and installs a mirror for a git-backed Terraform root module source.
|
|
37
|
+
* If translation is possible (eligible git::...), returns a local mirror source,
|
|
38
|
+
* else returns the original source string unchanged.
|
|
39
|
+
* Wraps both detection & mirror install. See spec 002-mirror-tfm-usage.
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveMirroredModuleSource(source: string): Promise<string>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { warmupMirrors, DEFAULT_MIRROR_WARMUP_LIST, refreshMirror, _getMirrorRegistry, getCanonicalRepoId, installMirrorForRepo, deriveMirrorPath, resetMirrorRegistry, MIRROR_ROOT, resolveMirroredModuleSource, translateModuleSource, enableMirrors, areMirrorsEnabled } from './mirror-repos/index';
|
|
2
|
+
export { warmupMirrors, DEFAULT_MIRROR_WARMUP_LIST, refreshMirror, _getMirrorRegistry, getCanonicalRepoId, installMirrorForRepo, deriveMirrorPath, resetMirrorRegistry, MIRROR_ROOT, resolveMirroredModuleSource, translateModuleSource, enableMirrors, areMirrorsEnabled, };
|
|
3
|
+
interface MirrorSummary {
|
|
4
|
+
success: string[];
|
|
5
|
+
failed: {
|
|
6
|
+
repo: string;
|
|
7
|
+
error: string;
|
|
8
|
+
}[];
|
|
9
|
+
initializeRefresher: (runEvery: number, beforeRefresh?: () => Promise<void>, onError?: (error: Error) => void | Promise<void>) => {
|
|
10
|
+
stop: () => void;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare function initializeMirrors(repos?: ReadonlyArray<string>): Promise<MirrorSummary>;
|
|
@@ -6,6 +6,9 @@ import { WriterAdditionalFiles } from './writer_additional_files';
|
|
|
6
6
|
import { PassThrough } from 'stream';
|
|
7
7
|
import type { ProcessHandler } from './process_handler';
|
|
8
8
|
export declare class TFProjectManager {
|
|
9
|
+
tearUpProject(): Promise<void>;
|
|
10
|
+
ctx: any;
|
|
11
|
+
private _reuseActive;
|
|
9
12
|
mainTfWriter: WriterMainTf;
|
|
10
13
|
providerJsonWriter: WriterProviderJson;
|
|
11
14
|
tfVarsJsonWriter: WriterTfVarsJson;
|
|
@@ -6,7 +6,9 @@ import { WriterAdditionalFiles } from './writer_additional_files';
|
|
|
6
6
|
import { PassThrough } from 'stream';
|
|
7
7
|
import type { ProcessHandler } from './process_handler';
|
|
8
8
|
export declare class TFProjectManagerRemote {
|
|
9
|
+
tearUpProject(): Promise<void>;
|
|
9
10
|
writerTerraform: WriterTerraform;
|
|
11
|
+
private _reuseActive;
|
|
10
12
|
providerJsonWriter: WriterProviderJson;
|
|
11
13
|
tfVarsJsonWriter: WriterTfVarsJson;
|
|
12
14
|
additionalFilesWriter: WriterAdditionalFiles;
|
|
@@ -24,7 +26,6 @@ export declare class TFProjectManagerRemote {
|
|
|
24
26
|
getOutput(): any;
|
|
25
27
|
setStreamCallbacks(fnData: Function, fnEnd: (...args: any[]) => void, reopen?: boolean): void;
|
|
26
28
|
build(): Promise<void>;
|
|
27
|
-
__configGit(): Promise<void>;
|
|
28
29
|
__init(): Promise<void>;
|
|
29
30
|
__initFromModule(): Promise<void>;
|
|
30
31
|
validate(): Promise<void>;
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { PassThrough } from 'stream';
|
|
3
3
|
import type { ProcessHandler } from './process_handler';
|
|
4
|
+
export declare function shouldWriteProviderJson(ctx: any): Promise<boolean>;
|
|
5
|
+
/**
|
|
6
|
+
* Compute the expected generated workspace files for Inline projects.
|
|
7
|
+
*/
|
|
8
|
+
export declare function computeInlineWorkspaceFiles(ctx: any): Promise<string[]>;
|
|
9
|
+
/**
|
|
10
|
+
* Compute the expected generated workspace files for Remote projects.
|
|
11
|
+
*/
|
|
12
|
+
export declare function computeRemoteWorkspaceFiles(ctx: any): Promise<string[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Validate workspace structure: checks for existence of all required files/dirs.
|
|
15
|
+
* Returns array of missing paths (or [] if all exist).
|
|
16
|
+
*/
|
|
17
|
+
export declare function validateWorkspaceStructure(projectPath: string, expectedFiles: string[]): string[];
|
|
4
18
|
export declare function validate(path: string, secrets: any[]): Promise<unknown>;
|
|
5
19
|
export declare function init(path: string, secrets: any[], stream?: PassThrough, ctl?: ProcessHandler): Promise<unknown>;
|
|
6
20
|
export declare function initFromModule(path: string, source: string, secrets: any[], stream?: PassThrough, ctl?: ProcessHandler): Promise<unknown>;
|
|
@@ -10,4 +24,22 @@ export declare function customCommand(path: string, secrets: any[], args: any[],
|
|
|
10
24
|
export declare function destroy(path: string, secrets: any[], stream?: PassThrough, ctl?: ProcessHandler): Promise<unknown>;
|
|
11
25
|
export declare function output(path: string, secrets: any[]): Promise<unknown>;
|
|
12
26
|
export declare function tfExec(path: string, args: Array<string>, secrets: any[], extraArgs?: string[], stream?: PassThrough, ctl?: ProcessHandler): Promise<unknown>;
|
|
13
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Clone a remote repository as a git bare mirror.
|
|
29
|
+
*/
|
|
30
|
+
export declare function gitCloneMirror(remoteUrl: string, mirrorPath: string): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Perform a git remote update on an existing mirror repo.
|
|
33
|
+
*/
|
|
34
|
+
export declare function gitRemoteUpdate(mirrorPath: string): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Run 'git fetch --prune' in a bare or mirror repository.
|
|
37
|
+
* Throws if the operation fails.
|
|
38
|
+
*/
|
|
39
|
+
export declare function gitFetchPrune(mirrorPath: string): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Single package-wide GitHub authentication config writer for repo mirrors and remote workflows.
|
|
42
|
+
* Writes the required url rewriting stanza to /home/node/.gitconfig based on the current org's GitHub App token.
|
|
43
|
+
* This is the ONLY allowed implementation of project git-auth per package specs.
|
|
44
|
+
*/
|
|
45
|
+
export declare function configGit(): Promise<void>;
|
package/package.json
CHANGED
package/build/202.index.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export const id = 202;
|
|
2
|
-
export const ids = [202];
|
|
3
|
-
export const modules = {
|
|
4
|
-
|
|
5
|
-
/***/ 66202:
|
|
6
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10
|
-
exports.getMachineId = void 0;
|
|
11
|
-
/*
|
|
12
|
-
* Copyright The OpenTelemetry Authors
|
|
13
|
-
*
|
|
14
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
15
|
-
* you may not use this file except in compliance with the License.
|
|
16
|
-
* You may obtain a copy of the License at
|
|
17
|
-
*
|
|
18
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
-
*
|
|
20
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
21
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
22
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
23
|
-
* See the License for the specific language governing permissions and
|
|
24
|
-
* limitations under the License.
|
|
25
|
-
*/
|
|
26
|
-
const fs_1 = __webpack_require__(57147);
|
|
27
|
-
const api_1 = __webpack_require__(78199);
|
|
28
|
-
async function getMachineId() {
|
|
29
|
-
const paths = ['/etc/machine-id', '/var/lib/dbus/machine-id'];
|
|
30
|
-
for (const path of paths) {
|
|
31
|
-
try {
|
|
32
|
-
const result = await fs_1.promises.readFile(path, { encoding: 'utf8' });
|
|
33
|
-
return result.trim();
|
|
34
|
-
}
|
|
35
|
-
catch (e) {
|
|
36
|
-
api_1.diag.debug(`error reading machine id: ${e}`);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return undefined;
|
|
40
|
-
}
|
|
41
|
-
exports.getMachineId = getMachineId;
|
|
42
|
-
//# sourceMappingURL=getMachineId-linux.js.map
|
|
43
|
-
|
|
44
|
-
/***/ })
|
|
45
|
-
|
|
46
|
-
};
|