Skip to content

Conversation

@corymhall
Copy link
Contributor

@corymhall corymhall commented Dec 3, 2025

  • Adds support for emitting CloudFormation list handler schemas into resource metadata.
  • Captures only the minimal shape needed: properties with description and type, plus required.
  • Resolves $ref entries in handler schemas to pull description/type from the base resource properties when the handler schema omits
    them.

Implementation details

  • Extended CloudAPIResource metadata with listHandlerSchema and supporting structs.
  • Enhanced schema generation (gatherListHandlerSchema) to:
    • Read handlers.list.handlerSchema from CFN schema extras.
    • Copy description/type when present.
    • For properties that are only $ref, look up the referenced property on the resource schema and backfill description/type.
    • Emit nothing if no meaningful fields are present, keeping metadata lean.
  • Added unit tests covering direct field extraction and $ref fallback.

Note:
This has no impact on the provider itself. We use this metadata file in downstream projects like pulumi-tool-cdk-importer so this PR is just adding some additional information to it that we need to consume in those downstream projects.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 60.75949% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.21%. Comparing base (86dee51) to head (65e31ab).
⚠️ Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
provider/pkg/schema/gen.go 60.75% 22 Missing and 9 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2670      +/-   ##
==========================================
+ Coverage   52.10%   52.21%   +0.11%     
==========================================
  Files          49       49              
  Lines        5940     6019      +79     
==========================================
+ Hits         3095     3143      +48     
- Misses       2590     2612      +22     
- Partials      255      264       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for emitting CloudFormation list handler schemas into resource metadata for downstream consumption by projects like pulumi-tool-cdk-importer. The implementation captures minimal schema information (properties with description/type, and required fields) and intelligently resolves $ref entries to backfill missing data from the base resource schema.

Key Changes:

  • Extended CloudAPIResource metadata with ListHandlerSchema field containing properties and required fields for list handlers
  • Implemented gatherListHandlerSchema() to extract list handler schemas from CloudFormation extras, with $ref resolution fallback
  • Added comprehensive unit tests covering direct extraction, $ref fallback, and missing schema scenarios

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
provider/pkg/metadata/metadata.go Added ListHandlerSchema and ListHandlerProperty structs to capture list handler metadata
provider/pkg/schema/gen.go Implemented list handler schema gathering with $ref resolution and helper functions for parsing
provider/pkg/schema/gen_list_handler_schema_test.go Added unit tests for schema extraction, $ref fallback, and edge cases
provider/cmd/pulumi-resource-aws-native/metadata.json Generated metadata with list handler schemas for numerous AWS resources

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@corymhall corymhall force-pushed the corymhall/list-handler branch from e64d3dc to 65e31ab Compare December 4, 2025 13:51
@corymhall corymhall requested a review from a team December 5, 2025 18:43
@corymhall corymhall merged commit 371f1ae into master Dec 10, 2025
19 checks passed
@corymhall corymhall deleted the corymhall/list-handler branch December 10, 2025 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants