@firestartr/cli 2.8.0-snapshot-variant-cloning-3 → 2.8.0-snapshot-c392b2c

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
@@ -325179,6 +325179,8 @@ function toJson_FirestartrGithubRepositorySpecBranchProtections(obj) {
325179
325179
  'enforceAdmins': obj.enforceAdmins,
325180
325180
  'requireSignedCommits': obj.requireSignedCommits,
325181
325181
  'requireConversationResolution': obj.requireConversationResolution,
325182
+ 'bypassPullRequestAllowances': toJson_FirestartrGithubRepositorySpecBranchProtectionsBypassPullRequestAllowances(obj.bypassPullRequestAllowances),
325183
+ 'pushAllowances': toJson_FirestartrGithubRepositorySpecBranchProtectionsPushAllowances(obj.pushAllowances),
325182
325184
  };
325183
325185
  // filter undefined values
325184
325186
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
@@ -325374,6 +325376,38 @@ function toJson_FirestartrGithubRepositorySpecVarsActions(obj) {
325374
325376
  // filter undefined values
325375
325377
  return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325376
325378
  }
325379
+ /**
325380
+ * Converts an object of type 'FirestartrGithubRepositorySpecBranchProtectionsBypassPullRequestAllowances' to JSON representation.
325381
+ */
325382
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325383
+ function toJson_FirestartrGithubRepositorySpecBranchProtectionsBypassPullRequestAllowances(obj) {
325384
+ if (obj === undefined) {
325385
+ return undefined;
325386
+ }
325387
+ const result = {
325388
+ 'apps': obj.apps?.map(y => y),
325389
+ 'teams': obj.teams?.map(y => y),
325390
+ 'users': obj.users?.map(y => y),
325391
+ };
325392
+ // filter undefined values
325393
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325394
+ }
325395
+ /**
325396
+ * Converts an object of type 'FirestartrGithubRepositorySpecBranchProtectionsPushAllowances' to JSON representation.
325397
+ */
325398
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325399
+ function toJson_FirestartrGithubRepositorySpecBranchProtectionsPushAllowances(obj) {
325400
+ if (obj === undefined) {
325401
+ return undefined;
325402
+ }
325403
+ const result = {
325404
+ 'apps': obj.apps?.map(y => y),
325405
+ 'teams': obj.teams?.map(y => y),
325406
+ 'users': obj.users?.map(y => y),
325407
+ };
325408
+ // filter undefined values
325409
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325410
+ }
325377
325411
  /**
325378
325412
  * Converts an object of type 'FirestartrGithubRepositorySpecWriteConnectionSecretToRefOutputs' to JSON representation.
325379
325413
  */
@@ -337650,6 +337684,15 @@ const TF_CACHES_PATH = '/tmp/tfcaches';
337650
337684
  function generateSessionId() {
337651
337685
  return Math.random().toString(36).substring(2, 6).padEnd(4, '0');
337652
337686
  }
