@firestartr/cli 2.11.0-snapshot-feature-git-traceability-1 → 2.11.0-snapshot-main-1
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/build/index.js +14 -84
- package/build/packages/cdk8s_renderer/src/claims/github/repositoryFeature.d.ts +0 -3
- package/build/packages/features_preparer/src/installer.d.ts +0 -4
- package/build/packages/features_renderer/src/auxiliar.d.ts +0 -11
- package/build/packages/github/index.d.ts +2 -2
- package/build/packages/github/src/with_profile.d.ts +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -166259,19 +166259,12 @@ function addTraceability(context, src, content) {
|
|
|
166259
166259
|
}
|
|
166260
166260
|
function addTraceabilityStamp(context, content) {
|
|
166261
166261
|
const traceability = context.traceability || {};
|
|
166262
|
-
const
|
|
166263
|
-
|
|
166264
|
-
|
|
166265
|
-
|
|
166266
|
-
|
|
166267
|
-
|
|
166268
|
-
if (traceability.sha) {
|
|
166269
|
-
stampLines.push(`# FEATURE_GIT_SHA: "${traceability.sha}"`);
|
|
166270
|
-
}
|
|
166271
|
-
if (Array.isArray(traceability.tags) && traceability.tags.length > 0) {
|
|
166272
|
-
stampLines.push(`# FEATURE_GIT_TAGS: ${JSON.stringify(traceability.tags)}`);
|
|
166273
|
-
}
|
|
166274
|
-
const stamp = `${stampLines.join('\n')}\n\n`;
|
|
166262
|
+
const stamp = `---
|
|
166263
|
+
# FEATURE_NAME: ${traceability.name}
|
|
166264
|
+
# FEATURE_VERSION: ${traceability.version}
|
|
166265
|
+
# FEATURE_URL: ${traceability.url}
|
|
166266
|
+
|
|
166267
|
+
`;
|
|
166275
166268
|
const output = [];
|
|
166276
166269
|
let replaced = false;
|
|
166277
166270
|
for (const line of content.split(/\n/)) {
|
|
@@ -166440,7 +166433,6 @@ function buildExpectedOutput(config, renderDir) {
|
|
|
166440
166433
|
return {
|
|
166441
166434
|
files,
|
|
166442
166435
|
patches: config.patches || [],
|
|
166443
|
-
traceability: {},
|
|
166444
166436
|
};
|
|
166445
166437
|
}
|
|
166446
166438
|
/* ---------- Context-style API for a render temp dir ---------- */
|
|
@@ -166611,7 +166603,6 @@ function render(featurePath, featureRenderPath, entity, firestartrConfig = {}, f
|
|
|
166611
166603
|
// Not used anymore
|
|
166612
166604
|
// output.unpatches = context.config.unpatches
|
|
166613
166605
|
});
|
|
166614
|
-
output.traceability = context.traceability;
|
|
166615
166606
|
external_fs_default().writeFileSync(external_path_default().join(featureRenderPath, 'config.json'), JSON.stringify(context.config));
|
|
166616
166607
|
// write the output file
|
|
166617
166608
|
const configFile = external_path_default().join(featureRenderPath, 'output.json');
|
|
@@ -166843,7 +166834,6 @@ featureArgs = {}, repo = 'features', owner = 'prefapp') {
|
|
|
166843
166834
|
async function processFeature(featureName, reference, featureOwner, // -> cr
|
|
166844
166835
|
featureArgs = {}, repo = 'features', owner = 'prefapp') {
|
|
166845
166836
|
await downloadFeatureZip(repo, featureName, reference, owner);
|
|
166846
|
-
const commitInfo = await resolveFeatureCommit(owner, repo, reference);
|
|
166847
166837
|
featureArgs['traceability'] = {
|
|
166848
166838
|
version: reference,
|
|
166849
166839
|
owner,
|
|
@@ -166851,44 +166841,9 @@ featureArgs = {}, repo = 'features', owner = 'prefapp') {
|
|
|
166851
166841
|
name: featureName,
|
|
166852
166842
|
ref: reference,
|
|
166853
166843
|
url: `https://github.com/${owner}/${repo}/tree/${reference}/packages/${featureName}`,
|
|
166854
|
-
sha: commitInfo.sha,
|
|
166855
|
-
tags: commitInfo.tags,
|
|
166856
166844
|
};
|
|
166857
166845
|
return renderFeature(featureName, reference, owner, repo, featureOwner, '/tmp', featureArgs);
|
|
166858
166846
|
}
|
|
166859
|
-
async function resolveFeatureCommit(owner, repo, reference) {
|
|
166860
|
-
try {
|
|
166861
|
-
const octokit = await github["default"].getOctokitForOrg(owner, true);
|
|
166862
|
-
// Get the resolved commit SHA
|
|
166863
|
-
const { data: commit } = await octokit.rest.repos.getCommit({
|
|
166864
|
-
owner,
|
|
166865
|
-
repo,
|
|
166866
|
-
ref: reference,
|
|
166867
|
-
});
|
|
166868
|
-
const sha = commit.sha;
|
|
166869
|
-
// Get all tags pointing to this commit. `paginate` is all-or-nothing:
|
|
166870
|
-
// if listing fails, we still return the resolved SHA with an empty tag set.
|
|
166871
|
-
let tags = [];
|
|
166872
|
-
try {
|
|
166873
|
-
const allTags = await octokit.paginate(octokit.rest.repos.listTags, {
|
|
166874
|
-
owner,
|
|
166875
|
-
repo,
|
|
166876
|
-
per_page: 100,
|
|
166877
|
-
});
|
|
166878
|
-
tags = allTags
|
|
166879
|
-
.filter((t) => t.commit?.sha === sha)
|
|
166880
|
-
.map((t) => t.name);
|
|
166881
|
-
}
|
|
166882
|
-
catch (tagError) {
|
|
166883
|
-
features_preparer_src_logger.warn(`[features_preparer] Failed to list tags for ${owner}/${repo}@${reference}: ${tagError instanceof Error ? tagError.message : String(tagError)}`);
|
|
166884
|
-
}
|
|
166885
|
-
return { sha, tags };
|
|
166886
|
-
}
|
|
166887
|
-
catch (error) {
|
|
166888
|
-
features_preparer_src_logger.warn(`[features_preparer] Failed to resolve commit for ${owner}/${repo}@${reference}: ${error instanceof Error ? error.message : String(error)}`);
|
|
166889
|
-
return { sha: '', tags: [] };
|
|
166890
|
-
}
|
|
166891
|
-
}
|
|
166892
166847
|
async function prepareFeature(featureName, version, repo = 'features', owner = 'prefapp') {
|
|
166893
166848
|
await downloadFeatureZip(repo, featureName, version, owner);
|
|
166894
166849
|
}
|
|
@@ -166974,20 +166929,11 @@ async function utils_renderFeature(featureName, featureVersion, featureOutputObj
|
|
|
166974
166929
|
files.push({ path, userManaged, content, targetBranch });
|
|
166975
166930
|
}
|
|
166976
166931
|
const featName = catalog_common/* default.generic.normalizeName */.Z.generic.normalizeName(`${featureName}-${cr.spec.firestartr.tfStateKey}`);
|
|
166977
|
-
const traceability = featureOutputObject.traceability || {};
|
|
166978
166932
|
return {
|
|
166979
166933
|
kind: 'GithubRepositoryFeatureClaim',
|
|
166980
166934
|
version: '1.0.0',
|
|
166981
166935
|
name: featName,
|
|
166982
|
-
feature: {
|
|
166983
|
-
name: featureName,
|
|
166984
|
-
version: featureVersion,
|
|
166985
|
-
ref: traceability.ref,
|
|
166986
|
-
repo: traceability.repo,
|
|
166987
|
-
sha: traceability.sha,
|
|
166988
|
-
tags: traceability.tags,
|
|
166989
|
-
url: traceability.url,
|
|
166990
|
-
},
|
|
166936
|
+
feature: { name: featureName, version: featureVersion },
|
|
166991
166937
|
firestartr: { tfStateKey: cr.spec.firestartr.tfStateKey },
|
|
166992
166938
|
files,
|
|
166993
166939
|
claimRepoName,
|
|
@@ -170854,29 +170800,13 @@ class FeatureRepoChart extends BaseGithubChart {
|
|
|
170854
170800
|
template() {
|
|
170855
170801
|
const claim = this.get('claim');
|
|
170856
170802
|
const repositoryTarget = this.resolveRepositoryTarget();
|
|
170857
|
-
const annotations = {
|
|
170858
|
-
'firestartr.dev/external-name': claim.name,
|
|
170859
|
-
'firestartr.dev/feature-name': claim.feature.name,
|
|
170860
|
-
};
|
|
170861
|
-
if (claim.feature.sha) {
|
|
170862
|
-
annotations['firestartr.dev/feature-git-sha'] = claim.feature.sha;
|
|
170863
|
-
}
|
|
170864
|
-
if (claim.feature.tags?.length) {
|
|
170865
|
-
annotations['firestartr.dev/feature-git-tags'] = JSON.stringify(claim.feature.tags);
|
|
170866
|
-
}
|
|
170867
|
-
if (claim.feature.url) {
|
|
170868
|
-
annotations['firestartr.dev/feature-url'] = claim.feature.url;
|
|
170869
|
-
}
|
|
170870
|
-
if (claim.feature.ref) {
|
|
170871
|
-
annotations['firestartr.dev/feature-ref'] = claim.feature.ref;
|
|
170872
|
-
}
|
|
170873
|
-
if (claim.feature.repo) {
|
|
170874
|
-
annotations['firestartr.dev/feature-repo'] = claim.feature.repo;
|
|
170875
|
-
}
|
|
170876
170803
|
const cr = {
|
|
170877
170804
|
metadata: {
|
|
170878
170805
|
name: claim.name,
|
|
170879
|
-
annotations
|
|
170806
|
+
annotations: {
|
|
170807
|
+
'firestartr.dev/external-name': claim.name,
|
|
170808
|
+
'firestartr.dev/feature-name': claim.feature.name,
|
|
170809
|
+
},
|
|
170880
170810
|
},
|
|
170881
170811
|
spec: {
|
|
170882
170812
|
context: claim.context,
|
|
@@ -170896,7 +170826,7 @@ class FeatureRepoChart extends BaseGithubChart {
|
|
|
170896
170826
|
},
|
|
170897
170827
|
},
|
|
170898
170828
|
};
|
|
170899
|
-
const
|
|
170829
|
+
const annotations = this.getAnnotationsFromRepo(this.get('repoCr'), [
|
|
170900
170830
|
'claim-ref',
|
|
170901
170831
|
'revision',
|
|
170902
170832
|
'sync-enabled',
|
|
@@ -170904,7 +170834,7 @@ class FeatureRepoChart extends BaseGithubChart {
|
|
|
170904
170834
|
]);
|
|
170905
170835
|
cr.metadata.annotations = {
|
|
170906
170836
|
...cr.metadata.annotations,
|
|
170907
|
-
...
|
|
170837
|
+
...annotations,
|
|
170908
170838
|
};
|
|
170909
170839
|
// We do this to remove undefined variables from the template
|
|
170910
170840
|
const crTemplate = JSON.parse(JSON.stringify(cr, null, 2));
|
|
@@ -713963,7 +713893,7 @@ const crsStatusSubcommand = {
|
|
|
713963
713893
|
};
|
|
713964
713894
|
|
|
713965
713895
|
;// CONCATENATED MODULE: ./package.json
|
|
713966
|
-
const package_namespaceObject = JSON.parse('{"i8":"2.11.0-snapshot-
|
|
713896
|
+
const package_namespaceObject = JSON.parse('{"i8":"2.11.0-snapshot-main-1"}');
|
|
713967
713897
|
;// CONCATENATED MODULE: ../../package.json
|
|
713968
713898
|
const package_namespaceObject_1 = {"i8":"2.10.0"};
|
|
713969
713899
|
// EXTERNAL MODULE: ../../node_modules/semver/index.js
|
|
@@ -16,9 +16,6 @@ export interface IGithubRepositoryFeatureClaim extends IClaim {
|
|
|
16
16
|
version?: string;
|
|
17
17
|
ref?: string;
|
|
18
18
|
repo?: string;
|
|
19
|
-
sha?: string;
|
|
20
|
-
tags?: string[];
|
|
21
|
-
url?: string;
|
|
22
19
|
};
|
|
23
20
|
repositoryTarget: FirestartrGithubRepositoryFeatureSpecRepositoryTarget;
|
|
24
21
|
files: Array<IGithubRepositoryFeatureFileClaim>;
|
|
@@ -2,9 +2,5 @@ export declare function getFeatureConfigFromRef(featureName: string, featureRef:
|
|
|
2
2
|
featureArgs?: any, repo?: string, owner?: string): Promise<any>;
|
|
3
3
|
export declare function getFeatureConfig(featureName: string, version: string, featureOwner: any, // -> cr
|
|
4
4
|
featureArgs?: any, repo?: string, owner?: string): Promise<any>;
|
|
5
|
-
export declare function resolveFeatureCommit(owner: string, repo: string, reference: string): Promise<{
|
|
6
|
-
sha: string;
|
|
7
|
-
tags: string[];
|
|
8
|
-
}>;
|
|
9
5
|
export declare function prepareFeature(featureName: string, version: string, repo?: string, owner?: string): Promise<void>;
|
|
10
6
|
export declare function downloadFeatureZip(repo: string, featureName: string, reference: string, owner?: string): Promise<string>;
|
|
@@ -19,20 +19,9 @@ export interface ExpectedFile {
|
|
|
19
19
|
targetBranch: string;
|
|
20
20
|
userManaged: boolean;
|
|
21
21
|
}
|
|
22
|
-
export interface Traceability {
|
|
23
|
-
owner?: string;
|
|
24
|
-
repo?: string;
|
|
25
|
-
name?: string;
|
|
26
|
-
version?: string;
|
|
27
|
-
ref?: string;
|
|
28
|
-
url?: string;
|
|
29
|
-
sha?: string;
|
|
30
|
-
tags?: string[];
|
|
31
|
-
}
|
|
32
22
|
export interface ExpectedOutput {
|
|
33
23
|
files: ExpectedFile[];
|
|
34
24
|
patches: unknown[];
|
|
35
|
-
traceability?: Traceability;
|
|
36
25
|
}
|
|
37
26
|
export interface RenderTest {
|
|
38
27
|
name: string;
|
|
@@ -68,7 +68,7 @@ declare const _default: {
|
|
|
68
68
|
getPrFiles: typeof import("./src/pull_request").getPrFiles;
|
|
69
69
|
filterPrBy: (filter: {
|
|
70
70
|
title: string;
|
|
71
|
-
state: "
|
|
71
|
+
state: "closed" | "all" | "open";
|
|
72
72
|
repo: string;
|
|
73
73
|
owner: string;
|
|
74
74
|
userType: "Bot" | "User";
|
|
@@ -80,7 +80,7 @@ declare const _default: {
|
|
|
80
80
|
create: (owner: string, repo: string, title: string, body: string, labels?: string[], octokit?: any) => Promise<any>;
|
|
81
81
|
update: (owner: string, repo: string, issue_number: number, title: string, body: string, labels?: string[], octokit?: any) => Promise<any>;
|
|
82
82
|
close: (owner: string, repo: string, issue_number: number, octokit?: any) => Promise<any>;
|
|
83
|
-
filterBy: (owner: string, repo: string, title: string, labels: string, state?: "
|
|
83
|
+
filterBy: (owner: string, repo: string, title: string, labels: string, state?: "closed" | "all" | "open", creator?: string, assignee?: string, octokit?: any) => Promise<any>;
|
|
84
84
|
upsertByTitle: (owner: string, repo: string, title: string, body: string, labels?: string[], octokit?: any) => Promise<any>;
|
|
85
85
|
};
|
|
86
86
|
branches: {
|
|
@@ -853,7 +853,7 @@ export declare function withProfile(profileName: string): {
|
|
|
853
853
|
create: (owner: string, repo: string, title: string, body: string, labels?: string[]) => Promise<any>;
|
|
854
854
|
update: (owner: string, repo: string, issue_number: number, title: string, body: string, labels?: string[]) => Promise<any>;
|
|
855
855
|
close: (owner: string, repo: string, issue_number: number) => Promise<any>;
|
|
856
|
-
filterBy: (owner: string, repo: string, title: string, labels: string, state?: "
|
|
856
|
+
filterBy: (owner: string, repo: string, title: string, labels: string, state?: "closed" | "all" | "open", creator?: string, assignee?: string) => Promise<any>;
|
|
857
857
|
upsertByTitle: (owner: string, repo: string, title: string, body: string, labels?: string[]) => Promise<any>;
|
|
858
858
|
};
|
|
859
859
|
workflow: {
|