cdk-factory 0.15.18__py3-none-any.whl → 0.15.21__py3-none-any.whl

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.

Potentially problematic release.


This version of cdk-factory might be problematic. Click here for more details.

@@ -5,6 +5,7 @@ Geek Cafe Pipeline
5
5
  import os
6
6
  from pathlib import Path
7
7
  from typing import List, Dict, Any
8
+ import yaml
8
9
 
9
10
  import aws_cdk as cdk
10
11
  from aws_cdk import aws_codebuild as codebuild
@@ -326,12 +327,27 @@ class PipelineFactoryStack(IStack):
326
327
  return None
327
328
 
328
329
  # Parse buildspec
329
- # If a buildspec path is specified, use the buildspec.yml from the source repo
330
+ # If a buildspec path is specified, try to load it locally and convert to from_object()
330
331
  buildspec_path = build.get("buildspec")
331
332
  buildspec = None
332
333
 
333
334
  if buildspec_path:
334
- buildspec = codebuild.BuildSpec.from_source_filename(buildspec_path)
335
+ try:
336
+ candidate = Path(buildspec_path)
337
+ if not candidate.is_file():
338
+ # Try relative to cwd
339
+ candidate = Path(os.getcwd()) / buildspec_path
340
+ if candidate.is_file():
341
+ with candidate.open("r", encoding="utf-8") as f:
342
+ yml = yaml.safe_load(f)
343
+ if isinstance(yml, dict):
344
+ buildspec = codebuild.BuildSpec.from_object(yml)
345
+ else:
346
+ raise ValueError("Parsed buildspec YAML is not a dictionary")
347
+ else:
348
+ raise FileNotFoundError(f"Buildspec file not found: {buildspec_path}")
349
+ except Exception as exc:
350
+ raise RuntimeError(f"Failed to load buildspec from '{buildspec_path}': {exc}")
335
351
  else:
336
352
  # No buildspec specified - check for inline commands
337
353
  inline_commands = build.get("commands", [])
@@ -171,9 +171,18 @@ class JsonLoadingUtility:
171
171
  def merge_sections(self, base: dict, new: dict):
172
172
  """Merge two configuration sections, with new section overriding base section."""
173
173
  for key, value in new.items():
174
- if key in base and isinstance(base[key], dict) and isinstance(value, dict):
175
- self.merge_sections(base[key], value)
174
+ if key in base:
175
+ if isinstance(base[key], dict) and isinstance(value, dict):
176
+ # Recursively merge nested dicts
177
+ self.merge_sections(base[key], value)
178
+ elif isinstance(base[key], list) and isinstance(value, list):
179
+ # Extend arrays instead of replacing them
180
+ base[key].extend(value)
181
+ else:
182
+ # Override for all other types (string, int, bool, etc.)
183
+ base[key] = value
176
184
  else:
185
+ # Key doesn't exist in base, add it
177
186
  base[key] = value
178
187
  return base
179
188
 
cdk_factory/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.15.18"
1
+ __version__ = "0.15.21"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cdk_factory
3
- Version: 0.15.18
3
+ Version: 0.15.21
4
4
  Summary: CDK Factory. A QuickStarter and best practices setup for CDK projects
5
5
  Author-email: Eric Wilson <eric.wilson@geekcafe.com>
6
6
  License: MIT License
@@ -2,7 +2,7 @@ cdk_factory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  cdk_factory/app.py,sha256=RnX0-pwdTAPAdKJK_j13Zl8anf9zYKBwboR0KA8K8xM,10346
3
3
  cdk_factory/cdk.json,sha256=SKZKhJ2PBpFH78j-F8S3VDYW-lf76--Q2I3ON-ZIQfw,3106
4
4
  cdk_factory/cli.py,sha256=FGbCTS5dYCNsfp-etshzvFlGDCjC28r6rtzYbe7KoHI,6407
5
- cdk_factory/version.py,sha256=aNkgoB9um2h-SgHbaMydn49litDmfE43Bugj37-zvq8,24
5
+ cdk_factory/version.py,sha256=R3P7A3OIRwLs91Pf7vcKK6okyw2Hfach3FjnAE4bSO8,24
6
6
  cdk_factory/builds/README.md,sha256=9BBWd7bXpyKdMU_g2UljhQwrC9i5O_Tvkb6oPvndoZk,90
7
7
  cdk_factory/commands/command_loader.py,sha256=QbLquuP_AdxtlxlDy-2IWCQ6D-7qa58aphnDPtp_uTs,3744
