@firestartr/cli 2.9.0-snapshot-org-variables-section-1 → 2.9.0-snapshot-org-variables-section-3
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
CHANGED
|
@@ -319300,6 +319300,25 @@ function extractAllRefs(claimData) {
|
|
|
319300
319300
|
refs.push(...secretsRefs);
|
|
319301
319301
|
break;
|
|
319302
319302
|
}
|
|
319303
|
+
case 'OrgSettingsClaim': {
|
|
319304
|
+
const actionsVariables = parsedClaim.providers?.github?.actions_variables;
|
|
319305
|
+
if (Array.isArray(actionsVariables)) {
|
|
319306
|
+
for (const variable of actionsVariables) {
|
|
319307
|
+
if (variable.visibility !== 'selected')
|
|
319308
|
+
continue;
|
|
319309
|
+
const selectedRepos = variable.selected_repositories;
|
|
319310
|
+
if (!Array.isArray(selectedRepos))
|
|
319311
|
+
continue;
|
|
319312
|
+
for (const repoRef of selectedRepos) {
|
|
319313
|
+
const match = repoRef.match(/^component:(.+)$/);
|
|
319314
|
+
if (match) {
|
|
319315
|
+
refs.push(`ComponentClaim-${match[1]}`);
|
|
319316
|
+
}
|
|
319317
|
+
}
|
|
319318
|
+
}
|
|
319319
|
+
}
|
|
319320
|
+
break;
|
|
319321
|
+
}
|
|
319303
319322
|
}
|
|
319304
319323
|
logger.info(`Refs for ${parsedClaim.kind}-${parsedClaim.name}: ${[...new Set(refs)].join(',')}`);
|
|
319305
319324
|
return [...new Set(refs)];
|
|
@@ -329168,6 +329187,7 @@ function validateGithubOrgSettingsSingleton(crs) {
|
|
|
329168
329187
|
const GITHUB_ORG_VARIABLE_SECTION_KIND = 'FirestartrGithubOrganizationVariableSection';
|
|
329169
329188
|
const githubOrgVariableSection_FIRESTARTR_CLAIM_REF_ANNOTATION = 'firestartr.dev/claim-ref';
|
|
329170
329189
|
const githubOrgVariableSection_CLAIM_REF_LABEL = 'claim-ref';
|
|
329190
|
+
const COMPONENT_REF_PATTERN = /^component:(.+)$/;
|
|
329171
329191
|
function githubOrgVariableSection_formatResourceRef(name, claimRef) {
|
|
329172
329192
|
return claimRef ? `${name} (claim: ${claimRef})` : name;
|
|
329173
329193
|
}
|
|
@@ -329215,6 +329235,34 @@ function validateActionsVariablesUniqueness(crs) {
|
|
|
329215
329235
|
}
|
|
329216
329236
|
}
|
|
329217
329237
|
}
|
|
329238
|
+
function validateActionsVariablesSelectedRepositories(renderClaims) {
|
|
329239
|
+
for (const claimKey of Object.keys(renderClaims)) {
|
|
329240
|
+
if (!claimKey.startsWith('OrgSettingsClaim-'))
|
|
329241
|
+
continue;
|
|
329242
|
+
const claimData = renderClaims[claimKey];
|
|
329243
|
+
const claim = claimData?.claim;
|
|
329244
|
+
const actionsVariables = claim?.providers?.github?.actions_variables;
|
|
329245
|
+
if (!Array.isArray(actionsVariables))
|
|
329246
|
+
continue;
|
|
329247
|
+
for (const variable of actionsVariables) {
|
|
329248
|
+
if (variable.visibility !== 'selected')
|
|
329249
|
+
continue;
|
|
329250
|
+
const selectedRepos = variable.selected_repositories;
|
|
329251
|
+
if (!Array.isArray(selectedRepos) || selectedRepos.length === 0)
|
|
329252
|
+
continue;
|
|
329253
|
+
for (const ref of selectedRepos) {
|
|
329254
|
+
const match = ref.match(COMPONENT_REF_PATTERN);
|
|
329255
|
+
if (!match)
|
|
329256
|
+
continue;
|
|
329257
|
+
const componentName = match[1];
|
|
329258
|
+
const expectedKey = `ComponentClaim-${componentName}`;
|
|
329259
|
+
if (!renderClaims[expectedKey]) {
|
|
329260
|
+
throw new Error(`CrossReference error: OrgSettingsClaim/${claim.name} references a non-existent component "${componentName}" in actions_variables.${variable.name}.selected_repositories`);
|
|
329261
|
+
}
|
|
329262
|
+
}
|
|
329263
|
+
}
|
|
329264
|
+
}
|
|
329265
|
+
}
|
|
329218
329266
|
|
|
329219
329267
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/renderer/renderer.ts
|
|
329220
329268
|
|
|
@@ -329248,6 +329296,7 @@ async function renderer_render(catalogScope, firestartrScope, claimList) {
|
|
|
329248
329296
|
try {
|
|
329249
329297
|
validateSubReferences(data.renderClaims);
|
|
329250
329298
|
validateComponentPagesPath(data.renderClaims);
|
|
329299
|
+
validateActionsVariablesSelectedRepositories(data.renderClaims);
|
|
329251
329300
|
validateTfStateKeyUniqueness(result);
|
|
329252
329301
|
validateGithubOrgSettingsSingleton(fullCrSet);
|
|
329253
329302
|
validateGithubOrgVariableSectionSingleton(result);
|
|
@@ -522561,7 +522610,7 @@ const crsStatusSubcommand = {
|
|
|
522561
522610
|
};
|
|
522562
522611
|
|
|
522563
522612
|
;// CONCATENATED MODULE: ./package.json
|
|
522564
|
-
const package_namespaceObject = JSON.parse('{"i8":"2.9.0-snapshot-org-variables-section-
|
|
522613
|
+
const package_namespaceObject = JSON.parse('{"i8":"2.9.0-snapshot-org-variables-section-3"}');
|
|
522565
522614
|
;// CONCATENATED MODULE: ../../package.json
|
|
522566
522615
|
const package_namespaceObject_1 = {"i8":"2.8.0"};
|
|
522567
522616
|
;// CONCATENATED MODULE: ./src/subcommands/index.ts
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { RenderedCrMap } from '../renderer/types';
|
|
1
|
+
import { RenderClaims, RenderedCrMap } from '../renderer/types';
|
|
2
2
|
export declare function validateGithubOrgVariableSectionSingleton(crs: RenderedCrMap): void;
|
|
3
3
|
export declare function validateActionsVariablesUniqueness(crs: RenderedCrMap): void;
|
|
4
|
+
export declare function validateActionsVariablesSelectedRepositories(renderClaims: RenderClaims): void;
|