@firestartr/cli 2.8.0-snapshot-variant-cloning-2 → 2.8.0-snapshot-variant-cloning-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
@@ -281913,6 +281913,16 @@ async function getRepoInfo(owner, name) {
281913
281913
  const res = await octokit.repos.get({ owner: owner, repo: name });
281914
281914
  return res['data'];
281915
281915
  }
281916
+ async function getRepoSecret(owner, repo, secretName) {
281917
+ logger.info(`Getting repo secret ${owner}/${repo}/${secretName}`);
281918
+ const octokit = await getOctokitForOrg(owner);
281919
+ const response = await octokit.rest.actions.getRepoSecret({
281920
+ owner,
281921
+ repo,
281922
+ secret_name: secretName,
281923
+ });
281924
+ return response.data;
281925
+ }
281916
281926
  async function repoExists(owner, name) {
281917
281927
  logger.info(`Checking if repo exists: ${owner}/${name}`);
281918
281928
  try {
@@ -282089,6 +282099,7 @@ async function isEmptyRepo(owner, name) {
282089
282099
  uploadFile,
282090
282100
  deleteFile,
282091
282101
  getRepoInfo,
282102
+ getRepoSecret,
282092
282103
  repoExists,
282093
282104
  getPages,
282094
282105
  getBranchProtection,
@@ -283365,6 +283376,15 @@ function createFacade(profileName) {
283365
283376
  const response = await octokit.rest.repos.get({ owner, repo: name });
283366
283377
  return response.data;
283367
283378
  },
283379
+ getRepoSecret: async (owner, repo, secretName) => {
283380
+ const octokit = await getOctokitForOrg(owner);
283381
+ const response = await octokit.rest.actions.getRepoSecret({
283382
+ owner,
283383
+ repo,
283384
+ secret_name: secretName,
283385
+ });
283386
+ return response.data;
283387
+ },
283368
283388
  repoExists: async (owner, name) => {
283369
283389
  try {
283370
283390
  const octokit = await getOctokitForOrg(owner);
@@ -323642,18 +323662,41 @@ const CLAIM_REF_ANNOTATION = 'firestartr.dev/claim-ref';
323642
323662
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/renderer/previous-crs-extractor.ts
323643
323663
 
323644
323664
 
323665
+ const VARIANT_OF_ANNOTATION = 'firestartr.dev/variant-of';
323666
+ function isVariantCR(cr) {
323667
+ return cr.metadata?.annotations?.[VARIANT_OF_ANNOTATION] !== undefined;
323668
+ }
323645
323669
  function getPreviousCRfromClaim(claim, previousCRs) {
323646
323670
  const previousCRsKeys = Object.keys(previousCRs);
323671
+ const isVariantClaim = !!claim._parentClaimName;
323647
323672
  for (const previousCRKey of previousCRsKeys) {
323648
323673
  const previousCR = previousCRs[previousCRKey];
323649
323674
  if (isCatalogEntity(previousCR))
323650
323675
  continue;
323651
323676
  if (isExcludedFromPreviousCR(previousCR.kind))
323652
323677
  continue;
323653
- if (previousCR.metadata.annotations[CLAIM_REF_ANNOTATION] ===
323654
- `${claim.kind}/${claim.name}`) {
323678
+ const crVariant = isVariantCR(previousCR);
323679
+ if (isVariantClaim && !crVariant)
323680
+ continue;
323681
+ if (!isVariantClaim && crVariant)
323682
+ continue;
323683
+ const crClaimRef = previousCR.metadata.annotations[CLAIM_REF_ANNOTATION];
323684
+ if (crClaimRef === `${claim.kind}/${claim.name}`) {
323655
323685
  return previousCR;
323656
323686
  }
323687
+ // For variant claims, the claim-ref annotation uses the parent claim name
323688
+ // (via _parentClaimName), but claim.name is the composed name.
323689
+ // Match on parent claim-ref plus composed provider name as CR name prefix.
323690
+ if (isVariantClaim &&
323691
+ crClaimRef === `${claim.kind}/${claim._parentClaimName}`) {
323692
+ for (const provider of Object.keys(claim.providers || {})) {
323693
+ const providerName = claim.providers[provider]?.name;
323694
+ if (providerName &&
323695
+ previousCR.metadata.name.startsWith(providerName + '-')) {
323696
+ return previousCR;
323697
+ }
323698
+ }
323699
+ }
323657
323700
  }
323658
323701
  return false;
323659
323702
  }
@@ -521919,7 +521962,7 @@ const crsStatusSubcommand = {
521919
521962
  };
521920
521963
 
521921
521964
  ;// CONCATENATED MODULE: ./package.json
521922
- const package_namespaceObject = JSON.parse('{"i8":"2.8.0-snapshot-variant-cloning-2"}');
521965
+ const package_namespaceObject = JSON.parse('{"i8":"2.8.0-snapshot-variant-cloning-3"}');
521923
521966
  ;// CONCATENATED MODULE: ../../package.json
521924
521967
  const package_namespaceObject_1 = {"i8":"2.7.1"};
521925
521968
  ;// CONCATENATED MODULE: ./src/subcommands/index.ts
@@ -26,6 +26,7 @@ declare const _default: {
26
26
  uploadFile: typeof import("./src/repository").uploadFile;
27
27
  deleteFile: typeof import("./src/repository").deleteFile;
28
28
  getRepoInfo: typeof import("./src/repository").getRepoInfo;
29
+ getRepoSecret: typeof import("./src/repository").getRepoSecret;
29
30
  repoExists: typeof import("./src/repository").repoExists;
30
31
  getPages: typeof import("./src/repository").getPages;
31
32
  getBranchProtection: typeof import("./src/repository").getBranchProtection;
@@ -800,6 +800,11 @@ export declare function getRepoInfo(owner: string, name: string): Promise<{
800
800
  [key: string]: unknown;
801
801
  };
802
802
  }>;
803
+ export declare function getRepoSecret(owner: string, repo: string, secretName: string): Promise<{
804
+ name: string;
805
+ created_at: string;
806
+ updated_at: string;
807
+ }>;
803
808
  export declare function repoExists(owner: string, name: string): Promise<boolean>;
804
809
  export declare function getPages(owner: string, name: string): Promise<{
805
810
  url: string;
@@ -1336,6 +1341,7 @@ declare const _default: {
1336
1341
  uploadFile: typeof uploadFile;
1337
1342
  deleteFile: typeof deleteFile;
1338
1343
  getRepoInfo: typeof getRepoInfo;
1344
+ getRepoSecret: typeof getRepoSecret;
1339
1345
  repoExists: typeof repoExists;
1340
1346
  getPages: typeof getPages;
1341
1347
  getBranchProtection: typeof getBranchProtection;
@@ -824,6 +824,11 @@ export declare function withProfile(profileName: string): {
824
824
  [key: string]: unknown;
825
825
  };
826
826
  }>;
827
+ getRepoSecret: (owner: string, repo: string, secretName: string) => Promise<{
828
+ name: string;
829
+ created_at: string;
830
+ updated_at: string;
831
+ }>;
827
832
  repoExists: (owner: string, name: string) => Promise<boolean>;
828
833
  };
829
834
  team: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "2.8.0-snapshot-variant-cloning-2",
3
+ "version": "2.8.0-snapshot-variant-cloning-3",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",