@firestartr/cli 2.9.0-snapshot-org-variables-section-5 → 2.9.0-snapshot-org-variables-section-6

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
@@ -316758,9 +316758,12 @@ class UUIDInitializer extends InitializerPatches {
316758
316758
  },
316759
316759
  apply(cr) {
316760
316760
  const ctx = helperCTX(this);
316761
- const uuid = previousCR?.spec?.firestartr?.tfStateKey ||
316762
- claim.providers?.[ctx.provider]?.tfStateKey ||
316763
- (0,wrapper.v4)();
316761
+ const reusePrevious = previousCR && previousCR.kind === ctx.kind;
316762
+ const uuid = reusePrevious
316763
+ ? previousCR?.spec?.firestartr?.tfStateKey ||
316764
+ claim.providers?.[ctx.provider]?.tfStateKey ||
316765
+ (0,wrapper.v4)()
316766
+ : claim.providers?.[ctx.provider]?.tfStateKey || (0,wrapper.v4)();
316764
316767
  if (!cr.spec)
316765
316768
  cr.spec = {};
316766
316769
  if (!cr.spec.firestartr)
@@ -317302,6 +317305,7 @@ const ONE_WAY_DEFINITIONS = [
317302
317305
  '/spec/vars',
317303
317306
  '/spec/actions/oidc',
317304
317307
  '/spec/repo/labels',
317308
+ '/spec/actionsVariables',
317305
317309
  ];
317306
317310
  function applyOneWayDefs(crSpecs) {
317307
317311
  const crSpecsClone = JSON.parse(JSON.stringify(crSpecs));
@@ -319297,6 +319301,25 @@ function extractAllRefs(claimData) {
319297
319301
  refs.push(...secretsRefs);
319298
319302
  break;
319299
319303
  }
319304
+ case 'OrgSettingsClaim': {
319305
+ const actionsVariables = parsedClaim.providers?.github?.actions_variables;
319306
+ if (Array.isArray(actionsVariables)) {
319307
+ for (const variable of actionsVariables) {
319308
+ if (variable.visibility !== 'selected')
319309
+ continue;
319310
+ const selectedRepos = variable.selected_repositories;
319311
+ if (!Array.isArray(selectedRepos))
319312
+ continue;
319313
+ for (const repoRef of selectedRepos) {
319314
+ const match = repoRef.match(/^component:(.+)$/);
319315
+ if (match) {
319316
+ refs.push(`ComponentClaim-${match[1]}`);
319317
+ }
319318
+ }
319319
+ }
319320
+ }
319321
+ break;
319322
+ }
319300
319323
  }
319301
319324
  logger.info(`Refs for ${parsedClaim.kind}-${parsedClaim.name}: ${[...new Set(refs)].join(',')}`);
319302
319325
  return [...new Set(refs)];
@@ -320423,6 +320446,49 @@ const organizationSettingsProperties = {
320423
320446
  secret_scanning_push_protection_enabled_for_new_repositories: {
320424
320447
  type: 'boolean',
320425
320448
  },
320449
+ actions_variables: {
320450
+ type: 'array',
320451
+ items: {
320452
+ type: 'object',
320453
+ properties: {
320454
+ name: {
320455
+ type: 'string',
320456
+ pattern: '^[A-Za-z0-9_]+$',
320457
+ },
320458
+ value: {
320459
+ type: 'string',
320460
+ },
320461
+ visibility: {
320462
+ type: 'string',
320463
+ enum: ['all', 'private', 'selected'],
320464
+ },
320465
+ selected_repositories: {
320466
+ type: 'array',
320467
+ items: {
320468
+ $ref: 'firestartr.dev://common/FirestartrComponentRef',
320469
+ },
320470
+ },
320471
+ },
320472
+ required: ['name', 'value', 'visibility'],
320473
+ additionalProperties: false,
320474
+ allOf: [
320475
+ {
320476
+ if: {
320477
+ properties: {
320478
+ visibility: { const: 'selected' },
320479
+ },
320480
+ required: ['visibility'],
320481
+ },
320482
+ then: {},
320483
+ else: {
320484
+ properties: {
320485
+ selected_repositories: { type: 'array', maxItems: 0 },
320486
+ },
320487
+ },
320488
+ },
320489
+ ],
320490
+ },
320491
+ },
320426
320492
  };
320427
320493
  /* harmony default export */ const github_orgsettings_schema = ({
320428
320494
  $schema: SCHEMA,
@@ -323774,7 +323840,7 @@ const VARIANT_OF_ANNOTATION = 'firestartr.dev/variant-of';
323774
323840
  function isVariantCR(cr) {
323775
323841
  return cr.metadata?.annotations?.[VARIANT_OF_ANNOTATION] !== undefined;
323776
323842
  }
323777
- function getPreviousCRfromClaim(claim, previousCRs) {
323843
+ function getPreviousCRfromClaim(claim, previousCRs, expectedKind) {
323778
323844
  const previousCRsKeys = Object.keys(previousCRs);
323779
323845
  const isVariantClaim = !!claim._parentClaimName;
323780
323846
  for (const previousCRKey of previousCRsKeys) {
@@ -323783,6 +323849,8 @@ function getPreviousCRfromClaim(claim, previousCRs) {
323783
323849
  continue;
323784
323850
  if (isExcludedFromPreviousCR(previousCR.kind))
323785
323851
  continue;
323852
+ if (expectedKind && previousCR.kind !== expectedKind)
323853
+ continue;
323786
323854
  const crVariant = isVariantCR(previousCR);
323787
323855
  if (isVariantClaim && !crVariant)
323788
323856
  continue;
@@ -324797,6 +324865,254 @@ var FirestartrGithubOrganizationSettingsSpecContextProviderRefKind;
324797
324865
  /** FirestartrProviderConfig */
324798
324866
  FirestartrGithubOrganizationSettingsSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
324799
324867
  })(FirestartrGithubOrganizationSettingsSpecContextProviderRefKind || (FirestartrGithubOrganizationSettingsSpecContextProviderRefKind = {}));
324868
+ /**
324869
+ * A resource to handle GitHub Organization Actions Variables.
324870
+ *
324871
+ * @schema FirestartrGithubOrganizationVariableSection
324872
+ */
324873
+ class FirestartrGithubOrganizationVariableSection extends lib.ApiObject {
324874
+ /**
324875
+ * Renders a Kubernetes manifest for "FirestartrGithubOrganizationVariableSection".
324876
+ *
324877
+ * This can be used to inline resource manifests inside other objects (e.g. as templates).
324878
+ *
324879
+ * @param props initialization props
324880
+ */
324881
+ static manifest(props) {
324882
+ return {
324883
+ ...FirestartrGithubOrganizationVariableSection.GVK,
324884
+ ...toJson_FirestartrGithubOrganizationVariableSectionProps(props),
324885
+ };
324886
+ }
324887
+ /**
324888
+ * Defines a "FirestartrGithubOrganizationVariableSection" API object
324889
+ * @param scope the scope in which to define this object
324890
+ * @param id a scope-local name for the object
324891
+ * @param props initialization props
324892
+ */
324893
+ constructor(scope, id, props) {
324894
+ super(scope, id, {
324895
+ ...FirestartrGithubOrganizationVariableSection.GVK,
324896
+ ...props,
324897
+ });
324898
+ }
324899
+ /**
324900
+ * Renders the object to Kubernetes JSON.
324901
+ */
324902
+ toJson() {
324903
+ const resolved = super.toJson();
324904
+ return {
324905
+ ...FirestartrGithubOrganizationVariableSection.GVK,
324906
+ ...toJson_FirestartrGithubOrganizationVariableSectionProps(resolved),
324907
+ };
324908
+ }
324909
+ }
324910
+ /**
324911
+ * Returns the apiVersion and kind for "FirestartrGithubOrganizationVariableSection"
324912
+ */
324913
+ FirestartrGithubOrganizationVariableSection.GVK = {
324914
+ apiVersion: 'firestartr.dev/v1',
324915
+ kind: 'FirestartrGithubOrganizationVariableSection',
324916
+ };
324917
+
324918
+ /**
324919
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionProps' to JSON representation.
324920
+ */
324921
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324922
+ function toJson_FirestartrGithubOrganizationVariableSectionProps(obj) {
324923
+ if (obj === undefined) {
324924
+ return undefined;
324925
+ }
324926
+ const result = {
324927
+ 'metadata': obj.metadata,
324928
+ 'spec': toJson_FirestartrGithubOrganizationVariableSectionSpec(obj.spec),
324929
+ };
324930
+ // filter undefined values
324931
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
324932
+ }
324933
+ /**
324934
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpec' to JSON representation.
324935
+ */
324936
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324937
+ function toJson_FirestartrGithubOrganizationVariableSectionSpec(obj) {
324938
+ if (obj === undefined) {
324939
+ return undefined;
324940
+ }
324941
+ const result = {
324942
+ 'org': obj.org,
324943
+ 'actionsVariables': obj.actionsVariables?.map(y => toJson_FirestartrGithubOrganizationVariableSectionSpecActionsVariables(y)),
324944
+ 'context': toJson_FirestartrGithubOrganizationVariableSectionSpecContext(obj.context),
324945
+ 'firestartr': toJson_FirestartrGithubOrganizationVariableSectionSpecFirestartr(obj.firestartr),
324946
+ 'writeConnectionSecretToRef': toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef(obj.writeConnectionSecretToRef),
324947
+ };
324948
+ // filter undefined values
324949
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
324950
+ }
324951
+ /**
324952
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecActionsVariables' to JSON representation.
324953
+ */
324954
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324955
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecActionsVariables(obj) {
324956
+ if (obj === undefined) {
324957
+ return undefined;
324958
+ }
324959
+ const result = {
324960
+ 'name': obj.name,
324961
+ 'value': obj.value,
324962
+ 'visibility': obj.visibility,
324963
+ 'selectedRepositories': obj.selectedRepositories?.map(y => y),
324964
+ };
324965
+ // filter undefined values
324966
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
324967
+ }
324968
+ /**
324969
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContext' to JSON representation.
324970
+ */
324971
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324972
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContext(obj) {
324973
+ if (obj === undefined) {
324974
+ return undefined;
324975
+ }
324976
+ const result = {
324977
+ 'backend': toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackend(obj.backend),
324978
+ 'provider': toJson_FirestartrGithubOrganizationVariableSectionSpecContextProvider(obj.provider),
324979
+ };
324980
+ // filter undefined values
324981
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
324982
+ }
324983
+ /**
324984
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecFirestartr' to JSON representation.
324985
+ */
324986
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324987
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecFirestartr(obj) {
324988
+ if (obj === undefined) {
324989
+ return undefined;
324990
+ }
324991
+ const result = {
324992
+ 'tfStateKey': obj.tfStateKey,
324993
+ };
324994
+ // filter undefined values
324995
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
324996
+ }
324997
+ /**
324998
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef' to JSON representation.
324999
+ */
325000
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325001
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef(obj) {
325002
+ if (obj === undefined) {
325003
+ return undefined;
325004
+ }
325005
+ const result = {
325006
+ 'name': obj.name,
325007
+ 'outputs': obj.outputs?.map(y => toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs(y)),
325008
+ };
325009
+ // filter undefined values
325010
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325011
+ }
325012
+ /* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325013
+ /**
325014
+ * Visibility of the variable
325015
+ *
325016
+ * @schema FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility
325017
+ */
325018
+ var FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility;
325019
+ (function (FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility) {
325020
+ /** all */
325021
+ FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["ALL"] = "all";
325022
+ /** private */
325023
+ FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["PRIVATE"] = "private";
325024
+ /** selected */
325025
+ FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["SELECTED"] = "selected";
325026
+ })(FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility || (FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility = {}));
325027
+ /**
325028
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextBackend' to JSON representation.
325029
+ */
325030
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325031
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackend(obj) {
325032
+ if (obj === undefined) {
325033
+ return undefined;
325034
+ }
325035
+ const result = {
325036
+ 'ref': toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackendRef(obj.ref),
325037
+ };
325038
+ // filter undefined values
325039
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325040
+ }
325041
+ /**
325042
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextProvider' to JSON representation.
325043
+ */
325044
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325045
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContextProvider(obj) {
325046
+ if (obj === undefined) {
325047
+ return undefined;
325048
+ }
325049
+ const result = {
325050
+ 'ref': toJson_FirestartrGithubOrganizationVariableSectionSpecContextProviderRef(obj.ref),
325051
+ };
325052
+ // filter undefined values
325053
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325054
+ }
325055
+ /**
325056
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs' to JSON representation.
325057
+ */
325058
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325059
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs(obj) {
325060
+ if (obj === undefined) {
325061
+ return undefined;
325062
+ }
325063
+ const result = {
325064
+ 'key': obj.key,
325065
+ };
325066
+ // filter undefined values
325067
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325068
+ }
325069
+ /**
325070
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextBackendRef' to JSON representation.
325071
+ */
325072
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325073
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackendRef(obj) {
325074
+ if (obj === undefined) {
325075
+ return undefined;
325076
+ }
325077
+ const result = {
325078
+ 'kind': obj.kind,
325079
+ 'name': obj.name,
325080
+ };
325081
+ // filter undefined values
325082
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325083
+ }
325084
+ /**
325085
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextProviderRef' to JSON representation.
325086
+ */
325087
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325088
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContextProviderRef(obj) {
325089
+ if (obj === undefined) {
325090
+ return undefined;
325091
+ }
325092
+ const result = {
325093
+ 'kind': obj.kind,
325094
+ 'name': obj.name,
325095
+ };
325096
+ // filter undefined values
325097
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325098
+ }
325099
+ /* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325100
+ /**
325101
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind
325102
+ */
325103
+ var FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind;
325104
+ (function (FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind) {
325105
+ /** FirestartrProviderConfig */
325106
+ FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
325107
+ })(FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind || (FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind = {}));
325108
+ /**
325109
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind
325110
+ */
325111
+ var FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind;
325112
+ (function (FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind) {
325113
+ /** FirestartrProviderConfig */
325114
+ FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
325115
+ })(FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind || (FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind = {}));
324800
325116
  /**
324801
325117
  * A resource to handle GitHub Organization Webhooks
324802
325118
  *
@@ -327646,6 +327962,65 @@ class GithubOrgSettingsChart extends BaseGithubChart {
327646
327962
  }
327647
327963
  }
327648
327964
 
327965
+ ;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/github/orgVariableSectionChart.ts
327966
+
327967
+
327968
+
327969
+ class GithubOrgVariableSectionChart extends BaseGithubChart {
327970
+ template() {
327971
+ const claim = this.get('claim');
327972
+ const firestartrId = this.get('firestartrId');
327973
+ const githubProvider = claim.providers.github;
327974
+ const actionsVariables = (githubProvider.actions_variables || []).map((v) => {
327975
+ const entry = {
327976
+ name: v.name,
327977
+ value: v.value,
327978
+ visibility: v.visibility,
327979
+ };
327980
+ if (v.selected_repositories && v.selected_repositories.length > 0) {
327981
+ entry.selectedRepositories = v.selected_repositories.map((ref) => {
327982
+ const match = ref.match(/^component:(.+)$/);
327983
+ if (!match) {
327984
+ throw new ChartRenderError('OrgSettingsClaim', claim.name, `Invalid component ref "${ref}" in selected_repositories. Expected format: component:<name>`);
327985
+ }
327986
+ const componentName = match[1];
327987
+ const resolvedCr = this.refResolver('ComponentClaim', componentName);
327988
+ const org = resolvedCr?.spec?.org;
327989
+ const repoName = resolvedCr?.metadata?.annotations?.['firestartr.dev/external-name'] || resolvedCr?.metadata?.name?.replace(/-[0-9a-f-]{36}$/, '');
327990
+ if (!org || !repoName) {
327991
+ throw new ChartRenderError('OrgSettingsClaim', claim.name, `Referenced component "${componentName}" has no GitHub provider configured`);
327992
+ }
327993
+ return `${org}/${repoName}`;
327994
+ });
327995
+ }
327996
+ return entry;
327997
+ });
327998
+ const template = {
327999
+ metadata: {
328000
+ name: githubProvider.name,
328001
+ },
328002
+ spec: {
328003
+ org: githubProvider.org,
328004
+ actionsVariables,
328005
+ firestartr: {
328006
+ tfStateKey: firestartrId,
328007
+ },
328008
+ writeConnectionSecretToRef: {
328009
+ name: `firestartrgithuborganizationvariablesection-${githubProvider.name}-outputs`.toLowerCase(),
328010
+ outputs: [{ key: 'managed_variables' }, { key: 'variable_ids' }],
328011
+ },
328012
+ },
328013
+ };
328014
+ return JSON.parse(JSON.stringify(template));
328015
+ }
328016
+ gvk() {
328017
+ return FirestartrGithubOrganizationVariableSection.GVK;
328018
+ }
328019
+ instanceApiObject(template) {
328020
+ return new FirestartrGithubOrganizationVariableSection(this, template.metadata.name, template);
328021
+ }
328022
+ }
328023
+
327649
328024
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/github/index.ts
327650
328025
 
327651
328026
 
@@ -327653,6 +328028,7 @@ class GithubOrgSettingsChart extends BaseGithubChart {
327653
328028
 
327654
328029
 
327655
328030
 
328031
+
327656
328032
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/catalog/base.ts
327657
328033
 
327658
328034
  class BaseCatalogChart extends BaseChart {
@@ -328400,6 +328776,7 @@ class SecretsChart extends BaseSecretsChart {
328400
328776
  SecretsChart: SecretsChart,
328401
328777
  GithubOrgWebhookChart: GithubOrgWebhookChart,
328402
328778
  GithubOrgSettingsChart: GithubOrgSettingsChart,
328779
+ GithubOrgVariableSectionChart: GithubOrgVariableSectionChart,
328403
328780
  });
328404
328781
 
328405
328782
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/renderer/claims-render.ts
@@ -328444,13 +328821,24 @@ async function renderClaims(catalogScope, firestartrScope, data) {
328444
328821
  if (configuredProvider !== AllowedProviders.all.toString()) {
328445
328822
  providers = providers.filter((provider) => provider === configuredProvider);
328446
328823
  }
328447
- const previousCR = getPreviousCRfromClaim(claim, crs);
328824
+ const expectedKind = claim.kind === 'OrgSettingsClaim'
328825
+ ? 'FirestartrGithubOrganizationSettings'
328826
+ : undefined;
328827
+ const previousCR = getPreviousCRfromClaim(claim, crs, expectedKind);
328828
+ let variableSectionPreviousCR = undefined;
328829
+ if (claim.kind === 'OrgSettingsClaim') {
328830
+ variableSectionPreviousCR = getPreviousCRfromClaim(claim, crs, 'FirestartrGithubOrganizationVariableSection');
328831
+ }
328448
328832
  const patches = await extractPatches(renderClaims[claimKey], previousCR);
328833
+ let variableSectionPatches = undefined;
328834
+ if (claim.kind === 'OrgSettingsClaim') {
328835
+ variableSectionPatches = await extractPatches(renderClaims[claimKey], variableSectionPreviousCR);
328836
+ }
328449
328837
  if (!previousCR) {
328450
328838
  logger.debug(`No CR found for claim ${claimKey}, it will be rendered from scratch`);
328451
328839
  }
328452
328840
  const claimPath = renderClaims[claimKey].claimPath;
328453
- const { firestartrEntity, extraCharts, catalogEntity } = await renderClaim(catalogScope, firestartrScope, claim, patches, previousCR, claimPath);
328841
+ const { firestartrEntity, extraCharts, catalogEntity } = await renderClaim(catalogScope, firestartrScope, claim, patches, previousCR, claimPath, variableSectionPatches);
328454
328842
  if (catalogEntity) {
328455
328843
  result[`${catalogEntity.kind}-${catalogEntity.metadata.name}`] =
328456
328844
  catalogEntity.toJson();
@@ -328479,7 +328867,7 @@ async function renderClaims(catalogScope, firestartrScope, data) {
328479
328867
  }
328480
328868
  return result;
328481
328869
  }
328482
- async function renderClaim(catalogScope, firestartrScope, claim, patches, previousCR = null, claimPath) {
328870
+ async function renderClaim(catalogScope, firestartrScope, claim, patches, previousCR = null, claimPath, variableSectionPatches) {
328483
328871
  let catalogEntity = undefined;
328484
328872
  let firestartrEntity = undefined;
328485
328873
  const extraCharts = [];
@@ -328627,6 +329015,25 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
328627
329015
  case 'OrgSettingsClaim':
328628
329016
  if (loadGithub) {
328629
329017
  firestartrEntity = new charts.GithubOrgSettingsChart(firestartrScope, `github-${chartId}`, firestartrId, claim, renderPatches);
329018
+ const variableSectionFirestartrId = firestartrId
329019
+ ? `${firestartrId}-variables`
329020
+ : null;
329021
+ const vsRenderPatches = variableSectionPatches
329022
+ ? variableSectionPatches.filter((patch) => !patch.isPostPatch)
329023
+ : renderPatches;
329024
+ const vsPostPatches = variableSectionPatches
329025
+ ? variableSectionPatches.filter((patch) => patch.isPostPatch)
329026
+ : postPatches;
329027
+ const variableSectionChart = new charts.GithubOrgVariableSectionChart(firestartrScope, `github-variables-${chartId}`, variableSectionFirestartrId, claim, vsRenderPatches);
329028
+ await variableSectionChart.render();
329029
+ const variableSectionObject = await variableSectionChart.postRenderer(vsPostPatches);
329030
+ extraCharts.push({
329031
+ claim: {
329032
+ kind: claim.kind,
329033
+ name: `${claim.name}-variable-section`,
329034
+ },
329035
+ chart: variableSectionObject,
329036
+ });
328630
329037
  }
328631
329038
  break;
328632
329039
  default:
@@ -328791,6 +329198,87 @@ function validateGithubOrgSettingsSingleton(crs) {
328791
329198
  }
328792
329199
  }
328793
329200
 
329201
+ ;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/githubOrgVariableSection.ts
329202
+ const GITHUB_ORG_VARIABLE_SECTION_KIND = 'FirestartrGithubOrganizationVariableSection';
329203
+ const githubOrgVariableSection_FIRESTARTR_CLAIM_REF_ANNOTATION = 'firestartr.dev/claim-ref';
329204
+ const githubOrgVariableSection_CLAIM_REF_LABEL = 'claim-ref';
329205
+ const COMPONENT_REF_PATTERN = /^component:(.+)$/;
329206
+ function githubOrgVariableSection_formatResourceRef(name, claimRef) {
329207
+ return claimRef ? `${name} (claim: ${claimRef})` : name;
329208
+ }
329209
+ function validateGithubOrgVariableSectionSingleton(crs) {
329210
+ const refsByOrg = new Map();
329211
+ for (const crKey of Object.keys(crs)) {
329212
+ const cr = crs[crKey];
329213
+ if (cr.kind !== GITHUB_ORG_VARIABLE_SECTION_KIND)
329214
+ continue;
329215
+ const org = cr.spec?.org;
329216
+ if (typeof org !== 'string' || !org)
329217
+ continue;
329218
+ const name = cr.metadata?.name || crKey;
329219
+ const claimRef = cr.metadata?.annotations?.[githubOrgVariableSection_FIRESTARTR_CLAIM_REF_ANNOTATION] ||
329220
+ cr.metadata?.labels?.[githubOrgVariableSection_CLAIM_REF_LABEL];
329221
+ const normalizedOrg = org.toLowerCase();
329222
+ const refs = refsByOrg.get(normalizedOrg) || [];
329223
+ refs.push(githubOrgVariableSection_formatResourceRef(name, claimRef));
329224
+ refsByOrg.set(normalizedOrg, refs);
329225
+ }
329226
+ for (const [org, refs] of refsByOrg.entries()) {
329227
+ if (refs.length < 2)
329228
+ continue;
329229
+ throw new Error(`Duplicate ${GITHUB_ORG_VARIABLE_SECTION_KIND} resources found for GitHub organization "${org}": ${refs.join(', ')}`);
329230
+ }
329231
+ }
329232
+ function validateActionsVariablesUniqueness(crs) {
329233
+ for (const crKey of Object.keys(crs)) {
329234
+ const cr = crs[crKey];
329235
+ if (cr.kind !== GITHUB_ORG_VARIABLE_SECTION_KIND)
329236
+ continue;
329237
+ const actionsVariables = cr.spec?.actionsVariables;
329238
+ if (!Array.isArray(actionsVariables))
329239
+ continue;
329240
+ const names = new Set();
329241
+ for (const variable of actionsVariables) {
329242
+ const varName = variable?.name;
329243
+ if (!varName)
329244
+ continue;
329245
+ if (names.has(varName)) {
329246
+ const org = cr.spec?.org || 'unknown';
329247
+ throw new Error(`Duplicate action variable name "${varName}" found in ${GITHUB_ORG_VARIABLE_SECTION_KIND} for organization "${org}"`);
329248
+ }
329249
+ names.add(varName);
329250
+ }
329251
+ }
329252
+ }
329253
+ function validateActionsVariablesSelectedRepositories(renderClaims) {
329254
+ for (const claimKey of Object.keys(renderClaims)) {
329255
+ if (!claimKey.startsWith('OrgSettingsClaim-'))
329256
+ continue;
329257
+ const claimData = renderClaims[claimKey];
329258
+ const claim = claimData?.claim;
329259
+ const actionsVariables = claim?.providers?.github?.actions_variables;
329260
+ if (!Array.isArray(actionsVariables))
329261
+ continue;
329262
+ for (const variable of actionsVariables) {
329263
+ if (variable.visibility !== 'selected')
329264
+ continue;
329265
+ const selectedRepos = variable.selected_repositories;
329266
+ if (!Array.isArray(selectedRepos) || selectedRepos.length === 0)
329267
+ continue;
329268
+ for (const ref of selectedRepos) {
329269
+ const match = ref.match(COMPONENT_REF_PATTERN);
329270
+ if (!match)
329271
+ continue;
329272
+ const componentName = match[1];
329273
+ const expectedKey = `ComponentClaim-${componentName}`;
329274
+ if (!renderClaims[expectedKey]) {
329275
+ throw new Error(`CrossReference error: OrgSettingsClaim/${claim.name} references a non-existent component "${componentName}" in actions_variables.${variable.name}.selected_repositories`);
329276
+ }
329277
+ }
329278
+ }
329279
+ }
329280
+ }
329281
+
328794
329282
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/renderer/renderer.ts
328795
329283
 
328796
329284
 
@@ -328801,6 +329289,7 @@ function validateGithubOrgSettingsSingleton(crs) {
328801
329289
 
328802
329290
 
328803
329291
 
329292
+
328804
329293
  /*
328805
329294
  * Function called when rendering but not importing
328806
329295
  *
@@ -328822,8 +329311,11 @@ async function renderer_render(catalogScope, firestartrScope, claimList) {
328822
329311
  try {
328823
329312
  validateSubReferences(data.renderClaims);
328824
329313
  validateComponentPagesPath(data.renderClaims);
329314
+ validateActionsVariablesSelectedRepositories(data.renderClaims);
328825
329315
  validateTfStateKeyUniqueness(result);
328826
329316
  validateGithubOrgSettingsSingleton(fullCrSet);
329317
+ validateGithubOrgVariableSectionSingleton(result);
329318
+ validateActionsVariablesUniqueness(result);
328827
329319
  validateCrSizes(result);
328828
329320
  validatePermissionsUniqueness(result);
328829
329321
  }
@@ -522133,9 +522625,9 @@ const crsStatusSubcommand = {
522133
522625
  };
522134
522626
 
522135
522627
  ;// CONCATENATED MODULE: ./package.json
522136
- const package_namespaceObject = JSON.parse('{"i8":"2.9.0-snapshot-org-variables-section-5"}');
522628
+ const package_namespaceObject = JSON.parse('{"i8":"2.9.0-snapshot-org-variables-section-6"}');
522137
522629
  ;// CONCATENATED MODULE: ../../package.json
522138
- const package_namespaceObject_1 = {"i8":"2.9.0"};
522630
+ const package_namespaceObject_1 = {"i8":"2.8.0"};
522139
522631
  ;// CONCATENATED MODULE: ./src/subcommands/index.ts
522140
522632
 
522141
522633
 
@@ -903,6 +903,268 @@ export declare enum FirestartrGithubOrganizationSettingsSpecContextProviderRefKi
903
903
  /** FirestartrProviderConfig */
904
904
  FIRESTARTR_PROVIDER_CONFIG = "FirestartrProviderConfig"
905
905
  }
906
+ /**
907
+ * A resource to handle GitHub Organization Actions Variables.
908
+ *
909
+ * @schema FirestartrGithubOrganizationVariableSection
910
+ */
911
+ export declare class FirestartrGithubOrganizationVariableSection extends ApiObject {
912
+ /**
913
+ * Returns the apiVersion and kind for "FirestartrGithubOrganizationVariableSection"
914
+ */
915
+ static readonly GVK: GroupVersionKind;
916
+ /**
917
+ * Renders a Kubernetes manifest for "FirestartrGithubOrganizationVariableSection".
918
+ *
919
+ * This can be used to inline resource manifests inside other objects (e.g. as templates).
920
+ *
921
+ * @param props initialization props
922
+ */
923
+ static manifest(props: FirestartrGithubOrganizationVariableSectionProps): any;
924
+ /**
925
+ * Defines a "FirestartrGithubOrganizationVariableSection" API object
926
+ * @param scope the scope in which to define this object
927
+ * @param id a scope-local name for the object
928
+ * @param props initialization props
929
+ */
930
+ constructor(scope: Construct, id: string, props: FirestartrGithubOrganizationVariableSectionProps);
931
+ /**
932
+ * Renders the object to Kubernetes JSON.
933
+ */
934
+ toJson(): any;
935
+ }
936
+ /**
937
+ * A resource to handle GitHub Organization Actions Variables.
938
+ *
939
+ * @schema FirestartrGithubOrganizationVariableSection
940
+ */
941
+ export interface FirestartrGithubOrganizationVariableSectionProps {
942
+ /**
943
+ * @schema FirestartrGithubOrganizationVariableSection#metadata
944
+ */
945
+ readonly metadata: ApiObjectMetadata;
946
+ /**
947
+ * @schema FirestartrGithubOrganizationVariableSection#spec
948
+ */
949
+ readonly spec: FirestartrGithubOrganizationVariableSectionSpec;
950
+ }
951
+ /**
952
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionProps' to JSON representation.
953
+ */
954
+ export declare function toJson_FirestartrGithubOrganizationVariableSectionProps(obj: FirestartrGithubOrganizationVariableSectionProps | undefined): Record<string, any> | undefined;
955
+ /**
956
+ * @schema FirestartrGithubOrganizationVariableSectionSpec
957
+ */
958
+ export interface FirestartrGithubOrganizationVariableSectionSpec {
959
+ /**
960
+ * GitHub organization targeted by this resource
961
+ *
962
+ * @schema FirestartrGithubOrganizationVariableSectionSpec#org
963
+ */
964
+ readonly org: string;
965
+ /**
966
+ * GitHub Actions organization-level variables
967
+ *
968
+ * @schema FirestartrGithubOrganizationVariableSectionSpec#actionsVariables
969
+ */
970
+ readonly actionsVariables?: FirestartrGithubOrganizationVariableSectionSpecActionsVariables[];
971
+ /**
972
+ * @schema FirestartrGithubOrganizationVariableSectionSpec#context
973
+ */
974
+ readonly context: FirestartrGithubOrganizationVariableSectionSpecContext;
975
+ /**
976
+ * @schema FirestartrGithubOrganizationVariableSectionSpec#firestartr
977
+ */
978
+ readonly firestartr: FirestartrGithubOrganizationVariableSectionSpecFirestartr;
979
+ /**
980
+ * @schema FirestartrGithubOrganizationVariableSectionSpec#writeConnectionSecretToRef
981
+ */
982
+ readonly writeConnectionSecretToRef: FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef;
983
+ }
984
+ /**
985
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpec' to JSON representation.
986
+ */
987
+ export declare function toJson_FirestartrGithubOrganizationVariableSectionSpec(obj: FirestartrGithubOrganizationVariableSectionSpec | undefined): Record<string, any> | undefined;
988
+ /**
989
+ * @schema FirestartrGithubOrganizationVariableSectionSpecActionsVariables
990
+ */
991
+ export interface FirestartrGithubOrganizationVariableSectionSpecActionsVariables {
992
+ /**
993
+ * Variable name matching GitHub Actions naming rules
994
+ *
995
+ * @schema FirestartrGithubOrganizationVariableSectionSpecActionsVariables#name
996
+ */
997
+ readonly name: string;
998
+ /**
999
+ * Variable value
1000
+ *
1001
+ * @schema FirestartrGithubOrganizationVariableSectionSpecActionsVariables#value
1002
+ */
1003
+ readonly value: string;
1004
+ /**
1005
+ * Visibility of the variable
1006
+ *
1007
+ * @schema FirestartrGithubOrganizationVariableSectionSpecActionsVariables#visibility
1008
+ */
1009
+ readonly visibility: FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility;
1010
+ /**
1011
+ * Repository names in org/repo format
1012
+ *
1013
+ * @schema FirestartrGithubOrganizationVariableSectionSpecActionsVariables#selectedRepositories
1014
+ */
1015
+ readonly selectedRepositories?: string[];
1016
+ }
1017
+ /**
1018
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecActionsVariables' to JSON representation.
1019
+ */
1020
+ export declare function toJson_FirestartrGithubOrganizationVariableSectionSpecActionsVariables(obj: FirestartrGithubOrganizationVariableSectionSpecActionsVariables | undefined): Record<string, any> | undefined;
1021
+ /**
1022
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContext
1023
+ */
1024
+ export interface FirestartrGithubOrganizationVariableSectionSpecContext {
1025
+ /**
1026
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContext#backend
1027
+ */
1028
+ readonly backend: FirestartrGithubOrganizationVariableSectionSpecContextBackend;
1029
+ /**
1030
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContext#provider
1031
+ */
1032
+ readonly provider: FirestartrGithubOrganizationVariableSectionSpecContextProvider;
1033
+ }
1034
+ /**
1035
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContext' to JSON representation.
1036
+ */
1037
+ export declare function toJson_FirestartrGithubOrganizationVariableSectionSpecContext(obj: FirestartrGithubOrganizationVariableSectionSpecContext | undefined): Record<string, any> | undefined;
1038
+ /**
1039
+ * @schema FirestartrGithubOrganizationVariableSectionSpecFirestartr
1040
+ */
1041
+ export interface FirestartrGithubOrganizationVariableSectionSpecFirestartr {
1042
+ /**
1043
+ * @schema FirestartrGithubOrganizationVariableSectionSpecFirestartr#tfStateKey
1044
+ */
1045
+ readonly tfStateKey: string;
1046
+ }
1047
+ /**
1048
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecFirestartr' to JSON representation.
1049
+ */
1050
+ export declare function toJson_FirestartrGithubOrganizationVariableSectionSpecFirestartr(obj: FirestartrGithubOrganizationVariableSectionSpecFirestartr | undefined): Record<string, any> | undefined;
1051
+ /**
1052
+ * @schema FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef
1053
+ */
1054
+ export interface FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef {
1055
+ /**
1056
+ * @schema FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef#name
1057
+ */
1058
+ readonly name: string;
1059
+ /**
1060
+ * @schema FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef#outputs
1061
+ */
1062
+ readonly outputs: FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs[];
1063
+ }
1064
+ /**
1065
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef' to JSON representation.
1066
+ */
1067
+ export declare function toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef(obj: FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef | undefined): Record<string, any> | undefined;
1068
+ /**
1069
+ * Visibility of the variable
1070
+ *
1071
+ * @schema FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility
1072
+ */
1073
+ export declare enum FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility {
1074
+ /** all */
1075
+ ALL = "all",
1076
+ /** private */
1077
+ PRIVATE = "private",
1078
+ /** selected */
1079
+ SELECTED = "selected"
1080
+ }
1081
+ /**
1082
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextBackend
1083
+ */
1084
+ export interface FirestartrGithubOrganizationVariableSectionSpecContextBackend {
1085
+ /**
1086
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextBackend#ref
1087
+ */
1088
+ readonly ref: FirestartrGithubOrganizationVariableSectionSpecContextBackendRef;
1089
+ }
1090
+ /**
1091
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextBackend' to JSON representation.
1092
+ */
1093
+ export declare function toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackend(obj: FirestartrGithubOrganizationVariableSectionSpecContextBackend | undefined): Record<string, any> | undefined;
1094
+ /**
1095
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextProvider
1096
+ */
1097
+ export interface FirestartrGithubOrganizationVariableSectionSpecContextProvider {
1098
+ /**
1099
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextProvider#ref
1100
+ */
1101
+ readonly ref: FirestartrGithubOrganizationVariableSectionSpecContextProviderRef;
1102
+ }
1103
+ /**
1104
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextProvider' to JSON representation.
1105
+ */
1106
+ export declare function toJson_FirestartrGithubOrganizationVariableSectionSpecContextProvider(obj: FirestartrGithubOrganizationVariableSectionSpecContextProvider | undefined): Record<string, any> | undefined;
1107
+ /**
1108
+ * @schema FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs
1109
+ */
1110
+ export interface FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs {
1111
+ /**
1112
+ * @schema FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs#key
1113
+ */
1114
+ readonly key: string;
1115
+ }
1116
+ /**
1117
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs' to JSON representation.
1118
+ */
1119
+ export declare function toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs(obj: FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs | undefined): Record<string, any> | undefined;
1120
+ /**
1121
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextBackendRef
1122
+ */
1123
+ export interface FirestartrGithubOrganizationVariableSectionSpecContextBackendRef {
1124
+ /**
1125
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextBackendRef#kind
1126
+ */
1127
+ readonly kind: FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind;
1128
+ /**
1129
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextBackendRef#name
1130
+ */
1131
+ readonly name: string;
1132
+ }
1133
+ /**
1134
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextBackendRef' to JSON representation.
1135
+ */
1136
+ export declare function toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackendRef(obj: FirestartrGithubOrganizationVariableSectionSpecContextBackendRef | undefined): Record<string, any> | undefined;
1137
+ /**
1138
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextProviderRef
1139
+ */
1140
+ export interface FirestartrGithubOrganizationVariableSectionSpecContextProviderRef {
1141
+ /**
1142
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextProviderRef#kind
1143
+ */
1144
+ readonly kind: FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind;
1145
+ /**
1146
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextProviderRef#name
1147
+ */
1148
+ readonly name: string;
1149
+ }
1150
+ /**
1151
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextProviderRef' to JSON representation.
1152
+ */
1153
+ export declare function toJson_FirestartrGithubOrganizationVariableSectionSpecContextProviderRef(obj: FirestartrGithubOrganizationVariableSectionSpecContextProviderRef | undefined): Record<string, any> | undefined;
1154
+ /**
1155
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind
1156
+ */
1157
+ export declare enum FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind {
1158
+ /** FirestartrProviderConfig */
1159
+ FIRESTARTR_PROVIDER_CONFIG = "FirestartrProviderConfig"
1160
+ }
1161
+ /**
1162
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind
1163
+ */
1164
+ export declare enum FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind {
1165
+ /** FirestartrProviderConfig */
1166
+ FIRESTARTR_PROVIDER_CONFIG = "FirestartrProviderConfig"
1167
+ }
906
1168
  /**
907
1169
  * A resource to handle GitHub Organization Webhooks
908
1170
  *
@@ -3,3 +3,4 @@ export { GithubMembershipChart } from './membershipChart';
3
3
  export { GithubRepositoryChart } from './repositoryChart';
4
4
  export { GithubOrgWebhookChart } from './orgWebhookChart';
5
5
  export { GithubOrgSettingsChart } from './orgSettingsChart';
6
+ export { GithubOrgVariableSectionChart } from './orgVariableSectionChart';
@@ -0,0 +1,8 @@
1
+ import { FirestartrGithubOrganizationVariableSection, FirestartrGithubOrganizationVariableSectionProps } from '../../../imports/firestartr.dev';
2
+ import { IUnitializedStateKey } from '../../claims/base';
3
+ import { BaseGithubChart } from './base';
4
+ export declare class GithubOrgVariableSectionChart extends BaseGithubChart {
5
+ template(): FirestartrGithubOrganizationVariableSectionProps | IUnitializedStateKey;
6
+ gvk(): import("cdk8s").GroupVersionKind;
7
+ instanceApiObject(template: any): FirestartrGithubOrganizationVariableSection;
8
+ }
@@ -1,4 +1,4 @@
1
- import { GithubGroupChart, GithubMembershipChart, GithubRepositoryChart, GithubOrgWebhookChart, GithubOrgSettingsChart } from './github';
1
+ import { GithubGroupChart, GithubMembershipChart, GithubRepositoryChart, GithubOrgWebhookChart, GithubOrgSettingsChart, GithubOrgVariableSectionChart } from './github';
2
2
  import { CatalogComponentChart, CatalogDomainChart, CatalogGroupChart, CatalogSystemChart, CatalogUserChart, CatalogTFWorkspaceChart, CatalogArgoDeployChart, CatalogSecretsChart, CatalogOrgWebhookChart, CatalogApiChart } from './catalog';
3
3
  import { TFWorkspaceChart } from './workspaces/tfworkspaceChart';
4
4
  import { ArgoDeployChart } from './argocd/argodeployChart';
@@ -22,5 +22,6 @@ declare const _default: {
22
22
  SecretsChart: typeof SecretsChart;
23
23
  GithubOrgWebhookChart: typeof GithubOrgWebhookChart;
24
24
  GithubOrgSettingsChart: typeof GithubOrgSettingsChart;
25
+ GithubOrgVariableSectionChart: typeof GithubOrgVariableSectionChart;
25
26
  };
26
27
  export default _default;
@@ -974,6 +974,52 @@ declare const schemas: {
974
974
  secret_scanning_push_protection_enabled_for_new_repositories: {
975
975
  type: string;
976
976
  };
977
+ actions_variables: {
978
+ type: string;
979
+ items: {
980
+ type: string;
981
+ properties: {
982
+ name: {
983
+ type: string;
984
+ pattern: string;
985
+ };
986
+ value: {
987
+ type: string;
988
+ };
989
+ visibility: {
990
+ type: string;
991
+ enum: string[];
992
+ };
993
+ selected_repositories: {
994
+ type: string;
995
+ items: {
996
+ $ref: string;
997
+ };
998
+ };
999
+ };
1000
+ required: string[];
1001
+ additionalProperties: boolean;
1002
+ allOf: {
1003
+ if: {
1004
+ properties: {
1005
+ visibility: {
1006
+ const: string;
1007
+ };
1008
+ };
1009
+ required: string[];
1010
+ };
1011
+ then: {};
1012
+ else: {
1013
+ properties: {
1014
+ selected_repositories: {
1015
+ type: string;
1016
+ maxItems: number;
1017
+ };
1018
+ };
1019
+ };
1020
+ }[];
1021
+ };
1022
+ };
977
1023
  };
978
1024
  additionalProperties: boolean;
979
1025
  required: string[];
@@ -505,6 +505,52 @@ export declare const GithubSchemas: ({
505
505
  secret_scanning_push_protection_enabled_for_new_repositories: {
506
506
  type: string;
507
507
  };
508
+ actions_variables: {
509
+ type: string;
510
+ items: {
511
+ type: string;
512
+ properties: {
513
+ name: {
514
+ type: string;
515
+ pattern: string;
516
+ };
517
+ value: {
518
+ type: string;
519
+ };
520
+ visibility: {
521
+ type: string;
522
+ enum: string[];
523
+ };
524
+ selected_repositories: {
525
+ type: string;
526
+ items: {
527
+ $ref: string;
528
+ };
529
+ };
530
+ };
531
+ required: string[];
532
+ additionalProperties: boolean;
533
+ allOf: {
534
+ if: {
535
+ properties: {
536
+ visibility: {
537
+ const: string;
538
+ };
539
+ };
540
+ required: string[];
541
+ };
542
+ then: {};
543
+ else: {
544
+ properties: {
545
+ selected_repositories: {
546
+ type: string;
547
+ maxItems: number;
548
+ };
549
+ };
550
+ };
551
+ }[];
552
+ };
553
+ };
508
554
  };
509
555
  additionalProperties: boolean;
510
556
  required: string[];
@@ -29,6 +29,12 @@ export interface IGithubOrgSettingsClaim extends IOrgSettingsClaim {
29
29
  dependency_graph_enabled_for_new_repositories?: boolean;
30
30
  secret_scanning_enabled_for_new_repositories?: boolean;
31
31
  secret_scanning_push_protection_enabled_for_new_repositories?: boolean;
32
+ actions_variables?: {
33
+ name: string;
34
+ value: string;
35
+ visibility: 'all' | 'private' | 'selected';
36
+ selected_repositories?: string[];
37
+ }[];
32
38
  };
33
39
  };
34
40
  }
@@ -100,6 +100,52 @@ declare const _default: {
100
100
  secret_scanning_push_protection_enabled_for_new_repositories: {
101
101
  type: string;
102
102
  };
103
+ actions_variables: {
104
+ type: string;
105
+ items: {
106
+ type: string;
107
+ properties: {
108
+ name: {
109
+ type: string;
110
+ pattern: string;
111
+ };
112
+ value: {
113
+ type: string;
114
+ };
115
+ visibility: {
116
+ type: string;
117
+ enum: string[];
118
+ };
119
+ selected_repositories: {
120
+ type: string;
121
+ items: {
122
+ $ref: string;
123
+ };
124
+ };
125
+ };
126
+ required: string[];
127
+ additionalProperties: boolean;
128
+ allOf: {
129
+ if: {
130
+ properties: {
131
+ visibility: {
132
+ const: string;
133
+ };
134
+ };
135
+ required: string[];
136
+ };
137
+ then: {};
138
+ else: {
139
+ properties: {
140
+ selected_repositories: {
141
+ type: string;
142
+ maxItems: number;
143
+ };
144
+ };
145
+ };
146
+ }[];
147
+ };
148
+ };
103
149
  };
104
150
  additionalProperties: boolean;
105
151
  required: string[];
@@ -8,5 +8,5 @@ export declare function renderClaims(catalogScope: Construct, firestartrScope: C
8
8
  crs: any;
9
9
  renames?: IRenameResult[];
10
10
  }): Promise<RenderedCrMap>;
11
- export declare function renderClaim(catalogScope: Construct, firestartrScope: Construct, claim: any, patches: ICustomResourcePatch[], previousCR?: any | null, claimPath?: string): Promise<IRenderClaimResult>;
11
+ export declare function renderClaim(catalogScope: Construct, firestartrScope: Construct, claim: any, patches: ICustomResourcePatch[], previousCR?: any | null, claimPath?: string, variableSectionPatches?: ICustomResourcePatch[]): Promise<IRenderClaimResult>;
12
12
  export declare function renameVariantCrFiles(outputDir: string, renderedMap: RenderedCrMap): void;
@@ -1 +1 @@
1
- export declare function getPreviousCRfromClaim(claim: any, previousCRs: any): any;
1
+ export declare function getPreviousCRfromClaim(claim: any, previousCRs: any, expectedKind?: string): any;
@@ -0,0 +1,4 @@
1
+ import { RenderClaims, RenderedCrMap } from '../renderer/types';
2
+ export declare function validateGithubOrgVariableSectionSingleton(crs: RenderedCrMap): void;
3
+ export declare function validateActionsVariablesUniqueness(crs: RenderedCrMap): void;
4
+ export declare function validateActionsVariablesSelectedRepositories(renderClaims: RenderClaims): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "2.9.0-snapshot-org-variables-section-5",
3
+ "version": "2.9.0-snapshot-org-variables-section-6",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",