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

[codegen/dotnet] Allow generated SDKs to have a global namespace other then Pulumi #8735

Merged
merged 18 commits into from
Jan 21, 2022

Conversation

iwahbe
Copy link
Member

@iwahbe iwahbe commented Jan 12, 2022

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

  • I have added tests that prove my fix is effective or that my feature works
  • Yes, there are changes in this PR that warrants bumping the Pulumi Service API version

Specifically, this allows a generated package with a enclosing namespace
different then "Pulumi."
@iwahbe iwahbe self-assigned this Jan 12, 2022
@github-actions
Copy link

Diff for pulumi-random with merge commit 0306cda

@github-actions
Copy link

Diff for pulumi-azuread with merge commit 0306cda

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit 0306cda

@github-actions
Copy link

Diff for pulumi-gcp with merge commit 0306cda

@github-actions
Copy link

Diff for pulumi-azure with merge commit 0306cda

@github-actions
Copy link

Diff for pulumi-aws with merge commit 0306cda

@codecov
Copy link

codecov bot commented Jan 12, 2022

Codecov Report

Merging #8735 (2ce445b) into master (a14cd1c) will increase coverage by 0.01%.
The diff coverage is 92.95%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
pkg/codegen/dotnet/templates.go 100.00% <ø> (ø)
pkg/codegen/internal/test/sdk_driver.go 78.35% <85.00%> (+0.45%) ⬆️
pkg/codegen/dotnet/gen.go 82.46% <93.33%> (+0.10%) ⬆️
pkg/codegen/dotnet/doc.go 74.19% <100.00%> (+1.77%) ⬆️
pkg/codegen/dotnet/importer.go 44.00% <100.00%> (+14.00%) ⬆️
pkg/codegen/utilities.go 62.66% <100.00%> (+1.02%) ⬆️
pkg/codegen/dotnet/utilities.go 76.62% <0.00%> (-6.48%) ⬇️
pkg/codegen/nodejs/gen_program.go 87.46% <0.00%> (-1.47%) ⬇️
pkg/codegen/python/gen_program.go 87.06% <0.00%> (-1.33%) ⬇️
pkg/codegen/go/gen_program_utils.go 6.66% <0.00%> (-1.18%) ⬇️
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a14cd1c...2ce445b. Read the comment docs.

@iwahbe iwahbe requested a review from a team January 12, 2022 19:32
@github-actions
Copy link

Diff for pulumi-random with merge commit f7ed4e3

@github-actions
Copy link

Diff for pulumi-azuread with merge commit f7ed4e3

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit f7ed4e3

@github-actions
Copy link

Diff for pulumi-gcp with merge commit f7ed4e3

@github-actions
Copy link

Diff for pulumi-random with merge commit 6f16cda

@github-actions
Copy link

Diff for pulumi-random with merge commit f2fbb8f

@github-actions
Copy link

Diff for pulumi-azuread with merge commit 6f16cda

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit 6f16cda

@github-actions
Copy link

Diff for pulumi-azuread with merge commit f2fbb8f

@github-actions
Copy link

Diff for pulumi-azure-native with merge commit 0306cda

@github-actions
Copy link

Diff for pulumi-azure with merge commit f7ed4e3

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit f2fbb8f

@github-actions
Copy link

Diff for pulumi-gcp with merge commit 6f16cda

@github-actions
Copy link

Diff for pulumi-gcp with merge commit f2fbb8f

@github-actions
Copy link

Diff for pulumi-aws with merge commit f7ed4e3

@github-actions
Copy link

Diff for pulumi-azuread with merge commit dd0b890

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit dd0b890

@github-actions
Copy link

Diff for pulumi-gcp with merge commit dd0b890

@github-actions
Copy link

Diff for pulumi-azure with merge commit dd0b890

@github-actions
Copy link

Diff for pulumi-aws with merge commit dd0b890

@github-actions
Copy link

Diff for pulumi-azure-native with merge commit dd0b890

@github-actions
Copy link

Diff for pulumi-azuread with merge commit d36fa55

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit d36fa55

@github-actions
Copy link

Diff for pulumi-random with merge commit d36fa55

@github-actions
Copy link

Diff for pulumi-gcp with merge commit d36fa55

@github-actions
Copy link

Diff for pulumi-azure with merge commit d36fa55

@github-actions
Copy link

Diff for pulumi-aws with merge commit d36fa55

@github-actions
Copy link

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>
Copy link
Member

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?

@@ -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)
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps handle the "" case?

Copy link
Member Author

@iwahbe iwahbe Jan 21, 2022

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.

@t0yv0 t0yv0 self-requested a review January 21, 2022 16:42
Copy link
Member

@t0yv0 t0yv0 left a 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.

@github-actions
Copy link

Diff for pulumi-azuread with merge commit 58940cd

@github-actions
Copy link

Diff for pulumi-random with merge commit 58940cd

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit 58940cd

@github-actions
Copy link

Diff for pulumi-gcp with merge commit 58940cd

@github-actions
Copy link

Diff for pulumi-azure with merge commit 58940cd

@github-actions
Copy link

Diff for pulumi-aws with merge commit 58940cd

@github-actions
Copy link

Diff for pulumi-azure-native with merge commit 58940cd

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.

Allow NuGet packages without Pulumi. prefix
4 participants