@firestartr/cli 2.4.0-snapshot-4 → 2.4.0-snapshot-5

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
@@ -293774,6 +293774,7 @@ function toJson_FirestartrGithubRepositorySpecRepo(obj) {
293774
293774
  'allowUpdateBranch': obj.allowUpdateBranch,
293775
293775
  'hasIssues': obj.hasIssues,
293776
293776
  'hasWiki': obj.hasWiki,
293777
+ 'pages': obj.pages,
293777
293778
  'topics': obj.topics?.map(y => y),
293778
293779
  'labels': obj.labels?.map(y => toJson_FirestartrGithubRepositorySpecRepoLabels(y)),
293779
293780
  'visibility': obj.visibility,
@@ -297174,32 +297175,6 @@ function searchSecretKey(secretClaim, key) {
297174
297175
  return found;
297175
297176
  }
297176
297177
 
297177
- ;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/componentPagesPath.ts
297178
- /**
297179
- * Throws if any ComponentClaim's providers.github.pages.path is set to any value other than '/' or '/docs'.
297180
- * Should be called as a final render-time validation (never mutates input).
297181
- */
297182
- function validateComponentPagesPath(renderClaims) {
297183
- for (const ref of Object.keys(renderClaims)) {
297184
- const claimEntry = renderClaims[ref];
297185
- // Heuristic: claim.kind === 'ComponentClaim' (may need to adjust based on naming)
297186
- if (claimEntry.claim &&
297187
- claimEntry.claim.kind === 'ComponentClaim' &&
297188
- claimEntry.claim.providers &&
297189
- claimEntry.claim.providers.github &&
297190
- claimEntry.claim.providers.github.pages &&
297191
- typeof claimEntry.claim.providers.github.pages === 'object') {
297192
- const pages = claimEntry.claim.providers.github.pages;
297193
- if (Object.prototype.hasOwnProperty.call(pages.source, 'path') &&
297194
- typeof pages.source.path === 'string' &&
297195
- pages.source.path !== '/' &&
297196
- pages.source.path !== '/docs') {
297197
- throw new Error(`ComponentClaim/${claimEntry.claim.name}: providers.github.pages.source.path must be '/' or '/docs' if set. Found: '${pages.source.path}'`);
297198
- }
297199
- }
297200
- }
297201
- }
297202
-
297203
297178
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/renderer/renderer.ts
297204
297179
 
297205
297180
 
@@ -297208,7 +297183,6 @@ function validateComponentPagesPath(renderClaims) {
297208
297183
 
297209
297184
 
297210
297185
 
297211
-
297212
297186
  /*
297213
297187
  * Function called when rendering but not importing
297214
297188
  *
@@ -297225,7 +297199,6 @@ async function renderer_render(catalogScope, firestartrScope, claimList) {
297225
297199
  const result = await renderClaims(catalogScope, firestartrScope, data);
297226
297200
  try {
297227
297201
  validateSubReferences(data.renderClaims);
297228
- validateComponentPagesPath(data.renderClaims);
297229
297202
  validateTfStateKeyUniqueness(result);
297230
297203
  validateCrSizes(result);
297231
297204
  validatePermissionsUniqueness(result);
@@ -298320,20 +298293,15 @@ class RepoGithubDecanter extends GithubDecanter {
298320
298293
  });
298321
298294
  }
298322
298295
  __decantPages() {
298323
- if (this.data.pages) {
298324
- if (this.data.pages.build_type === 'workflow') {
298325
- importer_src_logger.info(`Repository ${this.data.repoDetails.name} is using GitHub Actions for Pages deployment, skipping Pages configuration in claim as it's managed via workflow.`);
298326
- }
298327
- else if (this.data.pages.build_type === 'legacy') {
298328
- this.__patchClaim({
298329
- op: 'add',
298330
- path: '/providers/github/pages',
298331
- value: {
298332
- cname: this.data.pages.cname || '',
298333
- source: this.data.pages.source,
298334
- },
298335
- });
298336
- }
298296
+ if (this.data.repoDetails.has_pages) {
298297
+ this.__patchClaim({
298298
+ op: 'add',
298299
+ value: {
298300
+ cname: this.data.pages.cname,
298301
+ source: this.data.pages.source,
298302
+ },
298303
+ path: '/providers/github/pages',
298304
+ });
298337
298305
  }
298338
298306
  }
298339
298307
  __decantOIDC() {
@@ -305852,7 +305820,7 @@ const MODULES = {
305852
305820
  },
305853
305821
  FirestartrGithubRepository: {
305854
305822
  module: 'git::https://github.com/prefapp/tfm.git//modules/github-repo',
305855
- ref: 'feat/1195-github-repo-problem-on-github-pages',
305823
+ ref: 'github-repo-v0.2.0',
305856
305824
  },
305857
305825
  FirestartrGithubRepositoryFeature: {
305858
305826
  module: 'git::https://github.com/prefapp/tfm.git//modules/github-files-set',
@@ -306601,42 +306569,6 @@ class EntityGHRepo extends base_Entity {
306601
306569
  },
306602
306570
  });
306603
306571
  }
306604
- /**
306605
- * Validation logic for GitHub Pages branch settings:
306606
- * - On create: If pages branch is set, it must equal the default branch.
306607
- * - On update: If pages branch is set and is not the default, it must exist in remote.
306608
- */
306609
- async validatePagesBranch(tfOp, repoAlreadyExists) {
306610
- const pages = this.cr.spec.pages;
306611
- if (!pages || !pages.source || !pages.source.branch)
306612
- return;
306613
- const branch = pages.source.branch;
306614
- const defaultBranch = this.cr.spec.repo.defaultBranch;
306615
- const repo = this.cr.name;
306616
- const org = this.cr.spec.org;
306617
- gh_provisioner_src_logger.error(`[gh-provisioner] ${this.k8sId} validating pages branch '${branch}' against default branch '${defaultBranch}' for operation '${tfOp}'`);
306618
- if (!repoAlreadyExists) {
306619
- if (branch !== defaultBranch) {
306620
- throw new Error(`Pages branch must equal default branch on creation. Provided: '${branch}', expected: '${defaultBranch}'`);
306621
- }
306622
- return;
306623
- }
306624
- else if (branch !== defaultBranch) {
306625
- gh_provisioner_src_logger.error(`[gh-provisioner] ${this.k8sId} validating pages branch '${branch}' against default branch '${defaultBranch}' for operation '${tfOp}' - branch is different from default, checking existence in remote`);
306626
- try {
306627
- await this.runWithGithubProvider(async () => {
306628
- await github.branches.getBranch(repo, branch, org);
306629
- });
306630
- }
306631
- catch (err) {
306632
- if (err && err.status === 404) {
306633
- throw new Error(`Pages branch '${branch}' does not exist in the repository '${org}/${repo}'.`);
306634
- }
306635
- // Other errors propagate
306636
- throw err;
306637
- }
306638
- }
306639
- }
306640
306572
  async loadResources(tfOp) {
306641
306573
  let repoAlreadyExists = false;
306642
306574
  try {
@@ -306644,9 +306576,7 @@ class EntityGHRepo extends base_Entity {
306644
306576
  repoAlreadyExists = (await this.runWithGithubProvider(async () => {
306645
306577
  return await github.repo.repoExists(this.cr.spec.org, this.cr.name);
306646
306578
  }));
306647
- await this.validatePagesBranch(tfOp, repoAlreadyExists);
306648
306579
  await this.provisionRepository();
306649
- await this.provisionPages();
306650
306580
  await provisionDefaultBranch(this);
306651
306581
  await provisionCodeowners(this);
306652
306582
  await provisionVariables(this);
@@ -306754,21 +306684,10 @@ class EntityGHRepo extends base_Entity {
306754
306684
  ignoreVulnerabilityAlertsDuringRead: this.cr.spec.repo.ignoreVulnerabilityAlertsDuringRead,
306755
306685
  mergeCommitTitle: this.cr.spec.repo.mergeCommitTitle,
306756
306686
  squashMergeCommitMessage: this.cr.spec.repo.squashMergeCommitMessage,
306687
+ pages: this.cr.spec.pages,
306757
306688
  },
306758
306689
  });
306759
306690
  }
306760
- provisionPages() {
306761
- if (this.cr.spec.pages) {
306762
- this.patchData({
306763
- path: '/config/pages',
306764
- op: PatchOperations.add,
306765
- value: {
306766
- source: this.cr.spec.pages.source,
306767
- cname: this.cr.spec.pages.cname,
306768
- },
306769
- });
306770
- }
306771
- }
306772
306691
  }
306773
306692
 
306774
306693
  ;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghfeature/helpers/managed_files.ts
@@ -307537,8 +307456,8 @@ async function runGhProvisioner(data, opts) {
307537
307456
  gh_provisioner_src_logger.error(`[gh-provisioner] Error running runGhProvisioner: ${message}`);
307538
307457
  if (!synthFinished && entity)
307539
307458
  entity.synthEnd(message);
307540
- if (entity && entity.inDebugMode && synthFinished) {
307541
- await debugTerraformOutput(entity, err.toString());
307459
+ if (entity && entity.inDebugMode) {
307460
+ await debugTerraformOutput(entity, message);
307542
307461
  }
307543
307462
  throw new Error(`[gh-provisioner] Error running runGhProvisioner: ${message}`);
307544
307463
  }
@@ -309329,7 +309248,7 @@ const crs_analyzerSubcommand = {
309329
309248
  };
309330
309249
 
309331
309250
  ;// CONCATENATED MODULE: ./package.json
309332
- const package_namespaceObject = JSON.parse('{"i8":"2.4.0-snapshot-4"}');
309251
+ const package_namespaceObject = JSON.parse('{"i8":"2.4.0-snapshot-5"}');
309333
309252
  ;// CONCATENATED MODULE: ../../package.json
309334
309253
  const package_namespaceObject_1 = {"i8":"2.3.0"};
309335
309254
  ;// CONCATENATED MODULE: ./src/subcommands/index.ts
@@ -1010,6 +1010,10 @@ export interface FirestartrGithubRepositorySpecRepo {
1010
1010
  * @schema FirestartrGithubRepositorySpecRepo#hasWiki
1011
1011
  */
1012
1012
  readonly hasWiki?: boolean;
1013
+ /**
1014
+ * @schema FirestartrGithubRepositorySpecRepo#pages
1015
+ */
1016
+ readonly pages?: any;
1013
1017
  /**
1014
1018
  * @schema FirestartrGithubRepositorySpecRepo#topics
1015
1019
  */
@@ -1,15 +1,8 @@
1
1
  import { Entity } from '../base';
2
2
  export declare class EntityGHRepo extends Entity {
3
3
  constructor(artifact: any);
4
- /**
5
- * Validation logic for GitHub Pages branch settings:
6
- * - On create: If pages branch is set, it must equal the default branch.
7
- * - On update: If pages branch is set and is not the default, it must exist in remote.
8
- */
9
- private validatePagesBranch;
10
4
  loadResources(tfOp: string): Promise<void>;
11
5
  postProvision(tfOp: string): Promise<void>;
12
6
  loadAddressesToImport(): Promise<void>;
13
7
  provisionRepository(): Promise<void>;
14
- provisionPages(): void;
15
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "2.4.0-snapshot-4",
3
+ "version": "2.4.0-snapshot-5",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",
@@ -1,6 +0,0 @@
1
- import { RenderClaims } from '../renderer/types';
2
- /**
3
- * Throws if any ComponentClaim's providers.github.pages.path is set to any value other than '/' or '/docs'.
4
- * Should be called as a final render-time validation (never mutates input).
5
- */
6
- export declare function validateComponentPagesPath(renderClaims: RenderClaims): void;