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

chore(model): Avoid a Hoplite deprecation warning #9283

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sschuberth
Copy link
Member

This avoids the console output of:

"Hoplite is configured to infer which sealed type to choose by inspecting the config values at runtime. This behaviour is now deprecated in favour of explicitly specifying the type through a discriminator field. In 3.0 this new behavior will become the default. To enable this behavior now (and disable this warning), invoke withExplicitSealedTypes() on the ConfigLoaderBuilder."

This avoids the console output of:

"Hoplite is configured to infer which sealed type to choose by inspecting
the config values at runtime. This behaviour is now deprecated in favour
of explicitly specifying the type through a discriminator field. In 3.0
this new behavior will become the default. To enable this behavior now
(and disable this warning), invoke withExplicitSealedTypes() on the
ConfigLoaderBuilder."

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
@sschuberth sschuberth requested a review from a team as a code owner October 15, 2024 13:33
@sschuberth sschuberth enabled auto-merge (rebase) October 15, 2024 13:34
@sschuberth sschuberth marked this pull request as draft October 15, 2024 13:47
auto-merge was automatically disabled October 15, 2024 13:47

Pull request was converted to draft

@sschuberth
Copy link
Member Author

This change causes

Invalid discriminator field to select sealed subtype. Must specify _type to be a valid subtype of org.ossreviewtoolkit.model.config.ScanStorageConfiguration.

when deserializing reference.yml, but I guess having to explicitly mention the _type is not an option for us... what do you think @mnonnenmacher?

@@ -174,6 +176,7 @@ data class OrtConfiguration(
.addEnvironmentSource()
.addPropertySources(sources)
.withContextResolverMode(ContextResolverMode.SkipUnresolved)
.withExplicitSealedTypes()
Copy link
Member

Choose a reason for hiding this comment

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

I think the ScanStorageConfiguration is the only sealed class we use in the config, but I don't think that we use discriminator fields there. I'm not sure if this is properly tested.

@mnonnenmacher
Copy link
Member

This change causes

Invalid discriminator field to select sealed subtype. Must specify _type to be a valid subtype of org.ossreviewtoolkit.model.config.ScanStorageConfiguration.

when deserializing reference.yml, but I guess having to explicitly mention the _type is not an option for us... what do you think @mnonnenmacher?

No, we should not introduce this in the config. I think we have to wait until I finally find time for #6603.

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