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

Refactor WithRealmImport to accept file or directory #7121

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

paulomorgado
Copy link
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.
Aspire.lutconfig Outdated Show resolved Hide resolved
@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.
@@ -146,20 +146,26 @@ public static IResourceBuilder<KeycloakResource> WithDataBindMount(this IResourc
/// </example>
public static IResourceBuilder<KeycloakResource> WithRealmImport(
this IResourceBuilder<KeycloakResource> builder,
string importDirectory,
string import,
Copy link
Member

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

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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