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

Fix UnsupportedOperationException from OperationBuilders #27

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

timothyjward
Copy link
Contributor

When registering artifact repositories with an Operation Builder the user gets an UnsupportedOperationException if the builder is using default repositories. Furthermore, setting useDefaultRepositories causes any previously registered repositories to be lost. This should be fixed to ensure that no registered repositories are lost, and that default repositories are only used if enabled and not overriden in the builder.

When registering artifact repositories with an Operation Builder the user gets an UnsupportedOperationException if the builder is using default repositories. Furthermore, setting useDefaultRepositories causes any previously registered repositories to be lost. This should be fixed to ensure that no registered repositories are lost, and that default repositories are only used if enabled and not overriden in the builder.

Signed-off-by: Tim Ward <timothyjward@apache.org>
@timothyjward
Copy link
Contributor Author

@ideas-into-software - I bumped into this while writing my demo. I updated one of the integration tests to trigger the failure, then fixed it. The fix was small so hopefully is not disruptive.

Copy link
Contributor

@ideas-into-software ideas-into-software left a comment

Choose a reason for hiding this comment

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

This is how I understood specification for this particular part, i.e. if useDefaultRepositories is set to true - and by default, as per spec, this was supposed to be set to true - default repositories are to be used, which to me implied user will not be adding any other repositories, and only if useDefaultRepositories was set to false would custom repositories be added ( hence maybeResetDefaultRepositories method in FeatureRuntimeImpl, etc. ).

You know your intent much better than I do, but this is just to clarify my understanding of spec and why this was implemented this way - this understanding is also reflected in test cases defined in FeatureRuntimeIntegrationTest.

@timothyjward timothyjward merged commit 29d5570 into main Oct 16, 2024
1 check passed
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.

2 participants