quarkusio / registry.quarkus.io

Quarkus Extension Registry application
https://registry.quarkus.io
Apache License 2.0
10 stars 11 forks source link

Expose an example config.yaml over the registry's REST api #197

Closed jmartisk closed 1 year ago

jmartisk commented 1 year ago

https://issues.redhat.com/browse/QUARKUS-3155

gastaldi commented 1 year ago

Nice, Can we have a test for that endpoint too?

jmartisk commented 1 year ago

I've added a test, please check, not sure what else it would make sense to verify

aloubyansky commented 1 year ago

I'd prefer the API, it should be easy to create a config object and serialize it. We made it easy for the files but I think the mappers are exposed through the API too.

maxandersen commented 1 year ago

not following what is the point of this end point?

the generated content is unnecessary in 99% of all usecases is it not?

aloubyansky commented 1 year ago

99% of all use-cases? :D

aloubyansky commented 1 year ago

We could introduce an option to enable this endpoint. It helps automate QE processes.

maxandersen commented 1 year ago

Just trying to grok when it QE need to specify all these Settings?

maxandersen commented 1 year ago

Just to be explicit:

In what scenario is it we prefer the registry config is using absolute explicit overrides like setting the maven url over using the derived value (meaning we don't test the usecase 99% of users use - just setting the registry id) ?

And then if I read this pr right this code will generate using the host name the service itself thinks it is running on rather than the necessary the host name users access it with ? That is normally considered a bad thing security wise that a service does that as it reveals details on the internal infrastructure which can be used to create attacks.

That's the context of my question.

If there are a need to generate sample configs with this full kind of info isn't it better done with a api or cli command ? And if really part of the service - have it use the actual user provided hostname setup?

aloubyansky commented 1 year ago

The user in this case would QE. Our staging/QE registries actually never had hosts derivable from registry IDs. The logic deriving config from registry ID is pretty much unit tested. Until now we had a single staging registry, however it's not scaling when testing multiple builds of the same stream. So now for every build we spin up a pre-configured registry instance, the URL of which will be included in a UMB message QE receives and triggers testing automatically. Adding this endpoint will help fetch the proper config to configure the client tools. It doesn't have to be enabled on registries running in production.

maxandersen commented 1 year ago

Sure - but still; why not just have a command/code separate from the registry that qe and others can adjust to what it needs separate from what build of the registry is used?

aloubyansky commented 1 year ago

Because it'd be probably the easiest way to get the config. Although not the only one.

jmartisk commented 1 year ago

Changes in my latest update:

gastaldi commented 1 year ago

Superseded by https://github.com/quarkusio/registry.quarkus.io/pull/201