@firestartr/cli 1.56.1-snapshot-1 → 1.56.1-snapshot-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -367007,13 +367007,21 @@ async function importGithubGitopsRepository(org, skipPlan, claimsPath, resources
367007
367007
  previousCRs[k];
367008
367008
  }
367009
367009
  const crs = await renderCRs(data);
367010
- Object.values(crs).forEach((cr) => {
367011
- const claimName = cr.metadata.labels?.['claim-ref'];
367010
+ for (const key in crs) {
367011
+ let cr = crs[key];
367012
+ const claimName = cr.metadata?.annotations?.[catalog_common.generic.getFirestartrAnnotation('external-name')];
367012
367013
  const postRenderFunctions = data.postRender[`${cr.kind}-${claimName}`] || [];
367014
+ let crModified = false;
367013
367015
  for (const postRenderFunction of postRenderFunctions) {
367014
367016
  cr = postRenderFunction(cr);
367017
+ crModified = true;
367015
367018
  }
367016
- });
367019
+ if (crModified) {
367020
+ const crPath = getCrPath(tmpRenderedCrsPath, cr);
367021
+ catalog_common.io.writeYamlFile(external_path_.basename(crPath), cr, external_path_.dirname(crPath));
367022
+ crs[key] = cr;
367023
+ }
367024
+ }
367017
367025
  await moveCRsAndClaims(crs, org, claimsPath, resourcesPath);
367018
367026
  }
367019
367027
  async function moveCRsAndClaims(crs, org, claimsPath, resourcesPath) {
@@ -370012,7 +370020,6 @@ var lib_provider = __nccwpck_require__(85791);
370012
370020
  ;// CONCATENATED MODULE: ../provisioner/src/entities/base/Entity.ts
370013
370021
 
370014
370022
  const EXTERNAL_NAME_ANNOTATION = 'firestartr.dev/external-name';
370015
- const IMPORT_SLUG_ANNOTATION = 'firestartr.dev/github-slug';
370016
370023
  const IMPORT_ID_ANNOTATION = 'firestartr.dev/github-id';
370017
370024
 
370018
370025
  class Metadata {
@@ -370029,13 +370036,10 @@ class Metadata {
370029
370036
  }
370030
370037
  }
370031
370038
  get slug() {
370032
- // buscar el slug en los outputs
370039
+ // we search the slug in the outputs
370033
370040
  const slug = this._resolveOutputs('slug');
370034
- if (IMPORT_SLUG_ANNOTATION in this.annotations) {
370035
- return this.annotations[IMPORT_SLUG_ANNOTATION];
370036
- }
370037
- else if (slug) {
370038
- // hay outputs?
370041
+ if (slug) {
370042
+ // is the slug in the outputs?
370039
370043
  return slug;
370040
370044
  }
370041
370045
  else {
@@ -370049,13 +370053,16 @@ class Metadata {
370049
370053
  return this._metadata.labels || {};
370050
370054
  }
370051
370055
  get id() {
370052
- // buscar el id en los outputs
370056
+ // we search the id in the outputs
370053
370057
  const id = this._resolveOutputs('id');
370058
+ // if we are in an import process
370059
+ // there should be an id annotation
370060
+ // it takes always precedence
370054
370061
  if (IMPORT_ID_ANNOTATION in this.annotations) {
370055
370062
  return this.annotations[IMPORT_ID_ANNOTATION];
370056
370063
  }
370057
370064
  else if (id) {
370058
- // hay outputs?
370065
+ // is the ID in the outputs?
370059
370066
  return id;
370060
370067
  }
370061
370068
  else {
@@ -370607,16 +370614,17 @@ function provisionMembers(scope, team, fsGithubGroup) {
370607
370614
  for (const member of fsGithubGroup.spec.members) {
370608
370615
  provisioner_src_logger.info(`Provisioning user ${member.ref.name} for group ${fsGithubGroup.metadata.name}`);
370609
370616
  const tfStateKey = `_${fsGithubGroup.getTfStateKey()}-${member.ref.kind}-${member.ref.name}-tr`;
370617
+ const teamId = team.id || fsGithubGroup.metadata.id;
370610
370618
  if (member.ref.kind === 'FirestartrGithubMembership') {
370611
370619
  const username = fsGithubGroup.resolveRef(member.ref);
370612
370620
  const config = {
370613
370621
  dependsOn: [team],
370614
370622
  username,
370615
- teamId: fsGithubGroup.metadata.slug || team.id,
370623
+ teamId: teamId,
370616
370624
  role: member.role,
370617
370625
  };
370618
370626
  const membership = new team_membership/* TeamMembership */.E(scope, tfStateKey, config);
370619
- fsGithubGroup.addResourceToStack(`${fsGithubGroup.metadata.slug || team.id}:${username}`, membership);
370627
+ fsGithubGroup.addResourceToStack(`${teamId}:${username}`, membership);
370620
370628
  }
370621
370629
  }
370622
370630
  }
@@ -376416,7 +376424,7 @@ const crs_analyzerSubcommand = {
376416
376424
  };
376417
376425
 
376418
376426
  ;// CONCATENATED MODULE: ./package.json
376419
- const package_namespaceObject = JSON.parse('{"i8":"1.56.1-snapshot-1"}');
376427
+ const package_namespaceObject = JSON.parse('{"i8":" v1.56.1-snapshot-3"}');
376420
376428
  ;// CONCATENATED MODULE: ../../package.json
376421
376429
  const package_namespaceObject_1 = {"i8":"1.56.0"};
376422
376430
  ;// CONCATENATED MODULE: ./src/subcommands/index.ts
@@ -42,7 +42,7 @@ export type WorkItemHandler = {
42
42
  writeTerraformOutputInTfResult: WriteTerraformOutputInTfResultFn;
43
43
  writeConnectionSecret: WriteConnectionSecretFn;
44
44
  resolveReferences: ResolveReferencesFn;
45
- resolveOwnOutputs: Function;
45
+ resolveOwnOutputs: () => Promise<any | undefined>;
46
46
  deleteSecret: DeleteSecretFn;
47
47
  itemPath: ItemPathFn;
48
48
  error: ErrorFn;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "1.56.1-snapshot-1",
3
+ "version": " v1.56.1-snapshot-3",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",