8
8
  cdk_factory/configurations/base_config.py,sha256=JKjhNsy0RCUZy1s8n5D_aXXI-upR9izaLtCTfKYiV9k,9624
@@ -68,7 +68,7 @@ cdk_factory/interfaces/ssm_parameter_mixin.py,sha256=uA2j8HmAOpuEA9ynRj51s0WjUHM
68
68
  cdk_factory/lambdas/health_handler.py,sha256=dd40ykKMxWCFEIyp2ZdQvAGNjw_ylI9CSm1N24Hp2ME,196
69
69
  cdk_factory/lambdas/edge/ip_gate/handler.py,sha256=YrXO42gEhJoBTaH6jS7EWqjHe9t5Fpt4WLgY8vjtou0,10474
70
70
  cdk_factory/pipeline/path_utils.py,sha256=fvWdrcb4onmpIu1APkHLhXg8zWfK74HcW3Ra2ynxfXM,2586
71
- cdk_factory/pipeline/pipeline_factory.py,sha256=gTSOqVdLKCDERdbdP4IQtiEFuGZI-EMizxIXuaPGPew,25550
71
+ cdk_factory/pipeline/pipeline_factory.py,sha256=tZTFT-sniqWZk8I2sOTV2wP3fFQGiI_0rrtCi5oGtYg,26342
72
72
  cdk_factory/pipeline/stage.py,sha256=Be7ExMB9A-linRM18IQDOzQ-cP_I2_ThRNzlT4FIrUg,437
73
73
  cdk_factory/pipeline/security/policies.py,sha256=H3-S6nipz3UtF9Pc5eJYr4-aREUTCaJWMjOUyd6Rdv4,4406
74
74
  cdk_factory/pipeline/security/roles.py,sha256=ZB_O5H_BXgotvVspS2kVad9EMcY-a_-vU7Nm1_Z5MB8,4985
@@ -124,13 +124,13 @@ cdk_factory/utilities/docker_utilities.py,sha256=6ee9KEGsaRJWo6FqvdPtE3_L2Emp3Lc
124
124
  cdk_factory/utilities/environment_services.py,sha256=cd2T0efJtFPMLa1Fm7MPL-sqUlhKXCB7_XHsR8sfymE,9696
125
125
  cdk_factory/utilities/file_operations.py,sha256=fxqT0iyYZkb46lQr_XXadhFTca_1neVW0VRVkbyMmhA,9462
126
126
  cdk_factory/utilities/git_utilities.py,sha256=7Xac8PaThc7Lmk5jtDBHaJOj-fWRT017cgZmgXkVizM,3155
127
- cdk_factory/utilities/json_loading_utility.py,sha256=YRgzA1I-B_HwZm1eWJTeQ1JLkebCL4C1gpHOqo6GkCA,10341
127
+ cdk_factory/utilities/json_loading_utility.py,sha256=Ko28g-Izh7tBnRtOSqzOXyfcZvQlthFj4kOXCFVF4oc,10787
128
128
  cdk_factory/utilities/lambda_function_utilities.py,sha256=S1GvBsY_q2cyUiaud3HORJMnLhI5cRi31fbeaktY-_Q,15826
129
129
  cdk_factory/utilities/os_execute.py,sha256=5Op0LY_8Y-pUm04y1k8MTpNrmQvcLmQHPQITEP7EuSU,1019
130
130
  cdk_factory/utils/api_gateway_utilities.py,sha256=If7Xu5s_UxmuV-kL3JkXxPLBdSVUKoLtohm0IUFoiV8,4378
131
131
  cdk_factory/workload/workload_factory.py,sha256=yDI3cRhVI5ELNDcJPLpk9UY54Uind1xQoV3spzT4z7E,6068
132
- cdk_factory-0.15.18.dist-info/METADATA,sha256=rupyw8D3w9KLEWhGDl-sjVCXfJDrdUiEY1gWNB0IaZs,2452
133
- cdk_factory-0.15.18.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
134
- cdk_factory-0.15.18.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
135
- cdk_factory-0.15.18.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
136
- cdk_factory-0.15.18.dist-info/RECORD,,
132
+ cdk_factory-0.15.21.dist-info/METADATA,sha256=gDy99ATFt-hq-9aKupyCd-Quk7VCkRGmyltq4tbvWt8,2452
133
+ cdk_factory-0.15.21.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
134
+ cdk_factory-0.15.21.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
135
+ cdk_factory-0.15.21.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
136
+ cdk_factory-0.15.21.dist-info/RECORD,,