Skip to content

Implement autonaming configuration protocol#3779

Merged
mikhailshilkov merged 2 commits into
masterfrom
mikhailshilkov/autonaming-config
Dec 13, 2024
Merged

Implement autonaming configuration protocol#3779
mikhailshilkov merged 2 commits into
masterfrom
mikhailshilkov/autonaming-config

Conversation

@mikhailshilkov

@mikhailshilkov mikhailshilkov commented Dec 11, 2024

Copy link
Copy Markdown
Contributor

This PR implement the Azure Native part of pulumi/pulumi#1518. See pulumi/pulumi#17592 for the full design.

In short, pulumi/pulumi#17810 introduced the protobuf changes required for the provider-side implementation. With those, a provider can:

  • Declare that it supports autonaming configurations with a response flag in Configure
  • Accept two extra properties in CheckRequest: a proposed name and a mode to apply it

This PR applies those parameters to auto-name calculation if they are specified:

  • In Disabled mode, we don't calculate auto-names and let the resource validation fail if an explicit name is not specified
  • In Enforce mode, we use whatever ProposedName is supplied by the engine
  • In Propose mode, almost the same as Enforce with exception of calculating a UUID for UUID fields and ignoring a proposed name

Added unit tests to cover most autonaming cases (old or new). Also, added an end-to-end test in YAML.

Resolves #3777

@github-actions

Copy link
Copy Markdown
Contributor

Does the PR have any schema changes?

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

@codecov

codecov Bot commented Dec 11, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.95%. Comparing base (83461c2) to head (2ec1294).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3779      +/-   ##
==========================================
+ Coverage   56.70%   56.95%   +0.25%     
==========================================
  Files          78       78              
  Lines       11999    12018      +19     
==========================================
+ Hits         6804     6845      +41     
+ Misses       4692     4673      -19     
+ Partials      503      500       -3     

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

@mikhailshilkov mikhailshilkov force-pushed the mikhailshilkov/autonaming-config branch from fff19ab to 9f024e3 Compare December 12, 2024 13:40
@mikhailshilkov mikhailshilkov force-pushed the mikhailshilkov/autonaming-config branch from 9f024e3 to 0b5be01 Compare December 12, 2024 17:02
@mikhailshilkov mikhailshilkov marked this pull request as ready for review December 12, 2024 17:57
@mikhailshilkov mikhailshilkov force-pushed the mikhailshilkov/autonaming-config branch from 0b5be01 to c013e93 Compare December 12, 2024 21:32

@danielrbradley danielrbradley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Core implementation looks okay, would like to see the tests alongside where our existing yaml test are.

Comment thread provider/pkg/provider/provider.go Outdated
Comment thread examples/examples_yaml_test.go Outdated
@mikhailshilkov mikhailshilkov merged commit 9400ed0 into master Dec 13, 2024
@mikhailshilkov mikhailshilkov deleted the mikhailshilkov/autonaming-config branch December 13, 2024 16:47
@pulumi-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped in release v2.78.0.

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.

Implement autonaming configuration protocol

3 participants