@codedrifters/configulator 0.0.430 → 0.0.431

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/lib/index.mjs CHANGED
@@ -42548,6 +42548,7 @@ var renderSetupPnpm = (pnpmVersion) => {
42548
42548
 
42549
42549
  // src/workflows/aws-deploy-workflow.ts
42550
42550
  var PROD_DEPLOY_NAME = "prod-deploy";
42551
+ var BRANCH_NAME_EXPRESSION = "${{ github.head_ref || github.ref_name }}";
42551
42552
  var AwsDeployWorkflow = class _AwsDeployWorkflow extends Component25 {
42552
42553
  constructor(project, options = {}) {
42553
42554
  super(project);
@@ -42578,6 +42579,28 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends Component25 {
42578
42579
  target.region
42579
42580
  ].join("-");
42580
42581
  };
42582
+ /**
42583
+ * Build a deploy job's `concurrency` setting from its job name.
42584
+ *
42585
+ * Two shapes, deliberately:
42586
+ *
42587
+ * - Unscoped (the default) stays the bare string the job has always carried,
42588
+ * so an existing consumer's workflow is byte-identical.
42589
+ * - Branch-scoped spells out `cancel-in-progress: false` rather than leaning
42590
+ * on GitHub's default, the same way the apply job does. A group keyed on
42591
+ * the branch reads like a "cancel superseded pushes" group, and that is the
42592
+ * one thing it must not be — cancelling a half-finished `cdk deploy`
42593
+ * strands a CloudFormation stack mid-update.
42594
+ */
42595
+ this.buildDeployConcurrency = (deployJobName) => {
42596
+ if (!this.branchScopedConcurrency) {
42597
+ return deployJobName;
42598
+ }
42599
+ return {
42600
+ group: `${deployJobName}-${BRANCH_NAME_EXPRESSION}`,
42601
+ "cancel-in-progress": false
42602
+ };
42603
+ };
42581
42604
  /**
42582
42605
  * Build the deterministic GitHub Actions job name for a target's apply job.
42583
42606
  * Mirrors {@link buildJobName} with an `apply` verb.
@@ -42707,6 +42730,13 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends Component25 {
42707
42730
  * same-target deploy. `cancel-in-progress` is spelled out rather than
42708
42731
  * left to GitHub's default: cancelling a half-finished `cdk deploy`
42709
42732
  * strands a CloudFormation stack mid-update.
42733
+ *
42734
+ * `branchScopedConcurrency` deliberately does not reach here. An apply is
42735
+ * dispatched from whatever ref the operator happens to be on — unrelated
42736
+ * to the branch the nominated plan ran against, which is the only branch
42737
+ * that describes what is about to be deployed. Keying on the dispatch ref
42738
+ * would hand out separate locks to applies of the same target, so the
42739
+ * unsuffixed group stays.
42710
42740
  */
42711
42741
  concurrency: {
42712
42742
  group: this.buildJobName(target),
@@ -42972,6 +43002,7 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends Component25 {
42972
43002
  artifact: options.diff?.artifact ?? true,
42973
43003
  summary: options.diff?.summary ?? true
42974
43004
  };
43005
+ this.branchScopedConcurrency = options.branchScopedConcurrency ?? false;
42975
43006
  this.environmentName = resolveEnvironmentGate(
42976
43007
  options.gate,
42977
43008
  options.environmentName,
@@ -43035,7 +43066,7 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends Component25 {
43035
43066
  * Set GIT_BRANCH_NAME so Turborepo remote cache hashes match between local and CI.
43036
43067
  */
43037
43068
  env: {
43038
- GIT_BRANCH_NAME: "${{ github.head_ref || github.ref_name }}",
43069
+ GIT_BRANCH_NAME: BRANCH_NAME_EXPRESSION,
43039
43070
  ...options.buildWorkflowOptions?.env,
43040
43071
  ...buildWorkflowOptions?.env
43041
43072
  },
@@ -43125,7 +43156,7 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends Component25 {
43125
43156
  pullRequests: JobPermission7.WRITE
43126
43157
  },
43127
43158
  ...this.environmentName ? { environment: this.environmentName } : void 0,
43128
- concurrency: deployJobName,
43159
+ concurrency: this.buildDeployConcurrency(deployJobName),
43129
43160
  if: jobCondition,
43130
43161
  steps: [...this.deploySteps(target)]
43131
43162
  });