Skip to content

Refactor WithRealmImport to accept file or directory#7121

Merged
davidfowl merged 3 commits intomicrosoft:mainfrom
paulomorgado:Keycloak-WithRealmImport
Jan 19, 2025
Merged

Refactor WithRealmImport to accept file or directory#7121
davidfowl merged 3 commits intomicrosoft:mainfrom
paulomorgado:Keycloak-WithRealmImport

Conversation

@paulomorgado
Copy link
Copy Markdown
Contributor

@paulomorgado paulomorgado commented Jan 15, 2025

Description

Updated the WithRealmImport method to change the parameter name from importDirectory to import, allowing it to accept either a directory or a single import file. Adjusted the method logic to handle both cases and updated the XML documentation for clarity.

Fixes #5086

/cc @davidfowl @DamianEdwards

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • 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
    • No
  • Does the change require an update in our Aspire docs?

Updated the `WithRealmImport` method to change the parameter name from `importDirectory` to `import`, allowing it to accept either a directory or a single import file. Adjusted the method logic to handle both cases and updated the XML documentation for clarity.
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jan 15, 2025
@paulomorgado paulomorgado marked this pull request as ready for review January 16, 2025 10:24
Updated `WithRealmImportShouldThrowWhenBuilderIsNull` test
to check for null import instead of import directory, and
changed the expected exception type for non-existent imports.
Added a new configuration section in `Aspire.lutconfig`
to enable parallel builds, parallel test runs, and set a
test case timeout of 180 seconds.
Comment thread Aspire.lutconfig Outdated
Comment thread tests/Aspire.Hosting.Keycloak.Tests/KeycloakPublicApiTests.cs
@dotnet-policy-service dotnet-policy-service Bot added needs-author-action An issue or pull request that requires more info or actions from the author. and removed needs-author-action An issue or pull request that requires more info or actions from the author. labels Jan 18, 2025
Removed obsolete configuration from Aspire.lutconfig.
Added new parameterized tests in KeycloakPublicApiTests.cs
for realm import functionality with directory and file inputs.
Removed the outdated WithRealmImportAddsBindMountAnnotation
test from KeycloakResourceBuilderTests.cs.
public static IResourceBuilder<KeycloakResource> WithRealmImport(
this IResourceBuilder<KeycloakResource> builder,
string importDirectory,
string import,
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.

This is a breaking change if you use named parameters but this package is preview so care level is low 😄

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a breaking change if you use named parameters but this package is preview so care level is low 😄

Yes and yes. But I couldn't keep importDirectory when the semantics has changed.

@davidfowl
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@davidfowl davidfowl merged commit 38c4010 into microsoft:main Jan 19, 2025
@paulomorgado paulomorgado deleted the Keycloak-WithRealmImport branch January 20, 2025 08:47
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 19, 2025
@github-actions github-actions Bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Mar 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KeycloakResourceBuilderExtensions.WithRealmImport is unnecessarily constraining the bind to a directory

3 participants