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

DevTools: fixes and improvements calculating recommended combinations of extension origins #19003

Merged
merged 1 commit into from
Jul 26, 2021

Conversation

aloubyansky
Copy link
Member

These fixes are for use-cases involving multiple registries in the devtools config with extensions present in multiple registries and multiple catalogs.

These changes make sure non-platform extension catalogs are added once per registry and that the platform preference number is included into the calculation of an extension combination score when choosing the recommended one.

The existing tests were supposed to cover these use-cases but the registries in the tests appeared to be well-tuned (excluding all sorts of redundant extension and platform listing). Testing the current registry.quarkus.io in combination with some local registry config showed things could get pretty messy. I'll follow up with more tests.

… and include the platform preference into the calculation of an extension combination score when choosing one as the recommended one
@aloubyansky aloubyansky requested a review from gastaldi July 26, 2021 16:02
@quarkus-bot quarkus-bot bot added area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/platform Issues related to definition and interaction with Quarkus Platform labels Jul 26, 2021
for (OriginWithPreference o : s.getCollectedOrigins()) {
combinationScore += Math.pow(extOrigins.size(),
highestRegistryPreference + 1 - o.getPreference().registryPreference);
highestRegistryPreference + 1 - o.getPreference().registryPreference)
* ((double) (Integer.MAX_VALUE + 1 - o.getPreference().platformPreference) / Integer.MAX_VALUE);
Copy link
Contributor

Choose a reason for hiding this comment

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

That's some crazy 💩 going on here 😄

@aloubyansky aloubyansky merged commit 92bc841 into quarkusio:main Jul 26, 2021
@quarkus-bot quarkus-bot bot added this to the 2.2 - main milestone Jul 26, 2021
@gsmet gsmet modified the milestones: 2.2 - main, 2.1.1.Final Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/platform Issues related to definition and interaction with Quarkus Platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants