@firestartr/cli 2.4.0-snapshot-3 → 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() {
@@ -298583,20 +298551,6 @@ class RepoGithubDecanter extends GithubDecanter {
298583
298551
  }
298584
298552
  importer_src_logger.info(`No CODEOWNERS file found for ${this.data.repoDetails.name}, skipping.`);
298585
298553
  }
298586
- async __gatherPagesConfiguration() {
298587
- try {
298588
- const pagesConfig = await github.repo.getPages(this.org, this.data.repoDetails.name);
298589
- this.data['pages'] = pagesConfig;
298590
- }
298591
- catch (e) {
298592
- const status = e?.status ?? e?.response?.status;
298593
- if (status === 404) {
298594
- importer_src_logger.info(`No GitHub Pages configuration found for ${this.data.repoDetails.name}, skipping.`);
298595
- return;
298596
- }
298597
- throw e;
298598
- }
298599
- }
298600
298554
  async __gatherRepoLabels() {
298601
298555
  try {
298602
298556
  const labels = await github.repo.getRepoIssuesLabels(this.org, this.data.repoDetails.name);
@@ -305866,7 +305820,7 @@ const MODULES = {
305866
305820
  },
305867
305821
  FirestartrGithubRepository: {
305868
305822
  module: 'git::https://github.com/prefapp/tfm.git//modules/github-repo',
305869
- ref: 'feat/1195-github-repo-problem-on-github-pages',
305823
+ ref: 'github-repo-v0.2.0',
305870
305824
  },
305871
305825
  FirestartrGithubRepositoryFeature: {
305872
305826
  module: 'git::https://github.com/prefapp/tfm.git//modules/github-files-set',
@@ -306615,42 +306569,6 @@ class EntityGHRepo extends base_Entity {
306615
306569
  },
306616
306570
  });
306617
306571
  }
306618
- /**
306619
- * Validation logic for GitHub Pages branch settings:
306620
- * - On create: If pages branch is set, it must equal the default branch.
306621
- * - On update: If pages branch is set and is not the default, it must exist in remote.
306622
- */
306623
- async validatePagesBranch(tfOp, repoAlreadyExists) {
306624
- const pages = this.cr.spec.pages;
306625
- if (!pages || !pages.source || !pages.source.branch)
306626
- return;
306627
- const branch = pages.source.branch;
306628
- const defaultBranch = this.cr.spec.repo.defaultBranch;
306629
- const repo = this.cr.name;
306630
- const org = this.cr.spec.org;
306631
- gh_provisioner_src_logger.error(`[gh-provisioner] ${this.k8sId} validating pages branch '${branch}' against default branch '${defaultBranch}' for operation '${tfOp}'`);
306632
- if (!repoAlreadyExists) {
306633
- if (branch !== defaultBranch) {
306634
- throw new Error(`Pages branch must equal default branch on creation. Provided: '${branch}', expected: '${defaultBranch}'`);
306635
- }
306636
- return;
306637
- }
306638
- else if (branch !== defaultBranch) {
306639
- 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`);
306640
- try {
306641
- await this.runWithGithubProvider(async () => {
306642
- await github.branches.getBranch(repo, branch, org);
306643
- });
306644
- }
306645
- catch (err) {
306646
- if (err && err.status === 404) {
306647
- throw new Error(`Pages branch '${branch}' does not exist in the repository '${org}/${repo}'.`);
306648
- }
306649
- // Other errors propagate
306650
- throw err;
306651
- }
306652
- }
306653
- }
306654
306572
  async loadResources(tfOp) {
306655
306573
  let repoAlreadyExists = false;
306656
306574
  try {
@@ -306658,9 +306576,7 @@ class EntityGHRepo extends base_Entity {
306658
306576
  repoAlreadyExists = (await this.runWithGithubProvider(async () => {
306659
306577
  return await github.repo.repoExists(this.cr.spec.org, this.cr.name);
306660
306578
  }));
306661
- await this.validatePagesBranch(tfOp, repoAlreadyExists);
306662
306579
  await this.provisionRepository();
306663
- await this.provisionPages();
306664
306580
  await provisionDefaultBranch(this);
306665
306581
  await provisionCodeowners(this);
306666
306582
  await provisionVariables(this);
@@ -306768,21 +306684,10 @@ class EntityGHRepo extends base_Entity {
306768
306684
  ignoreVulnerabilityAlertsDuringRead: this.cr.spec.repo.ignoreVulnerabilityAlertsDuringRead,
306769
306685
  mergeCommitTitle: this.cr.spec.repo.mergeCommitTitle,
306770
306686
  squashMergeCommitMessage: this.cr.spec.repo.squashMergeCommitMessage,
306687
+ pages: this.cr.spec.pages,
306771
306688
  },
306772
306689
  });
306773
306690
  }
306774
- provisionPages() {
306775
- if (this.cr.spec.pages) {
306776
- this.patchData({
306777
- path: '/config/pages',
306778
- op: PatchOperations.add,
306779
- value: {
306780
- source: this.cr.spec.pages.source,
306781
- cname: this.cr.spec.pages.cname,
306782
- },
306783
- });
306784
- }
306785
- }
306786
306691
  }
306787
306692
 
306788
306693
  ;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghfeature/helpers/managed_files.ts
@@ -307551,8 +307456,8 @@ async function runGhProvisioner(data, opts) {
307551
307456
  gh_provisioner_src_logger.error(`[gh-provisioner] Error running runGhProvisioner: ${message}`);
307552
307457
  if (!synthFinished && entity)
307553
307458
  entity.synthEnd(message);
307554
- if (entity && entity.inDebugMode && synthFinished) {
307555
- await debugTerraformOutput(entity, err.toString());
307459
+ if (entity && entity.inDebugMode) {
307460
+ await debugTerraformOutput(entity, message);
307556
307461
  }
307557
307462
  throw new Error(`[gh-provisioner] Error running runGhProvisioner: ${message}`);
307558
307463
  }
@@ -309343,7 +309248,7 @@ const crs_analyzerSubcommand = {
309343
309248
  };
309344
309249
 
309345
309250
  ;// CONCATENATED MODULE: ./package.json
309346
- const package_namespaceObject = JSON.parse('{"i8":"2.4.0-snapshot-3"}');
309251
+ const package_namespaceObject = JSON.parse('{"i8":"2.4.0-snapshot-5"}');
309347
309252
  ;// CONCATENATED MODULE: ../../package.json
309348
309253
  const package_namespaceObject_1 = {"i8":"2.3.0"};
309349
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
  }
@@ -16,7 +16,6 @@ export default class RepoGithubDecanter extends GithubDecanter {
16
16
  __gatherOIDCSubjectClaim(): Promise<void>;
17
17
  __gatherBranchStrategy(): Promise<void>;
18
18
  __gatherCodeowners(): Promise<void>;
19
- __gatherPagesConfiguration(): Promise<void>;
20
19
  __gatherRepoLabels(): Promise<void>;
21
20
  __adaptInitializerBranchStrategies(_claim: any): Promise<BranchStrategiesInitializer>;
22
21
  __adaptInitializerBase(_claim: any): Promise<InitializerDefault>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "2.4.0-snapshot-3",
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;