@firestartr/cli 2.9.0-snapshot-01 → 2.9.0-snapshot-org-variables-section-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 CHANGED
@@ -282079,8 +282079,34 @@ async function getRepoIssuesLabels(owner, repo) {
282079
282079
  description: label.description || '',
282080
282080
  color: label.color,
282081
282081
  }));
282082
+ logger.info(`Got ${metadataLabels.length} labels for ${owner}/${repo}`);
282082
282083
  return metadataLabels;
282083
282084
  }
282085
+ async function createRepoLabel(owner, repo, name, color, description) {
282086
+ logger.info(`Creating label '${name}' in ${owner}/${repo}`);
282087
+ const octokit = await getOctokitForOrg(owner);
282088
+ const res = await octokit.issues.createLabel({
282089
+ owner,
282090
+ repo,
282091
+ name,
282092
+ color,
282093
+ description,
282094
+ });
282095
+ return res.data;
282096
+ }
282097
+ async function updateRepoLabel(owner, repo, name, color, description) {
282098
+ logger.info(`Updating label '${name}' in ${owner}/${repo} color=${color} description=${description}`);
282099
+ const octokit = await getOctokitForOrg(owner);
282100
+ const res = await octokit.issues.updateLabel({
282101
+ owner,
282102
+ repo,
282103
+ name,
282104
+ color,
282105
+ description,
282106
+ });
282107
+ logger.info(`Updated label '${name}' in ${owner}/${repo} — GitHub response: color=${res.data.color} description=${res.data.description}`);
282108
+ return res.data;
282109
+ }
282084
282110
  async function isEmptyRepo(owner, name) {
282085
282111
  logger.info(`Checking if repo is empty: ${owner}/${name}`);
282086
282112
  const octokit = await getOctokitForOrg(owner);
@@ -282109,6 +282135,8 @@ async function isEmptyRepo(owner, name) {
282109
282135
  addStatusCheck,
282110
282136
  addCommitStatus,
282111
282137
  getRepoIssuesLabels,
282138
+ createRepoLabel,
282139
+ updateRepoLabel,
282112
282140
  isEmptyRepo,
282113
282141
  });
282114
282142
 
@@ -316730,9 +316758,12 @@ class UUIDInitializer extends InitializerPatches {
316730
316758
  },
