Skip to content

add support for Fn::Tranform in CFnV2 #12966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft

add support for Fn::Tranform in CFnV2 #12966

wants to merge 14 commits into from

Conversation

pinzon
Copy link
Member

@pinzon pinzon commented Aug 6, 2025

Motivation

Changes

@pinzon pinzon added the semver: patch Non-breaking changes which can be included in patch releases label Aug 6, 2025
Copy link

github-actions bot commented Aug 6, 2025

Test Results - Preflight, Unit

22 063 tests  ±0   20 329 ✅ ±0   6m 12s ⏱️ -12s
     1 suites ±0    1 734 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit 28fef89. ± Comparison against base commit c1d19e2.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Aug 6, 2025

Test Results (amd64) - Acceptance

7 tests  ±0   5 ✅ ±0   3m 13s ⏱️ -1s
1 suites ±0   2 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit 28fef89. ± Comparison against base commit c1d19e2.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Aug 6, 2025

Test Results (amd64) - Integration, Bootstrap

  5 files    5 suites   35m 21s ⏱️
577 tests 354 ✅ 208 💤 15 ❌
583 runs  354 ✅ 214 💤 15 ❌

For more details on these failures, see this check.

Results for commit 28fef89.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Aug 6, 2025

LocalStack Community integration with Pro

  2 files  ±    0    2 suites  ±0   25m 10s ⏱️ - 1h 19m 18s
553 tests  - 4 072  329 ✅  - 3 857  209 💤  - 230  15 ❌ +15 
555 runs   - 4 072  329 ✅  - 3 857  211 💤  - 230  15 ❌ +15 

For more details on these failures, see this check.

Results for commit 28fef89. ± Comparison against base commit c1d19e2.

This pull request removes 4072 tests.
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_lambda_dynamodb
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_opensearch_crud
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_search_books
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_setup
tests.aws.scenario.kinesis_firehose.test_kinesis_firehose.TestKinesisFirehoseScenario ‑ test_kinesis_firehose_s3
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_destination_sns
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_infra
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_prefill_dynamodb_table
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input0-SUCCEEDED]
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input1-SUCCEEDED]
…

♻️ This comment has been updated with latest results.

@pinzon pinzon force-pushed the cp/cfn/v2/transform branch from a85bc97 to aae7310 Compare August 7, 2025 19:40

if intrinsic_function == FnTransform:
if scope.count(FnTransform) > 1:
raise RuntimeError("Nested Fn::Transforms are bad")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"are bad"! I like that error message!

But seriously... let's change that before we merge

if scope.count(FnTransform) > 1:
raise RuntimeError("Nested Fn::Transforms are bad")

path = "$" + ".".join(scope.split("/")[:-1])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do quite like the idea of making this implementation a helper on the Scope class, e.g.

class Scope(str):
    # ...
    def to_jsonpath(self) -> str:
        return "$" + ".".join(self.split("/"))

perhaps even adding a .parent property if we know we need to traverse up the tree

class Scope(str):
    # ...
    @property
    def parent(self) -> Self:
        return Scope(self._SEPARATOR.join(self.split(self._SEPARATOR)[:-1]))

or something

@pinzon pinzon force-pushed the cp/cfn/v2/transform branch from ebe637a to 0eee9ce Compare August 8, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants