Repository navigation
[Automated] Update API Surface Area (release/17.0) - #22185
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22185Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22185" |
Eric Erhardt (eerhardt)
left a comment
There was a problem hiding this comment.
API review findings — see inline comments for details.
API Review Summary2 errors, 10 warnings, 4 info across 9 files. Top areas of concern:
Promotions to confirm ( Each finding is posted as a separate inline comment for discussion. |
0498023 to
3c99d22
Compare
## Description Addresses the API review feedback in #22185 (comment): resource traits are a new concept on stable `Aspire.Hosting` in 17.0, trait names are free-form strings, and the reserved names that get special handling (such as the tag trait) are still internal. This marks the trait APIs experimental so the shape can still change once well-known traits are designed. New diagnostic: `ASPIRERESOURCETRAITS001` (docs link `https://aka.ms/aspire/diagnostics/ASPIRERESOURCETRAITS001`). Marked `[Experimental]`: - `ResourceTraitBuilderExtensions.WithTrait` - `ResourceTraitBuilderExtensions.WithTags`, including the internal `withTags` polyglot adapter - `ResourceTraitBuilderExtensions.WithDisplayOrder` (this replaced `WithDashboardPosition` in release/17.0) - `TraitAnnotation` - `DisplayOrderAnnotation` The attribute is applied to each member, not to the extension class. `[Experimental]` on a type is only reported where the type name appears, and extension-method calls such as `builder.WithTags(...)` never name the containing class, so a class-level attribute would not warn C# callers. Other changes: - The generated TypeScript and Go SDKs now mark `withTrait`, `withTags` and `withDisplayOrder` as experimental, so their snapshots were updated. - `docs/list-of-diagnostics.md` lists the new ID. - The internal snapshot code, `Aspire.Hosting.Tests` and the TestShop playground suppress the new diagnostic. Making `ResourceTypeDisplayNameAnnotation` internal, the other API review comment, is handled separately in #22205. Follow-up: add the aka.ms redirect and an aspire.dev diagnostics page for `ASPIRERESOURCETRAITS001`. ## Validation - `Aspire.Hosting.Tests`: `ResourceTraitBuilderTests`, `ResourceNotificationTests`, `DashboardServiceDataTerminalTests` pass. - `Aspire.Hosting.CodeGeneration.{TypeScript,Go,Java,Python,Rust}.Tests` pass. - `Aspire.Dashboard.Tests`, `Aspire.Cli.Tests` and `TestShop.AppHost` build. --------- Co-authored-by: Sébastien Ros <[email protected]> Co-authored-by: Copilot App <[email protected]>
## Description Addresses API review feedback on the 17.0 API surface from #22185, so the new APIs ship with their final shape in 17.0. Changes: - **Legacy `AddProject` overloads** ([r4552196643](#22185 (comment))): the `[Obsolete]` messages are clearer and point users to the replacement API. - **Parameter optionality** ([r4552196666](#22185 (comment))): - `WithOptional`/`WithRequired` are replaced with parameterless `AsOptional()`/`AsRequired()` methods. - The `ParameterResource.Required` setter is now internal. - **Entra ID** ([r4552196738](#22185 (comment))): `AddExistingEntraApplication` is renamed to `AddExistingEntraIdApplication`. - **OpenAI client builders** ([r4552196760](#22185 (comment))): the OpenAI and Azure OpenAI client builders take `disableMetrics` as a constructor parameter. - **Diagnostic IDs** ([r4552196701](#22185 (comment))): `ASPIREAZURE003` is meant for networking APIs. Four non-networking experimental Azure APIs that used it now have their own IDs: - `AzureResourceInfrastructure.BicepExtensions` uses `ASPIREAZURE004`. - `IBicepOutputReferenceProvider` uses `ASPIREAZURE005`. - `ManagedIdentityRequiredAnnotation` uses `ASPIREAZURE006`. - `TenantScopedResourceAnnotation` uses `ASPIREAZURE007`. Pages for the new IDs still need to be added to aspire.dev. Callers, tests, snapshots, READMEs, the playground and the polyglot apphosts are updated to match. The generated API files are not edited. Not addressed: - The nullable string feedback ([r4552196649](#22185 (comment))) is tracked in #22211. - The SqlServer `WithRepl` feedback ([r4552196716](#22185 (comment))) is left unchanged. ### Validation These targeted test runs passed (`dotnet test --project <proj> --no-launch-profile -- --filter-class ... --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"`): - **`Aspire.Hosting.Azure.Tests`:** the affected classes passed 237/237. - **`Aspire.Hosting.Azure.EntraId.Tests`:** 694/694 passed. - **Parameter, OpenAI and other affected test classes:** passed, with snapshots updated. These were not validated locally: - **`MSBuildTests`:** some fail locally and were skipped. - **Java polyglot apphosts:** `javac` is unavailable locally, so they were not compiled. Fixes # (issue) ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [x] Yes - If yes, did you have an API Review for it? - [x] Yes - [ ] No - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [ ] Yes - [x] No - [ ] No - Does the change make any security assumptions or guarantees? - [ ] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [ ] No - [x] No --------- Co-authored-by: Copilot App <[email protected]>
…splay name setter internal (#22205) ## Description This PR addresses the API review feedback on the automated API surface update in #22185 (comment). Since 13.6.5, there are four new ways to set the resource type display name: - the virtual `Resource.ResourceTypeDisplayName` property - `ResourceTypeDisplayNameAnnotation` - `WithResourceTypeDisplayName` - the `init` setter on `CustomResourceSnapshot.ResourceTypeDisplayName` The virtual property sets the label for a resource type, and `WithResourceTypeDisplayName` sets it for one resource. Together they cover every case, so this PR makes the other two internal: - `ResourceTypeDisplayNameAnnotation` is now `internal`. It is how `WithResourceTypeDisplayName` stores the value. Its empty-value check was removed because the extension method already rejects empty values, and it is the only place that creates the annotation. - `CustomResourceSnapshot.ResourceTypeDisplayName` stays public to read, but its setter is now `internal init`. Only `ResourceNotificationService` sets it, using the annotation or the virtual property. The order the label is chosen in does not change. No code outside `Aspire.Hosting` creates the annotation or sets the snapshot value. The generated polyglot code only calls `WithResourceTypeDisplayName`, so code-generation snapshots do not change. The `api/*.cs` files are generated, so this PR does not edit them. The next automated API update will drop both members from the diff. `main` still has both members public, so it needs a forward-port. ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [ ] Yes - [x] No. Existing `ResourceNotificationTests`, `AuxiliaryBackchannelRpcTargetTests` and `ResourcePublisherTests` cover the behavior. This PR removes one assertion that built the annotation directly. - Did you add public API? - [ ] Yes - [x] No. This PR removes public API that has not shipped yet. - Does the change make any security assumptions or guarantees? - [ ] Yes - [x] No Co-authored-by: Sébastien Ros <[email protected]>
72d9797 to
4b4e2c1
Compare
4b4e2c1 to
9d787e8
Compare
9d787e8 to
8eb7f25
Compare
8eb7f25 to
6c4f1fe
Compare
5019f6b
into
release/17.0
|
✅ No documentation update needed. Branch: proven false positive (not an allowlist category). The PR is an automated bot update to the generated |
Auto-generated update to the API surface to compare current surface vs latest release. This should only be merged once this surface area ships in a new release.