316731
316759
  apply(cr) {
316732
316760
  const ctx = helperCTX(this);
316733
- const uuid = previousCR?.spec?.firestartr?.tfStateKey ||
316734
- claim.providers?.[ctx.provider]?.tfStateKey ||
316735
- (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)();
316736
316767
  if (!cr.spec)
316737
316768
  cr.spec = {};
316738
316769
  if (!cr.spec.firestartr)
@@ -320395,6 +320426,49 @@ const organizationSettingsProperties = {
320395
320426
  secret_scanning_push_protection_enabled_for_new_repositories: {
320396
320427
  type: 'boolean',
320397
320428
  },
320429
+ actions_variables: {
320430
+ type: 'array',
320431
+ items: {
320432
+ type: 'object',
320433
+ properties: {
320434
+ name: {
320435
+ type: 'string',
320436
+ pattern: '^[A-Za-z0-9_]+$',
320437
+ },
320438
+ value: {
320439
+ type: 'string',
320440
+ },
320441
+ visibility: {
320442
+ type: 'string',
320443
+ enum: ['all', 'private', 'selected'],
320444
+ },
320445
+ selected_repositories: {
320446
+ type: 'array',
320447
+ items: {
320448
+ $ref: 'firestartr.dev://common/FirestartrComponentRef',
320449
+ },
320450
+ },
320451
+ },
320452
+ required: ['name', 'value', 'visibility'],
320453
+ additionalProperties: false,
320454
+ allOf: [
320455
+ {
320456
+ if: {
320457
+ properties: {
320458
+ visibility: { const: 'selected' },
320459
+ },
320460
+ required: ['visibility'],
320461
+ },
320462
+ then: {},
320463
+ else: {
320464
+ properties: {
320465
+ selected_repositories: { type: 'array', maxItems: 0 },
320466
+ },
320467
+ },
320468
+ },
320469
+ ],
320470
+ },
320471
+ },
320398
320472
  };
320399
320473
  /* harmony default export */ const github_orgsettings_schema = ({
320400
320474
  $schema: SCHEMA,
@@ -323746,7 +323820,7 @@ const VARIANT_OF_ANNOTATION = 'firestartr.dev/variant-of';
323746
323820
  function isVariantCR(cr) {
323747
323821
  return cr.metadata?.annotations?.[VARIANT_OF_ANNOTATION] !== undefined;
323748
323822
  }
323749
- function getPreviousCRfromClaim(claim, previousCRs) {
323823
+ function getPreviousCRfromClaim(claim, previousCRs, expectedKind) {
323750
323824
  const previousCRsKeys = Object.keys(previousCRs);
323751
323825
  const isVariantClaim = !!claim._parentClaimName;
323752
323826
  for (const previousCRKey of previousCRsKeys) {
@@ -323755,6 +323829,8 @@ function getPreviousCRfromClaim(claim, previousCRs) {
323755
323829
  continue;
323756
323830
  if (isExcludedFromPreviousCR(previousCR.kind))
323757
323831
  continue;
323832
+ if (expectedKind && previousCR.kind !== expectedKind)
323833
+ continue;
323758
323834
  const crVariant = isVariantCR(previousCR);
323759
323835
  if (isVariantClaim && !crVariant)
323760
323836
  continue;
@@ -324769,6 +324845,254 @@ var FirestartrGithubOrganizationSettingsSpecContextProviderRefKind;
324769
324845
  /** FirestartrProviderConfig */
324770
324846
  FirestartrGithubOrganizationSettingsSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
324771
324847
  })(FirestartrGithubOrganizationSettingsSpecContextProviderRefKind || (FirestartrGithubOrganizationSettingsSpecContextProviderRefKind = {}));
324848
+ /**
324849
+ * A resource to handle GitHub Organization Actions Variables.
324850
+ *
324851
+ * @schema FirestartrGithubOrganizationVariableSection
324852
+ */
324853
+ class FirestartrGithubOrganizationVariableSection extends lib.ApiObject {
324854
+ /**
324855
+ * Renders a Kubernetes manifest for "FirestartrGithubOrganizationVariableSection".
324856
+ *
324857
+ * This can be used to inline resource manifests inside other objects (e.g. as templates).
324858
+ *
324859
+ * @param props initialization props
324860
+ */
324861
+ static manifest(props) {
324862
+ return {
324863
+ ...FirestartrGithubOrganizationVariableSection.GVK,
324864
+ ...toJson_FirestartrGithubOrganizationVariableSectionProps(props),
324865
+ };
324866
+ }
324867
+ /**
324868
+ * Defines a "FirestartrGithubOrganizationVariableSection" API object
324869
+ * @param scope the scope in which to define this object
324870
+ * @param id a scope-local name for the object
324871
+ * @param props initialization props
324872
+ */
324873
+ constructor(scope, id, props) {
324874
+ super(scope, id, {
324875
+ ...FirestartrGithubOrganizationVariableSection.GVK,
324876
+ ...props,
324877
+ });
324878
+ }
324879
+ /**
324880
+ * Renders the object to Kubernetes JSON.
324881
+ */
324882
+ toJson() {
324883
+ const resolved = super.toJson();
324884
+ return {
324885
+ ...FirestartrGithubOrganizationVariableSection.GVK,
324886
+ ...toJson_FirestartrGithubOrganizationVariableSectionProps(resolved),
324887
+ };
324888
+ }
324889
+ }
324890
+ /**
324891
+ * Returns the apiVersion and kind for "FirestartrGithubOrganizationVariableSection"
324892
+ */
324893
+ FirestartrGithubOrganizationVariableSection.GVK = {
324894
+ apiVersion: 'firestartr.dev/v1',
324895
+ kind: 'FirestartrGithubOrganizationVariableSection',
324896
+ };
324897
+
324898
+ /**
324899
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionProps' to JSON representation.
324900
+ */
324901
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324902
+ function toJson_FirestartrGithubOrganizationVariableSectionProps(obj) {
324903
+ if (obj === undefined) {
324904
+ return undefined;
324905
+ }
324906
+ const result = {
324907
+ 'metadata': obj.metadata,
324908
+ 'spec': toJson_FirestartrGithubOrganizationVariableSectionSpec(obj.spec),
324909
+ };
324910
+ // filter undefined values
324911
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
324912
+ }
324913
+ /**
324914
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpec' to JSON representation.
324915
+ */
324916
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324917
+ function toJson_FirestartrGithubOrganizationVariableSectionSpec(obj) {
324918
+ if (obj === undefined) {
324919
+ return undefined;
324920
+ }
324921
+ const result = {
324922
+ 'org': obj.org,
324923
+ 'actionsVariables': obj.actionsVariables?.map(y => toJson_FirestartrGithubOrganizationVariableSectionSpecActionsVariables(y)),
324924
+ 'context': toJson_FirestartrGithubOrganizationVariableSectionSpecContext(obj.context),
324925
+ 'firestartr': toJson_FirestartrGithubOrganizationVariableSectionSpecFirestartr(obj.firestartr),
324926
+ 'writeConnectionSecretToRef': toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef(obj.writeConnectionSecretToRef),
324927
+ };
324928
+ // filter undefined values
324929
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
324930
+ }
324931
+ /**
324932
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecActionsVariables' to JSON representation.
324933
+ */
324934
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324935
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecActionsVariables(obj) {
324936
+ if (obj === undefined) {
324937
+ return undefined;
324938
+ }
324939
+ const result = {
324940
+ 'name': obj.name,
324941
+ 'value': obj.value,
324942
+ 'visibility': obj.visibility,
324943
+ 'selectedRepositories': obj.selectedRepositories?.map(y => y),
324944
+ };
324945
+ // filter undefined values
324946
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
324947
+ }
324948
+ /**
324949
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContext' to JSON representation.
324950
+ */
324951
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324952
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContext(obj) {
324953
+ if (obj === undefined) {
324954
+ return undefined;
324955
+ }
324956
+ const result = {
324957
+ 'backend': toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackend(obj.backend),
324958
+ 'provider': toJson_FirestartrGithubOrganizationVariableSectionSpecContextProvider(obj.provider),
324959
+ };
324960
+ // filter undefined values
324961
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
324962
+ }
324963
+ /**
324964
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecFirestartr' to JSON representation.
324965
+ */
324966
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324967
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecFirestartr(obj) {
324968
+ if (obj === undefined) {
324969
+ return undefined;
324970
+ }
324971
+ const result = {
324972
+ 'tfStateKey': obj.tfStateKey,
324973
+ };
324974
+ // filter undefined values
324975
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
324976
+ }
324977
+ /**
324978
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef' to JSON representation.
324979
+ */
324980
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324981
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef(obj) {
324982
+ if (obj === undefined) {
324983
+ return undefined;
324984
+ }
324985
+ const result = {
324986
+ 'name': obj.name,
324987
+ 'outputs': obj.outputs?.map(y => toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs(y)),
324988
+ };
324989
+ // filter undefined values
324990
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
324991
+ }
324992
+ /* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324993
+ /**
324994
+ * Visibility of the variable
324995
+ *
324996
+ * @schema FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility
324997
+ */
324998
+ var FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility;
324999
+ (function (FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility) {
325000
+ /** all */
325001
+ FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["ALL"] = "all";
325002
+ /** private */
325003
+ FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["PRIVATE"] = "private";
325004
+ /** selected */
325005
+ FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["SELECTED"] = "selected";
325006
+ })(FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility || (FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility = {}));
325007
+ /**
325008
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextBackend' to JSON representation.
325009
+ */
325010
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325011
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackend(obj) {
325012
+ if (obj === undefined) {
325013
+ return undefined;
325014
+ }
325015
+ const result = {
325016
+ 'ref': toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackendRef(obj.ref),
325017
+ };
325018
+ // filter undefined values
325019
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325020
+ }
325021
+ /**
325022
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextProvider' to JSON representation.
325023
+ */
325024
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325025
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContextProvider(obj) {
325026
+ if (obj === undefined) {
325027
+ return undefined;
325028
+ }
325029
+ const result = {
325030
+ 'ref': toJson_FirestartrGithubOrganizationVariableSectionSpecContextProviderRef(obj.ref),
325031
+ };
325032
+ // filter undefined values
325033
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325034
+ }
325035
+ /**
325036
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs' to JSON representation.
325037
+ */
325038
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325039
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs(obj) {
325040
+ if (obj === undefined) {
325041
+ return undefined;
325042
+ }
325043
+ const result = {
325044
+ 'key': obj.key,
325045
+ };
325046
+ // filter undefined values
325047
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325048
+ }
325049
+ /**
325050
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextBackendRef' to JSON representation.
325051
+ */
325052
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325053
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackendRef(obj) {
325054
+ if (obj === undefined) {
325055
+ return undefined;
325056
+ }
325057
+ const result = {
325058
+ 'kind': obj.kind,
325059
+ 'name': obj.name,
325060
+ };
325061
+ // filter undefined values
325062
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325063
+ }
325064
+ /**
325065
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextProviderRef' to JSON representation.
325066
+ */
325067
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325068
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContextProviderRef(obj) {
325069
+ if (obj === undefined) {
325070
+ return undefined;
325071
+ }
325072
+ const result = {
325073
+ 'kind': obj.kind,
325074
+ 'name': obj.name,
325075
+ };
325076
+ // filter undefined values
325077
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325078
+ }
325079
+ /* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325080
+ /**
325081
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind
325082
+ */
325083
+ var FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind;
325084
+ (function (FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind) {
325085
+ /** FirestartrProviderConfig */
325086
+ FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
325087
+ })(FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind || (FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind = {}));
325088
+ /**
325089
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind
325090
+ */
325091
+ var FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind;
325092
+ (function (FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind) {
325093
+ /** FirestartrProviderConfig */
325094
+ FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
325095
+ })(FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind || (FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind = {}));
324772
325096
  /**
324773
325097
  * A resource to handle GitHub Organization Webhooks
324774
325098
  *
@@ -327618,6 +327942,65 @@ class GithubOrgSettingsChart extends BaseGithubChart {
327618
327942
  }
327619
327943
  }
327620
327944
 
327945
+ ;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/github/orgVariableSectionChart.ts
327946
+
327947
+
327948
+
327949
+ class GithubOrgVariableSectionChart extends BaseGithubChart {
327950
+ template() {
327951
+ const claim = this.get('claim');
327952
+ const firestartrId = this.get('firestartrId');
327953
+ const githubProvider = claim.providers.github;
327954
+ const actionsVariables = (githubProvider.actions_variables || []).map((v) => {
327955
+ const entry = {
327956
+ name: v.name,
327957
+ value: v.value,
327958
+ visibility: v.visibility,
327959
+ };
327960
+ if (v.selected_repositories && v.selected_repositories.length > 0) {
327961
+ entry.selectedRepositories = v.selected_repositories.map((ref) => {
327962
+ const match = ref.match(/^component:(.+)$/);
327963
+ if (!match) {
327964
+ throw new ChartRenderError('OrgSettingsClaim', claim.name, `Invalid component ref "${ref}" in selected_repositories. Expected format: component:<name>`);
327965
+ }
327966
+ const componentName = match[1];
327967
+ const resolvedCr = this.refResolver('ComponentClaim', componentName);
327968
+ const org = resolvedCr?.spec?.org;
327969
+ const repoName = resolvedCr?.metadata?.annotations?.['firestartr.dev/external-name'] || resolvedCr?.metadata?.name?.replace(/-[0-9a-f-]{36}$/, '');
327970
+ if (!org || !repoName) {
327971
+ throw new ChartRenderError('OrgSettingsClaim', claim.name, `Referenced component "${componentName}" has no GitHub provider configured`);
327972
+ }
327973
+ return `${org}/${repoName}`;
327974
+ });
327975
+ }
327976
+ return entry;
327977
+ });
327978
+ const template = {
327979
+ metadata: {
327980
+ name: githubProvider.name,
327981
+ },
327982
+ spec: {
327983
+ org: githubProvider.org,
327984
+ actionsVariables,
327985
+ firestartr: {
327986
+ tfStateKey: firestartrId,
327987
+ },
327988
+ writeConnectionSecretToRef: {
327989
+ name: `firestartrgithuborganizationvariablesection-${githubProvider.name}-outputs`.toLowerCase(),
327990
+ outputs: [{ key: 'managed_variables' }, { key: 'variable_ids' }],
327991
+ },
327992
+ },
327993
+ };
327994
+ return JSON.parse(JSON.stringify(template));
327995
+ }
327996
+ gvk() {
327997
+ return FirestartrGithubOrganizationVariableSection.GVK;
327998
+ }
327999
+ instanceApiObject(template) {
328000
+ return new FirestartrGithubOrganizationVariableSection(this, template.metadata.name, template);
328001
+ }
328002
+ }
328003
+
327621
328004
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/github/index.ts
327622
328005
 
327623
328006
 
@@ -327625,6 +328008,7 @@ class GithubOrgSettingsChart extends BaseGithubChart {
327625
328008
 
327626
328009
 
327627
328010
 
328011
+
327628
328012
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/catalog/base.ts
327629
328013
 
327630
328014
  class BaseCatalogChart extends BaseChart {
@@ -328372,6 +328756,7 @@ class SecretsChart extends BaseSecretsChart {
328372
328756
  SecretsChart: SecretsChart,
328373
328757
  GithubOrgWebhookChart: GithubOrgWebhookChart,
328374
328758
  GithubOrgSettingsChart: GithubOrgSettingsChart,
328759
+ GithubOrgVariableSectionChart: GithubOrgVariableSectionChart,
328375
328760
  });
328376
328761
 
328377
328762
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/renderer/claims-render.ts
@@ -328416,7 +328801,10 @@ async function renderClaims(catalogScope, firestartrScope, data) {
328416
328801
  if (configuredProvider !== AllowedProviders.all.toString()) {
328417
328802
  providers = providers.filter((provider) => provider === configuredProvider);
328418
328803
  }
328419
- const previousCR = getPreviousCRfromClaim(claim, crs);
328804
+ const expectedKind = claim.kind === 'OrgSettingsClaim'
328805
+ ? 'FirestartrGithubOrganizationSettings'
328806
+ : undefined;
328807
+ const previousCR = getPreviousCRfromClaim(claim, crs, expectedKind);
328420
328808
  const patches = await extractPatches(renderClaims[claimKey], previousCR);
328421
328809
  if (!previousCR) {
328422
328810
  logger.debug(`No CR found for claim ${claimKey}, it will be rendered from scratch`);
@@ -328599,6 +328987,19 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
328599
328987
  case 'OrgSettingsClaim':
328600
328988
  if (loadGithub) {
328601
328989
  firestartrEntity = new charts.GithubOrgSettingsChart(firestartrScope, `github-${chartId}`, firestartrId, claim, renderPatches);
328990
+ const variableSectionFirestartrId = firestartrId
328991
+ ? `${firestartrId}-variables`
328992
+ : null;
328993
+ const variableSectionChart = new charts.GithubOrgVariableSectionChart(firestartrScope, `github-variables-${chartId}`, variableSectionFirestartrId, claim, renderPatches);
328994
+ await variableSectionChart.render();
328995
+ const variableSectionObject = await variableSectionChart.postRenderer(postPatches);
328996
+ extraCharts.push({
328997
+ claim: {
328998
+ kind: claim.kind,
328999
+ name: `${claim.name}-variable-section`,
329000
+ },
329001
+ chart: variableSectionObject,
329002
+ });
328602
329003
  }
328603
329004
  break;
328604
329005
  default:
@@ -328763,6 +329164,58 @@ function validateGithubOrgSettingsSingleton(crs) {
328763
329164
  }
328764
329165
  }
328765
329166
 
329167
+ ;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/githubOrgVariableSection.ts
329168
+ const GITHUB_ORG_VARIABLE_SECTION_KIND = 'FirestartrGithubOrganizationVariableSection';
329169
+ const githubOrgVariableSection_FIRESTARTR_CLAIM_REF_ANNOTATION = 'firestartr.dev/claim-ref';
329170
+ const githubOrgVariableSection_CLAIM_REF_LABEL = 'claim-ref';
329171
+ function githubOrgVariableSection_formatResourceRef(name, claimRef) {
329172
+ return claimRef ? `${name} (claim: ${claimRef})` : name;
329173
+ }
329174
+ function validateGithubOrgVariableSectionSingleton(crs) {
329175
+ const refsByOrg = new Map();
329176
+ for (const crKey of Object.keys(crs)) {
329177
+ const cr = crs[crKey];
329178
+ if (cr.kind !== GITHUB_ORG_VARIABLE_SECTION_KIND)
329179
+ continue;
329180
+ const org = cr.spec?.org;
329181
+ if (typeof org !== 'string' || !org)
329182
+ continue;
329183
+ const name = cr.metadata?.name || crKey;
329184
+ const claimRef = cr.metadata?.annotations?.[githubOrgVariableSection_FIRESTARTR_CLAIM_REF_ANNOTATION] ||
329185
+ cr.metadata?.labels?.[githubOrgVariableSection_CLAIM_REF_LABEL];
329186
+ const normalizedOrg = org.toLowerCase();
329187
+ const refs = refsByOrg.get(normalizedOrg) || [];
329188
+ refs.push(githubOrgVariableSection_formatResourceRef(name, claimRef));
329189
+ refsByOrg.set(normalizedOrg, refs);
329190
+ }
329191
+ for (const [org, refs] of refsByOrg.entries()) {
329192
+ if (refs.length < 2)
329193
+ continue;
329194
+ throw new Error(`Duplicate ${GITHUB_ORG_VARIABLE_SECTION_KIND} resources found for GitHub organization "${org}": ${refs.join(', ')}`);
329195
+ }
329196
+ }
329197
+ function validateActionsVariablesUniqueness(crs) {
329198
+ for (const crKey of Object.keys(crs)) {
329199
+ const cr = crs[crKey];
329200
+ if (cr.kind !== GITHUB_ORG_VARIABLE_SECTION_KIND)
329201
+ continue;
329202
+ const actionsVariables = cr.spec?.actionsVariables;
329203
+ if (!Array.isArray(actionsVariables))
329204
+ continue;
329205
+ const names = new Set();
329206
+ for (const variable of actionsVariables) {
329207
+ const varName = variable?.name;
329208
+ if (!varName)
329209
+ continue;
329210
+ if (names.has(varName)) {
329211
+ const org = cr.spec?.org || 'unknown';
329212
+ throw new Error(`Duplicate action variable name "${varName}" found in ${GITHUB_ORG_VARIABLE_SECTION_KIND} for organization "${org}"`);
329213
+ }
329214
+ names.add(varName);
329215
+ }
329216
+ }
329217
+ }
329218
+
328766
329219
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/renderer/renderer.ts
328767
329220
 
328768
329221
 
@@ -328773,6 +329226,7 @@ function validateGithubOrgSettingsSingleton(crs) {
328773
329226
 
328774
329227
 
328775
329228
 
329229
+
328776
329230
  /*
328777
329231
  * Function called when rendering but not importing
328778
329232
  *
@@ -328796,6 +329250,8 @@ async function renderer_render(catalogScope, firestartrScope, claimList) {
328796
329250
  validateComponentPagesPath(data.renderClaims);
328797
329251
  validateTfStateKeyUniqueness(result);
328798
329252
  validateGithubOrgSettingsSingleton(fullCrSet);
329253
+ validateGithubOrgVariableSectionSingleton(result);
329254
+ validateActionsVariablesUniqueness(result);
328799
329255
  validateCrSizes(result);
328800
329256
  validatePermissionsUniqueness(result);
328801
329257
  }
@@ -339622,8 +340078,8 @@ const MODULES = {
339622
340078
  },
339623
340079
  FirestartrGithubRepository: {
339624
340080
  module: 'git::https://github.com/prefapp/tfm.git//modules/github-repo',
339625
- // github-repo-v0.8.0
339626
- ref: 'c51e2fe8c4f99aa34577b6a5f721a382ff217771',
340081
+ // github-repo-v0.9.0
340082
+ ref: '76074c2817032b199962c380481617d99f78d9d7',
339627
340083
  },
339628
340084
  FirestartrGithubRepositoryFeature: {
339629
340085
  module: 'git::https://github.com/prefapp/tfm.git//modules/github-files-set',
@@ -340289,11 +340745,6 @@ function provisionPermissions(fsGithubRepository) {
340289
340745
  }
340290
340746
 
340291
340747
  ;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghrepo/helpers/labels.ts
340292
- // if we are to provision labels using tofu and the label already
340293
- // exists, we should not attempt to re-create it. This function checks
340294
- // if the label exists and if so, imports it into Terraform state. This is needed because
340295
- // tofu does not have an "upsert" operation for labels, so we need to check
340296
- // if the label exists before trying to create it, otherwise we will get an error.
340297
340748
 
340298
340749
 
340299
340750
 
@@ -340305,7 +340756,7 @@ async function provisionLabels(fsGithubRepository, repoAlreadyExists) {
340305
340756
  return;
340306
340757
  }
340307
340758
  if (repoAlreadyExists) {
340308
- await importLabelsIfNeeded(fsGithubRepository);
340759
+ await importLabelsIfNeeded(fsGithubRepository, labels);
340309
340760
  }
340310
340761
  for (const label of labels) {
340311
340762
  gh_provisioner_src_logger.debug(`[gh-provisioner] ${fsGithubRepository.k8sId} provisioning label ${label.name}`);
@@ -340325,20 +340776,27 @@ async function provisionLabels(fsGithubRepository, repoAlreadyExists) {
340325
340776
  throw new Error(`Error on provisionLabels: ${err}`);
340326
340777
  }
340327
340778
  }
340328
- async function importLabelsIfNeeded(fsGithubRepository) {
340779
+ async function importLabelsIfNeeded(fsGithubRepository, declaredLabels) {
340329
340780
  const cr = fsGithubRepository.cr;
340330
340781
  try {
340331
- const labels = cr.spec.repo.labels;
340332
- gh_provisioner_src_logger.info(`[gh-provisioner] ${fsGithubRepository.k8sId} checking if labels need to be imported`);
340782
+ gh_provisioner_src_logger.info(`[gh-provisioner] ${fsGithubRepository.k8sId} checking if labels need to be imported (${declaredLabels.length} declared)`);
340333
340783
  const repoIssuesList = await fsGithubRepository.runWithGithubProvider(async () => {
340334
340784
  return await github["default"].repo.getRepoIssuesLabels(cr.spec.org, cr.name);
340335
340785
  });
340336
- // labels that already exist in GitHub must be imported into Terraform state
340337
- // so that Terraform manages them rather than trying to create them (which would fail)
340338
- for (const label of labels) {
340339
- if (!checkIfLabelExists(label.name, repoIssuesList)) {
340786
+ for (const label of declaredLabels) {
340787
+ const existing = findExistingLabel(label.name, repoIssuesList);
340788
+ if (!existing) {
340789
+ gh_provisioner_src_logger.info(`[gh-provisioner] ${fsGithubRepository.k8sId} label '${label.name}' not found on GitHub — will be created by TFM`);
340340
340790
  continue;
340341
340791
  }
340792
+ gh_provisioner_src_logger.info(`[gh-provisioner] ${fsGithubRepository.k8sId} label '${label.name}' on GitHub: color="${existing.color}" desc="${existing.description}" | CR declares: color="${label.color}" desc="${label.description}"`);
340793
+ if (existing.color !== label.color ||
340794
+ (label.description && existing.description !== label.description)) {
340795
+ gh_provisioner_src_logger.info(`[gh-provisioner] ${fsGithubRepository.k8sId} updating pre-existing label '${label.name}' via GitHub API to match CR values`);
340796
+ await fsGithubRepository.runWithGithubProvider(async () => {
340797
+ await github["default"].repo.updateRepoLabel(cr.spec.org, cr.name, label.name, label.color, label.description);
340798
+ });
340799
+ }
340342
340800
  fsGithubRepository.patchImportData({
340343
340801
  op: PatchOperations.add,
340344
340802
  path: '/imports/-',
@@ -340354,8 +340812,8 @@ async function importLabelsIfNeeded(fsGithubRepository) {
340354
340812
  throw new Error(`Error on importLabelsIfNeeded: ${err}`);
340355
340813
  }
340356
340814
  }
340357
- function checkIfLabelExists(labelName, repoIssuesList) {
340358
- return repoIssuesList.some((label) => label.name === labelName);
340815
+ function findExistingLabel(labelName, repoIssuesList) {
340816
+ return repoIssuesList.find((label) => label.name === labelName);
340359
340817
  }
340360
340818
 
340361
340819
  ;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghrepo/helpers/branch_protections.ts
@@ -341000,6 +341458,19 @@ async function runOnTerraform(entity, command, customArgs, opts = {}) {
341000
341458
  const importCommands = ['import-with-reimport', 'custom-import', 'import'];
341001
341459
  const isImportLike = importCommands.includes(command);
341002
341460
  // Always force importMode=true for all import-like commands.
341461
+ // Apply-time adoption: when an apply runs and the entity has pending import
341462
+ // entries (e.g. labels that already exist on GitHub), the bridge runs the
341463
+ // regular apply with importMode=true. Import blocks are evaluated and
341464
+ // consumed by the same single apply, importing pre-existing resources into
341465
+ // state and reconciling them in one step.
341466
+ //
341467
+ // See ADR 0006: Apply-time adoption of existing GitHub resources via import blocks.
341468
+ const importDoc = entity.importDocument;
341469
+ if (command === 'apply' && importDoc.imports.length > 0) {
341470
+ const importResult = await runTerraformProvisioner(tp_bridge_buildContext(entity, reuseExistingProject, true), 'apply', streaming, importDoc, opts.ctl);
341471
+ entity.__ghProvisionerSessionWorkspaceInitialized = true;
341472
+ return importResult;
341473
+ }
341003
341474
  const result = await runTerraformProvisioner(tp_bridge_buildContext(entity, reuseExistingProject, isImportLike ? true : false), command, streaming, customArgs, opts.ctl);
341004
341475
  if (!entity.__ghProvisionerSessionWorkspaceInitialized &&
341005
341476
  isWorkspaceInitializingCommand) {
@@ -342956,7 +343427,20 @@ var external_util_ = __nccwpck_require__(73837);
342956
343427
 
342957
343428
  const deploymentName = catalog_common/* default.environment.getFromEnvironment */.Z.environment.getFromEnvironment(catalog_common/* default.types.envVars.operatorDeploymentName */.Z.types.envVars.operatorDeploymentName) || 'firestartr-firestartr-controller';
342958
343429
  const DEFAULT_OPERATOR_DEPLOY = (/* unused pure expression or super */ null && (deploymentName));
342959
- async function tfPlanner(claimFilePath, claim, namespace, debug, jobTtl = 300, cmd = 'plan', callbackApi = function (ctl) { }) {
343430
+ function withToolImageTag(image, toolImageTag) {
343431
+ if (!image || !toolImageTag)
343432
+ return image;
343433
+ const digestIndex = image.indexOf('@');
343434
+ const imageWithoutDigest = digestIndex >= 0 ? image.slice(0, digestIndex) : image;
343435
+ const digestSuffix = digestIndex >= 0 ? image.slice(digestIndex) : '';
343436
+ const lastSlashIndex = imageWithoutDigest.lastIndexOf('/');
343437
+ const lastColonIndex = imageWithoutDigest.lastIndexOf(':');
343438
+ if (lastColonIndex > lastSlashIndex) {
343439
+ return `${imageWithoutDigest.slice(0, lastColonIndex)}:${toolImageTag}${digestSuffix}`;
343440
+ }
343441
+ return `${imageWithoutDigest}:${toolImageTag}${digestSuffix}`;
343442
+ }
343443
+ async function tfPlanner(claimFilePath, claim, namespace, debug, jobTtl = 300, cmd = 'plan', toolImageTag, callbackApi = function (ctl) { }) {
342960
343444
  const { kc } = await getConnection();
342961
343445
  const k8sApi = kc.makeApiClient(client.AppsV1Api);
342962
343446
  const batchV1Api = kc.makeApiClient(client.BatchV1Api);
@@ -342979,6 +343463,7 @@ async function tfPlanner(claimFilePath, claim, namespace, debug, jobTtl = 300, c
342979
343463
  job.spec.ttlSecondsAfterFinished = jobTtl;
342980
343464
  job.spec.template = controllerDeploy.body.spec
342981
343465
  .template;
343466
+ job.spec.template.spec.containers[0].image = withToolImageTag(job.spec.template.spec.containers[0].image, toolImageTag);
342982
343467
  // set activeDeadlineSeconds to force terminate jobs that exceed this time
342983
343468
  // see https://kubernetes.io/docs/concepts/workloads/controllers/job/#job-termination-and-cleanup
342984
343469
  job.spec.activeDeadlineSeconds = 3600;
@@ -522076,7 +522561,7 @@ const crsStatusSubcommand = {
522076
522561
  };
522077
522562
 
522078
522563
  ;// CONCATENATED MODULE: ./package.json
522079
- const package_namespaceObject = JSON.parse('{"i8":"2.9.0-snapshot-01"}');
522564
+ const package_namespaceObject = JSON.parse('{"i8":"2.9.0-snapshot-org-variables-section-1"}');
522080
522565
  ;// CONCATENATED MODULE: ../../package.json
522081
522566
  const package_namespaceObject_1 = {"i8":"2.8.0"};
522082
522567
  ;// CONCATENATED MODULE: ./src/subcommands/index.ts
@@ -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[];
@@ -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,3 @@
1
+ import { RenderedCrMap } from '../renderer/types';
2
+ export declare function validateGithubOrgVariableSectionSingleton(crs: RenderedCrMap): void;
3
+ export declare function validateActionsVariablesUniqueness(crs: RenderedCrMap): void;
@@ -36,6 +36,8 @@ declare const _default: {
36
36
  addStatusCheck: typeof import("./src/repository").addStatusCheck;
37
37
  addCommitStatus: typeof import("./src/repository").addCommitStatus;
38
38
  getRepoIssuesLabels: typeof import("./src/repository").getRepoIssuesLabels;
39
+ createRepoLabel: typeof import("./src/repository").createRepoLabel;
40
+ updateRepoLabel: typeof import("./src/repository").updateRepoLabel;
39
41
  isEmptyRepo: typeof import("./src/repository").isEmptyRepo;
40
42
  };
41
43
  team: {
@@ -1332,6 +1332,24 @@ export declare function getRepoIssuesLabels(owner: string, repo: string): Promis
1332
1332
  description: string;
1333
1333
  color: string;
1334
1334
  }[]>;
1335
+ export declare function createRepoLabel(owner: string, repo: string, name: string, color: string, description?: string): Promise<{
1336
+ id: number;
1337
+ node_id: string;
1338
+ url: string;
1339
+ name: string;
1340
+ description: string;
1341
+ color: string;
1342
+ default: boolean;
1343
+ }>;
1344
+ export declare function updateRepoLabel(owner: string, repo: string, name: string, color: string, description?: string): Promise<{
1345
+ id: number;
1346
+ node_id: string;
1347
+ url: string;
1348
+ name: string;
1349
+ description: string;
1350
+ color: string;
1351
+ default: boolean;
1352
+ }>;
1335
1353
  export declare function isEmptyRepo(owner: string, name: string): Promise<boolean>;
1336
1354
  declare const _default: {
1337
1355
  listReleases: typeof listReleases;
@@ -1351,6 +1369,8 @@ declare const _default: {
1351
1369
  addStatusCheck: typeof addStatusCheck;
1352
1370
  addCommitStatus: typeof addCommitStatus;
1353
1371
  getRepoIssuesLabels: typeof getRepoIssuesLabels;
1372
+ createRepoLabel: typeof createRepoLabel;
1373
+ updateRepoLabel: typeof updateRepoLabel;
1354
1374
  isEmptyRepo: typeof isEmptyRepo;
1355
1375
  };
1356
1376
  export default _default;
@@ -1,2 +1,3 @@
1
- export declare function tfPlanner(claimFilePath: string, claim: any, namespace: string, debug: boolean, jobTtl?: number, cmd?: string, callbackApi?: (ctl: any) => void): Promise<void>;
1
+ export declare function withToolImageTag(image: string | undefined, toolImageTag?: string): string;
2
+ export declare function tfPlanner(claimFilePath: string, claim: any, namespace: string, debug: boolean, jobTtl?: number, cmd?: string, toolImageTag?: string, callbackApi?: (ctl: any) => void): Promise<void>;
2
3
  export declare function kubectlCp(sourcePath: string, namespace: string, podName: string, podFilePath?: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "2.9.0-snapshot-01",
3
+ "version": "2.9.0-snapshot-org-variables-section-1",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",