Skip to content
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

Infer Pulumi schema from implementation of ComponentResource(s) #468

Closed
Tracked by #15939
mikhailshilkov opened this issue Feb 18, 2025 · 1 comment · Fixed by #498
Closed
Tracked by #15939

Infer Pulumi schema from implementation of ComponentResource(s) #468

mikhailshilkov opened this issue Feb 18, 2025 · 1 comment · Fixed by #498
Assignees
Labels
area/sdks kind/enhancement Improvements or new features resolution/fixed This issue was fixed
Milestone

Comments

@mikhailshilkov
Copy link
Member

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

To simplify Component Provider authoring, we want to get rid of the requirement to author schema files manually. The idea is to provide utility functions that, when pointed at a C# project, can locate all classes that derive from ComponentResource and infer their schema with reflection. We want a C# function that accepts an assembly (calling assembly by default) and returns a JSON-serializable representation of the full Pulumi schema. It should work for multiple component resources located in the same project.

Component inputs and outputs are derived from the Args class properties and Output properties of the component. Auxiliary types must be supported.

A prototype of this feature is available in #453

Affected area/feature

Component Packages
Provider SDK

@mikhailshilkov mikhailshilkov added the kind/enhancement Improvements or new features label Feb 18, 2025
@pulumi-bot pulumi-bot added the needs-triage Needs attention from the triage team label Feb 18, 2025
@lunaris lunaris added area/sdks and removed needs-triage Needs attention from the triage team labels Feb 20, 2025
@lunaris lunaris added this to the 0.117 milestone Feb 20, 2025
github-merge-queue bot pushed a commit that referenced this issue Feb 24, 2025
Implements `ComponentAnalyzer.GenerateSchema` which takes either an
assembly or a list of component resources and produces a serializable
package schema structure. Infers component resources and their dependent
types. Here are the features that this PR implements and tests:

- [x] Inputs
- [x] Outputs
- [x] Plain types
- [x] Boolean, integer, number, string
- [x] Complex types
- [x] Nested complex types
- [x] Self-recursive complex types
- [x] Mutually recursive complex types
- [x] Required properties & inputs
- [ ] Component description
- [ ] Complex type description
- [ ] Property description
- [x] Optional
- [x] Array
- [x] Map
- [x] Asset/Archive
- [ ] Resource reference
- [ ] Discriminated Union
- [ ] Enum
- [ ] Methods
- [ ] References to component in same provider
- [ ] pulumi.Any

Resolve #468 (we'll track
missing features in separate issues)
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Feb 24, 2025
@pulumi-bot
Copy link

This PR has been shipped in release v3.75.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sdks kind/enhancement Improvements or new features resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants