Skip to content

Conversation

@vsevel
Copy link
Contributor

@vsevel vsevel commented Nov 5, 2024

Provides the ability to express additional presets in configuration
Fixes #1480
The current approach is to keep the default presets as a constant, and to allow defining more presets in configuration.
This allows appending presets to the existing one, and not just replace them.
If we want to move the PRESETS constant to configuration, then we would need 2 config variables presets and additional-presets.
see also this zulip thread.
cc @ia3andy

@ia3andy
Copy link
Collaborator

ia3andy commented Sep 12, 2025

@vsevel if you use your own implementation of code.quarkus, then you may now override some platform data (including presets).

@vsevel
Copy link
Contributor Author

vsevel commented Sep 12, 2025

I definitely want to try that. Any référence documentation available @ia3andy ?

@ia3andy
Copy link
Collaborator

ia3andy commented Sep 12, 2025

Not yet but you have this:
https://github.com/redhat-developer/code.quarkus.redhat.com/blob/main/src/main/java/OfferingPlatformOverride.java

@vsevel
Copy link
Contributor Author

vsevel commented Sep 16, 2025

I am confused. the ability to have custom presets is not directly supported in the community code quarkus app (which is what we are using today)?
we would have to create a new app like this code.quarkus.redhat.com? correct ?

@ia3andy
Copy link
Collaborator

ia3andy commented Sep 17, 2025

I am confused. the ability to have custom presets is not directly supported in the community code quarkus app (which is what we are using today)? we would have to create a new app like this code.quarkus.redhat.com? correct ?

Ok, I didn't remember if you where using the community image or your own custom.

We might be able to make it configurable in the community image like you did in this PR

@vsevel
Copy link
Contributor Author

vsevel commented Sep 17, 2025

We might be able to make it configurable in the community image like you did in this PR

that would be great

@ia3andy
Copy link
Collaborator

ia3andy commented Sep 17, 2025

@vsevel could you update your PR to make the list optional and replace the default in case it's present?

# Conflicts:
#	base/src/main/java/io/quarkus/code/rest/CodeQuarkusResource.java
@vsevel vsevel force-pushed the feature_additional_presets branch from cd22831 to 1feecd1 Compare September 18, 2025 09:16
@vsevel
Copy link
Contributor Author

vsevel commented Sep 18, 2025

make the list optional and replace the default in case it's present?

my intent was to append my presets, not replace the existing ones
WDYT?

I rebased and pushed

@vsevel
Copy link
Contributor Author

vsevel commented Sep 22, 2025

hello @ia3andy
I made the custom presets optional
and I added a config property to decide if we want to start with the default presets or empty

Copy link
Collaborator

@ia3andy ia3andy left a comment

Choose a reason for hiding this comment

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

Looks good!

@ia3andy ia3andy marked this pull request as ready for review September 22, 2025 15:19
@ia3andy ia3andy merged commit 14dff90 into quarkusio:main Sep 22, 2025
2 checks passed
@vsevel
Copy link
Contributor Author

vsevel commented Sep 23, 2025

we have deployed the last released image, and I can confirm custom presets work as expected.
tested with:

        - '-Dio.quarkus.code.custom-presets[0].key=x'
        - '-Dio.quarkus.code.custom-presets[0].title=X'
        - '-Dio.quarkus.code.custom-presets[0].icon=https://raw.githubusercontent.com/quarkusio/code.quarkus.io/main/base/assets/icons/presets/rest_neg.svg'
        - '-Dio.quarkus.code.custom-presets[0].extensions=io.quarkus:quarkus-rest,io.quarkus:quarkus-config-yaml,com.x.quarkus:x-ext1,com.x.quarkus:x-ext2'

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.

Configure presets externally

2 participants