Closed
Conversation
- Generate C# SDK using openapi-generator v7.6.0 (csharp/generichost) - Target net6.0 to match Pulumi .NET ecosystem - Package: Pulumi.Esc.Sdk at sdk/csharp/Pulumi.Esc.Sdk/ - Hand-written wrappers: EscClient.cs, EscAuth.cs, ValueMapper.cs - Custom .csproj template at sdk/templates/csharp/ - Makefile targets: generate_csharp_client_sdk, build_csharp, test_csharp - .openapi-generator-ignore blocks extra artifacts (api/, docs/, appveyor.yml) - .gitignore updated for C# bin/obj directories
…onmentDefinitionSerializer - Override partial_header.mustache template for Pulumi copyright on all generated files - Add X-Pulumi-Source and User-Agent headers in EscClient.BuildClient() - Add YamlDotNet 16.3.0 dependency via .csproj template - Create EnvironmentDefinitionSerializer.cs for YAML <-> EnvironmentDefinition - Add convenience methods: GetEnvironmentAsync, GetEnvironmentAtVersionAsync, DecryptEnvironmentAsync - Fix .openapi-generator-ignore docs pattern (docs/* -> docs/**)
- Add xUnit test project (Pulumi.Esc.Sdk.Tests) - EscAuthTests: 6 tests for env var, credential file reading (shared fixtures), ESC override, URL conversion - ValueMapperTests: 13 tests for Value tree unwrapping, JsonElement handling - EnvironmentDefinitionSerializerTests: 8 tests for YAML/JSON serialization round-trips - EscApiTests: E2E integration test (full CRUD lifecycle, tagged Category=Integration) - Fix EscCredentials JSON field: 'currentAccountName' -> 'name' (matches Python/TypeScript SDKs) - Block generated Pulumi.Esc.Sdk.Test/ stubs in .openapi-generator-ignore
- README: Add C# install, quick example, API reference link - CONTRIBUTING: Add build_csharp, test_csharp, test_csharp_integration targets, .NET 6.0 prereq - CHANGELOG_PENDING: Note C# SDK addition - Makefile: test_csharp filters out integration tests, add test_csharp_integration target
- Fix YAML body serialization: bypass generated JsonSerializer for UpdateEnvironmentYaml and CheckEnvironmentYaml (send raw YAML) - Fix CreateEnvironment/CloneEnvironment constructor arg order - Fix Value deserialization: remove required check on 'value' field (API omits it when unknown=true) - Fix .sln project paths (src\ prefix removed) - Add UpdateEnvironmentAsync and CheckEnvironmentAsync accepting EnvironmentDefinition (serializes to YAML, matching Go SDK parity) - Add .gitignore for C# SDK (exclude .vs/, bin/, obj/) - Protect Value.cs and .sln in .openapi-generator-ignore
…full Go test parity
- Fix SerializeToYaml to include AdditionalProperties from
EnvironmentDefinitionValues (foo, my_secret, my_array, etc.)
- Fix Deserialize to capture non-typed YAML keys into
AdditionalProperties as JsonElements
- Add helper methods: ObjectToJsonElement, JsonElementToObject,
ConvertYamlValue for bridging YamlDotNet ↔ System.Text.Json
- Add 3 unit tests for AdditionalProperties round-tripping
- Rewrite integration test to match Go SDK test structure:
- Separate test methods: FullLifecycle, CheckEnvironment_Valid,
CheckEnvironmentYaml_Invalid
- Verify resolved values: my_array, pulumiConfig, environmentVariables
- Test UpdateEnvironmentAsync(EnvironmentDefinition) with versioned property
- Test OpenAndReadEnvironmentAtVersion with revision tags
- Verify envDef structure via AssertEnvDef helper
- Verify tag values
- Clean up clone project envs in RemoveAll
- Add test_csharp job to stage-test.yml (runs make test_csharp) - Add publish-csharp-sdk job to stage-publish-sdk.yml (pack + nuget push) - Lint check-sdk-generation-clean already covers C# via generate_sdks
- Add 9 custom Mustache template overrides in sdk/templates/csharp/libraries/generichost/
to fix missing copyright notices in generated files (upstream OpenAPI Generator bug:
templates used {{partial_header}} variable instead of {{>partial_header}} partial include)
- Update copyright year to 2026 in partial_header.mustache
- Add Pulumi.Esc.Sdk/README.md to .openapi-generator-ignore
- Regenerate all C# SDK files with correct copyright headers
- Verified with pulumictl copyright
.NET 10 disables reflection-based serialization by default. When the net6.0-targeted SDK runs on a .NET 10 runtime, JsonSerializer.Deserialize fails because JsonSerializerOptions has no TypeInfoResolver set. Changes: - Add JsonDefaults.cs with runtime reflection to detect and set DefaultJsonTypeInfoResolver when available (.NET 7+) - HostConfiguration.cs: use JsonDefaults.EnsureTypeInfoResolver() when initializing JsonSerializerOptions - Add HostConfiguration.mustache template override so the fix survives SDK regeneration - EscAuth.cs: pass JsonDefaults.Options to bare Deserialize calls for credentials.json parsing - EscClient.cs: change ResolvePropertyPath from static to instance method to use _jsonSerializerOptions with custom converters - Add JsonDeserializationTests.cs with 8 unit tests covering the affected deserialization paths
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.