337687
+ async function tearUpSessionWorkspace(item, deps, sessionId, failureContext) {
337688
+ try {
337689
+ const context = buildProvisionerContext(item, deps, sessionId);
337690
+ await runTerraformProvisioner(context, 'tear-up-project');
337691
+ }
337692
+ catch (error) {
337693
+ operator_src_logger.warn(`Workspace cleanup failed${failureContext ? ` after ${failureContext}` : ''}: ${error}`);
337694
+ }
337695
+ }
337653
337696
  function processOperation(item, op, handler) {
337654
337697
  try {
337655
337698
  const policy = getPolicy(item, 'firestartr.dev/policy');
@@ -337825,18 +337868,7 @@ async function* doPlanJSONFormat(item, op, handler, setResult = function (_r) {
337825
337868
  // Tear up the session workspace only if the project was created
337826
337869
  // (Terraform execution started), regardless of its success or failure.
337827
337870
  if (terraformExecutionStarted) {
337828
- try {
337829
- const tearContext = buildProvisionerContext(item, deps, sessionId);
337830
- await runTerraformProvisioner(tearContext, 'tear-up-project');
337831
- }
337832
- catch (tearErr) {
337833
- if (error) {
337834
- operator_src_logger.warn(`Workspace cleanup failed after plan error: ${tearErr}`);
337835
- }
337836
- else {
337837
- operator_src_logger.warn(`Workspace cleanup failed: ${tearErr}`);
337838
- }
337839
- }
337871
+ await tearUpSessionWorkspace(item, deps, sessionId, error ? 'plan error' : undefined);
337840
337872
  }
337841
337873
  if (error) {
337842
337874
  if (op === OperationType.SYNC || op === OperationType.RETRY_SYNC) {
@@ -338155,18 +338187,7 @@ async function* process_operation_markedToDeletion(item, op, handler) {
338155
338187
  // Tear up the session workspace only if the project was created
338156
338188
  // (Terraform execution started), regardless of its success or failure.
338157
338189
  if (terraformExecutionStarted) {
338158
- try {
338159
- const tearContext = buildProvisionerContext(item, deps, sessionId);
338160
- await runTerraformProvisioner(tearContext, 'tear-up-project');
338161
- }
338162
- catch (tearErr) {
338163
- if (error) {
338164
- operator_src_logger.warn(`Workspace cleanup failed after destroy error: ${tearErr}`);
338165
- }
338166
- else {
338167
- operator_src_logger.warn(`Workspace cleanup failed: ${tearErr}`);
338168
- }
338169
- }
338190
+ await tearUpSessionWorkspace(item, deps, sessionId, error ? 'destroy error' : undefined);
338170
338191
  }
338171
338192
  if (error) {
338172
338193
  yield {
@@ -338326,18 +338347,7 @@ async function* doApply(item, op, handler) {
338326
338347
  // Tear up the session workspace only if the project was created
338327
338348
  // (Terraform execution started), regardless of its success or failure.
338328
338349
  if (terraformExecutionStarted) {
338329
- try {
338330
- const tearContext = buildProvisionerContext(item, deps, sessionId);
338331
- await runTerraformProvisioner(tearContext, 'tear-up-project');
338332
- }
338333
- catch (tearErr) {
338334
- if (error) {
338335
- operator_src_logger.warn(`Workspace cleanup failed after provisioning error: ${tearErr}`);
338336
- }
338337
- else {
338338
- operator_src_logger.warn(`Workspace cleanup failed: ${tearErr}`);
338339
- }
338340
- }
338350
+ await tearUpSessionWorkspace(item, deps, sessionId, error ? 'provisioning error' : undefined);
338341
338351
  }
338342
338352
  if (error) {
338343
338353
  yield {
@@ -339518,8 +339528,8 @@ const MODULES = {
339518
339528
  },
339519
339529
  FirestartrGithubRepository: {
339520
339530
  module: 'git::https://github.com/prefapp/tfm.git//modules/github-repo',
339521
- // github-repo-v0.7.0
339522
- ref: 'd919ffbff4349c453f75a3b7246b8306a45b12e3',
339531
+ // github-repo-v0.8.0
339532
+ ref: 'c51e2fe8c4f99aa34577b6a5f721a382ff217771',
339523
339533
  },
339524
339534
  FirestartrGithubRepositoryFeature: {
339525
339535
  module: 'git::https://github.com/prefapp/tfm.git//modules/github-files-set',
@@ -339538,8 +339548,8 @@ const MODULES = {
339538
339548
  },
339539
339549
  FirestartrGithubOrganizationSettings: {
339540
339550
  module: 'git::https://github.com/prefapp/tfm.git//modules/github-org-settings',
339541
- // org settings module merged to main (prefapp/tfm#1253)
339542
- ref: 'cf2e2ae487b6cc3f7b208f46a92f5b5f97f8fef2',
339551
+ // github-org-settings-v0.1.0
339552
+ ref: 'c30c5dfdaddf2bca9e966a726d45970c98576e9e',
339543
339553
  },
339544
339554
  };
339545
339555
  function getFirestartrDefaultTFM(kind) {
@@ -340268,9 +340278,7 @@ function provisionBranchProtections(entity) {
340268
340278
  return;
340269
340279
  }
340270
340280
  for (const protection of protections) {
340271
- // This shape should match the compatible Terraform contract
340272
340281
  const output = {};
340273
- // Only emit legacy fields in allowed order
340274
340282
  output.branch = protection.branch;
340275
340283
  output.statusChecks =
340276
340284
  'statusChecks' in protection ? (protection.statusChecks ?? []) : [];
@@ -340286,7 +340294,20 @@ function provisionBranchProtections(entity) {
340286
340294
  if ('requireConversationResolution' in protection)
340287
340295
  output.requireConversationResolution =
340288
340296
  protection.requireConversationResolution;
340289
- // Only keep fields that are present, including explicit false/empty
340297
+ if (protection.bypassPullRequestAllowances) {
340298
+ output.bypassPullRequestAllowances = {
340299
+ apps: protection.bypassPullRequestAllowances.apps || [],
340300
+ teams: protection.bypassPullRequestAllowances.teams || [],
340301
+ users: protection.bypassPullRequestAllowances.users || [],
340302
+ };
340303
+ }
340304
+ if (protection.pushAllowances) {
340305
+ output.pushAllowances = {
340306
+ apps: protection.pushAllowances.apps || [],
340307
+ teams: protection.pushAllowances.teams || [],
340308
+ users: protection.pushAllowances.users || [],
340309
+ };
340310
+ }
340290
340311
  gh_provisioner_src_logger.debug(`[gh-provisioner] Adding branch protection config: ${JSON.stringify(output)}`);
340291
340312
  entity.patchData({
340292
340313
  op: PatchOperations.add,
@@ -340437,7 +340458,6 @@ class EntityGHRepo extends base_Entity {
340437
340458
  await provisionDefaultBranch(this);
340438
340459
  await provisionCodeowners(this);
340439
340460
  await provisionVariables(this);
340440
- // Add branch protections to config if defined
340441
340461
  provisionBranchProtections(this);
340442
340462
  await provisionOIDCSubjectClaim(this);
340443
340463
  await provisionPermissions(this);
@@ -521962,7 +521982,7 @@ const crsStatusSubcommand = {
521962
521982
  };
521963
521983
 
521964
521984
  ;// CONCATENATED MODULE: ./package.json
521965
- const package_namespaceObject = JSON.parse('{"i8":"2.8.0-snapshot-variant-cloning-3"}');
521985
+ const package_namespaceObject = JSON.parse('{"i8":"2.8.0-snapshot-c392b2c"}');
521966
521986
  ;// CONCATENATED MODULE: ../../package.json
521967
521987
  const package_namespaceObject_1 = {"i8":"2.7.1"};
521968
521988
  ;// CONCATENATED MODULE: ./src/subcommands/index.ts
@@ -1530,6 +1530,14 @@ export interface FirestartrGithubRepositorySpecBranchProtections {
1530
1530
  * @schema FirestartrGithubRepositorySpecBranchProtections#requireConversationResolution
1531
1531
  */
1532
1532
  readonly requireConversationResolution?: boolean;
1533
+ /**
1534
+ * @schema FirestartrGithubRepositorySpecBranchProtections#bypassPullRequestAllowances
1535
+ */
1536
+ readonly bypassPullRequestAllowances?: FirestartrGithubRepositorySpecBranchProtectionsBypassPullRequestAllowances;
1537
+ /**
1538
+ * @schema FirestartrGithubRepositorySpecBranchProtections#pushAllowances
1539
+ */
1540
+ readonly pushAllowances?: FirestartrGithubRepositorySpecBranchProtectionsPushAllowances;
1533
1541
  }
1534
1542
  /**
1535
1543
  * Converts an object of type 'FirestartrGithubRepositorySpecBranchProtections' to JSON representation.
@@ -1760,6 +1768,48 @@ export interface FirestartrGithubRepositorySpecVarsActions {
1760
1768
  * Converts an object of type 'FirestartrGithubRepositorySpecVarsActions' to JSON representation.
1761
1769
  */
1762
1770
  export declare function toJson_FirestartrGithubRepositorySpecVarsActions(obj: FirestartrGithubRepositorySpecVarsActions | undefined): Record<string, any> | undefined;
1771
+ /**
1772
+ * @schema FirestartrGithubRepositorySpecBranchProtectionsBypassPullRequestAllowances
1773
+ */
1774
+ export interface FirestartrGithubRepositorySpecBranchProtectionsBypassPullRequestAllowances {
1775
+ /**
1776
+ * @schema FirestartrGithubRepositorySpecBranchProtectionsBypassPullRequestAllowances#apps
1777
+ */
1778
+ readonly apps?: string[];
1779
+ /**
1780
+ * @schema FirestartrGithubRepositorySpecBranchProtectionsBypassPullRequestAllowances#teams
1781
+ */
1782
+ readonly teams?: string[];
1783
+ /**
1784
+ * @schema FirestartrGithubRepositorySpecBranchProtectionsBypassPullRequestAllowances#users
1785
+ */
1786
+ readonly users?: string[];
1787
+ }
1788
+ /**
1789
+ * Converts an object of type 'FirestartrGithubRepositorySpecBranchProtectionsBypassPullRequestAllowances' to JSON representation.
1790
+ */
1791
+ export declare function toJson_FirestartrGithubRepositorySpecBranchProtectionsBypassPullRequestAllowances(obj: FirestartrGithubRepositorySpecBranchProtectionsBypassPullRequestAllowances | undefined): Record<string, any> | undefined;
1792
+ /**
1793
+ * @schema FirestartrGithubRepositorySpecBranchProtectionsPushAllowances
1794
+ */
1795
+ export interface FirestartrGithubRepositorySpecBranchProtectionsPushAllowances {
1796
+ /**
1797
+ * @schema FirestartrGithubRepositorySpecBranchProtectionsPushAllowances#apps
1798
+ */
1799
+ readonly apps?: string[];
1800
+ /**
1801
+ * @schema FirestartrGithubRepositorySpecBranchProtectionsPushAllowances#teams
1802
+ */
1803
+ readonly teams?: string[];
1804
+ /**
1805
+ * @schema FirestartrGithubRepositorySpecBranchProtectionsPushAllowances#users
1806
+ */
1807
+ readonly users?: string[];
1808
+ }
1809
+ /**
1810
+ * Converts an object of type 'FirestartrGithubRepositorySpecBranchProtectionsPushAllowances' to JSON representation.
1811
+ */
1812
+ export declare function toJson_FirestartrGithubRepositorySpecBranchProtectionsPushAllowances(obj: FirestartrGithubRepositorySpecBranchProtectionsPushAllowances | undefined): Record<string, any> | undefined;
1763
1813
  /**
1764
1814
  * @schema FirestartrGithubRepositorySpecWriteConnectionSecretToRefOutputs
1765
1815
  */
@@ -1,5 +1,4 @@
1
1
  import { OperationType } from '../informer';
2
- export declare function generateSessionId(): string;
3
2
  export declare function processOperation(item: any, op: OperationType, handler: any): AsyncGenerator<{
4
3
  item: any;
5
4
  reason: OperationType;
@@ -28,19 +27,6 @@ export declare function sync(item: any, op: OperationType, handler: any, syncPol
28
27
  status: string;
29
28
  message: any;
30
29
  }, void, unknown>;
31
- /**
32
- *
33
- * @param {any} item - CR to be applied
34
- * @param op - Operation type
35
- * @param handler -
36
- */
37
- export declare function doApply(item: any, op: OperationType, handler: any): AsyncGenerator<{
38
- item: any;
39
- reason: OperationType;
40
- type: string;
41
- status: string;
42
- message: string;
43
- }, void, unknown>;
44
30
  /**
45
31
  * @description Adapts the CR to the format expected by the terraform provisioner
46
32
  * @param item - CR to be applied
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "2.8.0-snapshot-variant-cloning-3",
3
+ "version": "2.8.0-snapshot-c392b2c",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",