-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[codegen/dotnet] Allow generated SDKs to have a global namespace other then Pulumi
#8735
[codegen/dotnet] Allow generated SDKs to have a global namespace other then Pulumi
#8735
Conversation
Specifically, this allows a generated package with a enclosing namespace different then "Pulumi."
Diff for pulumi-random with merge commit 0306cda |
Diff for pulumi-azuread with merge commit 0306cda |
Diff for pulumi-kubernetes with merge commit 0306cda |
Diff for pulumi-gcp with merge commit 0306cda |
Diff for pulumi-azure with merge commit 0306cda |
Diff for pulumi-aws with merge commit 0306cda |
Codecov Report
@@ Coverage Diff @@
## master #8735 +/- ##
==========================================
+ Coverage 59.38% 59.39% +0.01%
==========================================
Files 637 639 +2
Lines 97911 98020 +109
Branches 1386 1386
==========================================
+ Hits 58141 58222 +81
- Misses 36491 36513 +22
- Partials 3279 3285 +6
Continue to review full report at Codecov.
|
Diff for pulumi-random with merge commit f7ed4e3 |
Diff for pulumi-azuread with merge commit f7ed4e3 |
Diff for pulumi-kubernetes with merge commit f7ed4e3 |
Diff for pulumi-gcp with merge commit f7ed4e3 |
Diff for pulumi-random with merge commit 6f16cda |
Diff for pulumi-random with merge commit f2fbb8f |
Diff for pulumi-azuread with merge commit 6f16cda |
Diff for pulumi-kubernetes with merge commit 6f16cda |
Diff for pulumi-azuread with merge commit f2fbb8f |
Diff for pulumi-azure-native with merge commit 0306cda |
Diff for pulumi-azure with merge commit f7ed4e3 |
Diff for pulumi-kubernetes with merge commit f2fbb8f |
Diff for pulumi-gcp with merge commit 6f16cda |
Diff for pulumi-gcp with merge commit f2fbb8f |
Diff for pulumi-aws with merge commit f7ed4e3 |
Diff for pulumi-azuread with merge commit dd0b890 |
Diff for pulumi-kubernetes with merge commit dd0b890 |
Diff for pulumi-gcp with merge commit dd0b890 |
Diff for pulumi-azure with merge commit dd0b890 |
Diff for pulumi-aws with merge commit dd0b890 |
Diff for pulumi-azure-native with merge commit dd0b890 |
Diff for pulumi-azuread with merge commit d36fa55 |
Diff for pulumi-kubernetes with merge commit d36fa55 |
Diff for pulumi-random with merge commit d36fa55 |
Diff for pulumi-gcp with merge commit d36fa55 |
Diff for pulumi-azure with merge commit d36fa55 |
Diff for pulumi-aws with merge commit d36fa55 |
Diff for pulumi-azure-native with merge commit d36fa55 |
</dt> | ||
<dd>{{% md %}}{{% /md %}}</dd><dt class="property-optional" | ||
title="Optional"> | ||
<span id="qux_csharp"> | ||
<a href="#qux_csharp" style="color: inherit; text-decoration: inherit;">Qux</a> | ||
</span> | ||
<span class="property-indicator"></span> | ||
<span class="property-type"><a href="#rubbertreevariety">Pulumi.<wbr>Example.<wbr>Rubber<wbr>Tree<wbr>Variety</a></span> | ||
<span class="property-type"><a href="#rubbertreevariety">.<wbr>Example.<wbr>Rubber<wbr>Tree<wbr>Variety</a></span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look good. .Example
? Starting with a dot?
pkg/codegen/dotnet/gen.go
Outdated
@@ -202,7 +205,7 @@ func (mod *modContext) tokenToNamespace(tok string, qualifier string) string { | |||
components := strings.Split(tok, ":") | |||
contract.Assertf(len(components) == 3, "malformed token %v", tok) | |||
|
|||
pkg, nsName := "Pulumi."+namespaceName(mod.namespaces, components[0]), mod.pkg.TokenToModule(tok) | |||
pkg, nsName := mod.rootNamespace+"."+namespaceName(mod.namespaces, components[0]), mod.pkg.TokenToModule(tok) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps handle the "" case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to pipe mod.rootNamespace
into the docs generation. Fixed now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except something funky around empty namespaces and .Foo
refs generated starting with a dot.
Diff for pulumi-azuread with merge commit 58940cd |
Diff for pulumi-random with merge commit 58940cd |
Diff for pulumi-kubernetes with merge commit 58940cd |
Diff for pulumi-gcp with merge commit 58940cd |
Diff for pulumi-azure with merge commit 58940cd |
Diff for pulumi-aws with merge commit 58940cd |
Diff for pulumi-azure-native with merge commit 58940cd |
Description
Fixes #8573
If a schema author wants to replace the
Pulumi
global namespace, they can add"rootNamespace": "NewNamespace"
to the.language.csharp
section.Checklist