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

Qute templates needs a "no restart" config to avoid auto-reload in dev-mode #36692

Closed
mr-mos opened this issue Oct 25, 2023 · 27 comments · Fixed by #36745
Closed

Qute templates needs a "no restart" config to avoid auto-reload in dev-mode #36692

mr-mos opened this issue Oct 25, 2023 · 27 comments · Fixed by #36745
Labels
area/devmode area/qute The template engine kind/enhancement New feature or request
Milestone

Comments

@mr-mos
Copy link

mr-mos commented Oct 25, 2023

Description

As discussed with @mkouba here: #36670

Whenever a Qute/HTML template is modified the whole application is reloaded when doing the browser-refresh. That takes a little time and -- even more annoying -- deletes all session/cookie data....
From other frameworks, like Grails, template changes would apply without restarting the application.

We should add a config option that would allow users to define the "development safe" templates, i.e. templates that do not require app restart... it's not perfect but might come in handy.

Implementation ideas

No response

@mr-mos mr-mos added the kind/enhancement New feature or request label Oct 25, 2023
@quarkus-bot quarkus-bot bot added area/devmode area/qute The template engine labels Oct 25, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 25, 2023

/cc @mkouba (qute)

@maxandersen
Copy link
Member

Let's say we add a regular expression that let users say some templates don't need restart.

What will then happen if an expression has been edited that changes behavior ?

Will it fail and user has to manually restart or what do we expect ?

Could we detect it and trigger reload anyway? And then even make that default for all?

@mr-mos
Copy link
Author

mr-mos commented Oct 26, 2023

The final goal would be to detect the changes that need reloads and do it automatically. (Similar to Quarkus quarkus.live-reload.instrumentation=true config).

For the time being it would be great to add a config like quarkus.qute.dev.disable-reload=true. This would disable reloads for all templates completely. A warning should be logged, every time a reload would be triggert.

@mkouba
Copy link
Contributor

mkouba commented Oct 26, 2023

Let's say we add a regular expression that let users say some templates don't need restart.

What will then happen if an expression has been edited that changes behavior ?

Will it fail and user has to manually restart or what do we expect ?

Well, the restart is needed in order to trigger validation. If we skip the validation then the rendering should fail at runtime. The error message should be still actionable though.

Could we detect it and trigger reload anyway? And then even make that default for all?

I'm not sure if that's feasible. First, we would need to parse the changed template and probably also analyze the existing template etc. Furthermore, it seems that the HotReplacementContext SPI does not make it possible to trigger a forced-restart yet.

@mkouba
Copy link
Contributor

mkouba commented Oct 26, 2023

For the time being it would be great to add a config like quarkus.qute.dev.disable-reload=true. This would disable reloads for all templates completely. A warning should be logged, every time a reload would be triggert.

Hm, I don't think it should disable the functionality for all templates. I mean the idea of a reg exp is more flexible IMO.

@mr-mos
Copy link
Author

mr-mos commented Oct 27, 2023

Thanks @mkouba . That was very quickly. :)

mkouba added a commit to mkouba/quarkus that referenced this issue Oct 30, 2023
@quarkus-bot quarkus-bot bot added this to the 3.6 - main milestone Oct 30, 2023
DavideD pushed a commit to DavideD/quarkus that referenced this issue Oct 31, 2023
chetankokil added a commit to chetankokil/quarkus that referenced this issue Nov 3, 2023
* Use MongoDB 4.4 consistently

* Fix handling of HTTP/2 H2 empty frames in Resteasy Reactive

Closes quarkusio#36604

* Bump com.google.api.grpc:proto-google-common-protos

Bumps [com.google.api.grpc:proto-google-common-protos](https://github.com/googleapis/sdk-platform-java) from 2.23.0 to 2.27.0.
- [Release notes](https://github.com/googleapis/sdk-platform-java/releases)
- [Changelog](https://github.com/googleapis/sdk-platform-java/blob/main/CHANGELOG.md)
- [Commits](googleapis/sdk-platform-java@v2.23.0...v2.27.0)

---
updated-dependencies:
- dependency-name: com.google.api.grpc:proto-google-common-protos
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Add a custom OIDC identity provider test

* Updates Liquibase integrationtest to reproduce error: quarkusio#36446

* Fix zlib broken link

* Reverts changes made to workaround liquibase issue: liquibase/liquibase#4763 since we've updated to liquibase 4.24.0

* Fix version reporting and parsing

Quarkus currently only parses the feature and update version of JDK and
incorrectly prints message like:

```
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on MANDREL 22.3.3.1 JDK 17.8
```

while it should be

```
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on MANDREL 22.3.3.1 JDK 17.0.8
```

i.e. 17.0.8 vs 17.8

This change fixes that issue and relies on java.lang.Runtime.Version for
parsing and comparing the JDK version.

Follow up to quarkusio#36267

* Make sure OIDC/GraphQL client integration runs after client config is initialized, get rid of config merger bean

* Fix termination of the fallback virtual thread executor

* Stork observability integration

* Move HTTP CORS section to a new security-cors.adoc

* Add security-cors.adoc to the downstreamdoc.yaml

* QuarkusTest: handle beans declared on test profile specifically

- beans declared on a test profile implementation are only taken into
account if the test profile is used
- resolves quarkusio#36554

* Fix gRPC context propagation.

* Make the ZSTD Substitutions more robust

* Remove the pinned event example from the documentation

* Use container urls for connecting to services by default

It is better for the build cache and for local testing, nowadays, there
is a good chance people will use containers anyway.

* Update gRPC Protoc to version 3.24.4 and the generator to 1.59.0

- Add move architecture to cover ppcle64 and s390x
- Update code to handle deprecation and removed API

* Use GRADLE_JAVA_HOME in CI and test Java 21

* Remove more Docker images

* Indicate that Java 21 is supported

* Remove additional stuff before starting CI

* Remove --enable-preview from virtual-threads ITs

We are now using Java 21 so we don't need the flag anymore.

* Add a ci-disk-usage.sh script

* Skip Scala 2 tests on Java 21+

* Make RegisterForReflectionTestCase#testLambdaCapturing compatible with Java 21

* Higher Xmx for Java 21 testing

* Deprecate the scala extension

- https://github.com/quarkiverse/quarkus-scala3 should be preferred instead

* Codestarts: Add Entity annotation to Kotlin all-open

* QuarkusSecurityTestExtension afterEach call should not be made for tests without @testsecurity

* Introduce OidcClientRequestFilter

* Bump org.jboss.threads:jboss-threads from 3.5.0.Final to 3.5.1.Final

Bumps [org.jboss.threads:jboss-threads](https://github.com/jbossas/jboss-threads) from 3.5.0.Final to 3.5.1.Final.
- [Commits](jbossas/jboss-threads@3.5.0.Final...3.5.1.Final)

---
updated-dependencies:
- dependency-name: org.jboss.threads:jboss-threads
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump jacoco.version from 0.8.10 to 0.8.11

Bumps `jacoco.version` from 0.8.10 to 0.8.11.

Updates `org.jacoco:org.jacoco.core` from 0.8.10 to 0.8.11
- [Release notes](https://github.com/jacoco/jacoco/releases)
- [Commits](jacoco/jacoco@v0.8.10...v0.8.11)

Updates `org.jacoco:org.jacoco.report` from 0.8.10 to 0.8.11
- [Release notes](https://github.com/jacoco/jacoco/releases)
- [Commits](jacoco/jacoco@v0.8.10...v0.8.11)

Updates `org.jacoco:org.jacoco.agent` from 0.8.10 to 0.8.11
- [Release notes](https://github.com/jacoco/jacoco/releases)
- [Commits](jacoco/jacoco@v0.8.10...v0.8.11)

Updates `org.jacoco:jacoco-maven-plugin` from 0.8.10 to 0.8.11
- [Release notes](https://github.com/jacoco/jacoco/releases)
- [Commits](jacoco/jacoco@v0.8.10...v0.8.11)

---
updated-dependencies:
- dependency-name: org.jacoco:org.jacoco.core
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jacoco:org.jacoco.report
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jacoco:org.jacoco.agent
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jacoco:jacoco-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Dev UI: Fix height in Rest Client

Signed-off-by: Phillip Kruger <[email protected]>

* Disable CDI TCK ManagedBeanTypesTest for now

This test is not compatible with Java 21.

See jakartaee/cdi-tck#485

* Reinitialized the com.google.protobuf.UnsafeUtil class at runtime

Also fix the Unsafe accessor.
Fix quarkusio#30293.

This has been tested on GraalVM CE and EE.

* Revert "Bump io.strimzi:kafka-oauth-client from 0.12.0 to 0.14.0"

This reverts commit 09a13e6.

* Add a warning for how to report security vulnerability

* add JBang script to analyze our CI raw logs

* Small additional features to ModuleBuildDurationReport.java

* Some additional improvements and fixes

* More readable module names

* Add auth mechanism to the Liquibase MongoDB connection string

* Fix missing import probably due to asynchronous PRs

* Disable VertxMDCTest on Windows

It has been extremely unstable for weeks now. Let's disable it until we
have time to fix it.

* Take @ConstrainedTo into account for interceptors

Without this change interceptors meant to be
used on the client were being used on the
server as well

* Rename tooling codestarts

* ArC: introduce optimized contexts

- introduce the ContextInstances abstraction
- if optimization is enabled then generate the ContextInstances
  implementation for application and request context

* ⬆️ Update Gitpod configuration with Java 17

* CORS content review

Signed-off-by: Michal Maléř <[email protected]>

* ArC: optimize client proxy delegate access

- for normal scopes for which a single context is registered
- similar to how we optimize the client proxy delegate access for
application context

* Fix update on extensions

* Remove a duplicate dependency from Micrometer extension

* Avoid relying on Docker for Stork tests

We don't need the Redis Dev Services so let's not start them.

* Update the content for RHBQ docs.

* Bump io.smallrye.reactive:smallrye-mutiny-vertx-core from 3.6.0 to 3.7.2

Bumps io.smallrye.reactive:smallrye-mutiny-vertx-core from 3.6.0 to 3.7.2.

---
updated-dependencies:
- dependency-name: io.smallrye.reactive:smallrye-mutiny-vertx-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Document gRPC code generation

Also:

- Allows configuring the `proto` directory (quarkusio#12802)
- Provides Gradle snippets (quarkusio#33854)

* Bump asm.version from 9.5 to 9.6

Bumps `asm.version` from 9.5 to 9.6.

Updates `org.ow2.asm:asm` from 9.5 to 9.6

Updates `org.ow2.asm:asm-commons` from 9.5 to 9.6

Updates `org.ow2.asm:asm-tree` from 9.5 to 9.6

Updates `org.ow2.asm:asm-analysis` from 9.5 to 9.6

Updates `org.ow2.asm:asm-util` from 9.5 to 9.6

---
updated-dependencies:
- dependency-name: org.ow2.asm:asm
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.ow2.asm:asm-commons
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.ow2.asm:asm-tree
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.ow2.asm:asm-analysis
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.ow2.asm:asm-util
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Vert.x: fix NPE in ForwardedProxyHandler

The test `TrustedXForwarderProxiesUnknownHostnameFailureTest` sometimes fail
in CI due to a NPE in `ForwardedProxyHandler`. This shows an actual bug:
per the documentation, `io.vertx.core.dns.DnsClient.lookup()` may succeed
with a `null` value when no record was found. The `ForwardedProxyHandler`
ignores the possibility of a `null` result, which this commit fixes. We deal
with a `null` result just like with a failure, because it's equivalent
to a NXDOMAIN error.

* Arc - change hashing function to use base64 to shorten resulting String

* Try to stabilize PausedSchedulerTest

Let's give things a bit more time as CI is slow.

* HTTP and RestEasy-related content review

resteasy.adoc sanity check

Signed-off-by: Michal Maléř <[email protected]>

* Indicate that 2.x is not supported anymore

* Bump Keycloak version to 22.0.5

* Disable MySQL OIDC DB token manager test due to limited Github CI resources

* Bump org.yaml:snakeyaml from 2.1 to 2.2

Bumps [org.yaml:snakeyaml](https://bitbucket.org/snakeyaml/snakeyaml) from 2.1 to 2.2.
- [Commits](https://bitbucket.org/snakeyaml/snakeyaml/branches/compare/snakeyaml-2.2..snakeyaml-2.1)

---
updated-dependencies:
- dependency-name: org.yaml:snakeyaml
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Make Maven ITs less fragile

Enforcing versions of the plugins make sure we don't start downloading
them when running the tests which can lead to timeouts.
Also it makes the build more stable and actually tests the version we
are using when creating new projects.

* Not pushing compile in the command actually fixes this test

When running mvn compile quarkus:dev, compile is not executed when
restarting dev mode after the pom change. Not specifying compile makes
the compile goal to be run.

* Try to stabilize the tests on Windows

* Disable JarRunnerIT#testNonAsciiDir on Windows

With maven-compiler-plugin 2.11.0, this test is not working anymore
on Windows:
Error while storing the mojo status: Input length = 1

* Enable errors in Maven RunningInvoker

We need to see the details of the errors when something is going wrong.

* Disable DevMojoIT#testExternalReloadableArtifacts on Windows

Installing the lib jar a second time leads to an access denied exception
on Windows, probably because the jar is still used by the dev mode
instance.

* refactor BuildChainBuilder

* Move KeycloakContainer to keycloak-server test-framework

Create realm by posting to Keycloak admin API

* Bump io.strimzi:kafka-oauth-client from 0.12.0 to 0.14.0

* Fixes for Kafka and Pulsar schema discovery

* Bump elasticsearch-opensource-components.version from 8.10.2 to 8.10.4

Bumps `elasticsearch-opensource-components.version` from 8.10.2 to 8.10.4.

Updates `org.elasticsearch.client:elasticsearch-rest-client` from 8.10.2 to 8.10.4
- [Release notes](https://github.com/elastic/elasticsearch/releases)
- [Changelog](https://github.com/elastic/elasticsearch/blob/main/CHANGELOG.md)
- [Commits](elastic/elasticsearch@v8.10.2...v8.10.4)

Updates `co.elastic.clients:elasticsearch-java` from 8.10.2 to 8.10.4
- [Release notes](https://github.com/elastic/elasticsearch-java/releases)
- [Changelog](https://github.com/elastic/elasticsearch-java/blob/main/CHANGELOG.md)
- [Commits](elastic/elasticsearch-java@v8.10.2...v8.10.4)

Updates `org.elasticsearch.client:elasticsearch-rest-client-sniffer` from 8.10.2 to 8.10.4
- [Release notes](https://github.com/elastic/elasticsearch/releases)
- [Changelog](https://github.com/elastic/elasticsearch/blob/main/CHANGELOG.md)
- [Commits](elastic/elasticsearch@v8.10.2...v8.10.4)

---
updated-dependencies:
- dependency-name: org.elasticsearch.client:elasticsearch-rest-client
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: co.elastic.clients:elasticsearch-java
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.elasticsearch.client:elasticsearch-rest-client-sniffer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump flyway.version from 9.22.2 to 9.22.3

Bumps `flyway.version` from 9.22.2 to 9.22.3.

Updates `org.flywaydb:flyway-core` from 9.22.2 to 9.22.3
- [Release notes](https://github.com/flyway/flyway/releases)
- [Commits](flyway/flyway@flyway-9.22.2...flyway-9.22.3)

Updates `org.flywaydb:flyway-sqlserver` from 9.22.2 to 9.22.3
- [Release notes](https://github.com/flyway/flyway/releases)
- [Commits](flyway/flyway@flyway-9.22.2...flyway-9.22.3)

Updates `org.flywaydb:flyway-mysql` from 9.22.2 to 9.22.3
- [Release notes](https://github.com/flyway/flyway/releases)
- [Commits](flyway/flyway@flyway-9.22.2...flyway-9.22.3)

Updates `org.flywaydb:flyway-database-oracle` from 9.22.2 to 9.22.3
- [Release notes](https://github.com/flyway/flyway/releases)
- [Commits](flyway/flyway@flyway-9.22.2...flyway-9.22.3)

---
updated-dependencies:
- dependency-name: org.flywaydb:flyway-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.flywaydb:flyway-sqlserver
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.flywaydb:flyway-mysql
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.flywaydb:flyway-database-oracle
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump io.micrometer:micrometer-bom from 1.11.1 to 1.11.5

Bumps [io.micrometer:micrometer-bom](https://github.com/micrometer-metrics/micrometer) from 1.11.1 to 1.11.5.
- [Release notes](https://github.com/micrometer-metrics/micrometer/releases)
- [Commits](micrometer-metrics/micrometer@v1.11.1...v1.11.5)

---
updated-dependencies:
- dependency-name: io.micrometer:micrometer-bom
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Make it possible to acquire OIDC SecurityIdentity after HTTP request has completed

* Clarify why QuarkusClassLoader doesn't pass its name to the super constructor

* Enrich classloader names with the name of the application/QuarkusUnitTest

* Fix a suspicious H2 URL in Hibernate ORM test config

It doesn't matter in practice since the only test using this config
reproduces a startup failure that happens before we start H2;
but still, let's fix this for correctness.

* Always reset the ForkJoinPool TCCL on startup

* Safer, slightly simpler register/release patterns for config

Some config was lazily created and bound to the dev class loader
through the configsForClassLoader map
io.smallrye.config.SmallRyeConfigProviderResolver#getConfig(java.lang.ClassLoader),
and the corresponding map entry was never cleared,
resulting in the corresponding classloader never being garbage
collected.

* Avoid referencing ClassLoaders in ProtectionDomains

This removes a whole class of metaspace leaks caused by
Thread.inheritedAccessControlContext referencing ProtectionDomains which
reference older classloaders.

Of course this may have impacts on how the SecurityManager behaves, but
as I understand it, absolutely no part of Quarkus is ready to run with a
SecurityManager enabled anyway.

* Improve error messages on KafkaDevServicesDevModeTestCase failures

* Plug leak in tests relying on lazily-initialized config

Since a previous commit, we now remember the lazily-created config in
QuarkusConfigFactory, which is good because in dev mode it allows us to
release it upon restart (when we call setConfig(null)).

However, in *tests* that rely on this lazily initialized config, just
calling releaseConfig(ConfigProvider.getConfig()) is no longer enough,
because of that remembered config in QuarkusConfigFactory: we need to
reset that reference too.

If we forget to reset it, then when KafkaDevServicesDevModeTestCase
will execute, TestHTTPResourceManager#getUri will retrieve the leaked
config from DefaultSerdeConfigTest or DefaultSchemaConfigTest,
the injected URI in KafkaDevServicesDevModeTestCase will be wrong,
and the test will fail (with very unhelpful error messages).

* Stronger safeguards against leaked config in internal Quarkus*Test extensions

If someone calls ConfigProvider.getConfig() out of the blue in a test
that doesn't use any Quarkus*Test extension, this will call
QuarkusConfigFactory and leak config in two ways:

1. In QuarkusConfigFactory#config
2. In SmallRyeConfigProviderResolver, registering config for the TCCL,
   which in such a case is most likely the system CL.

A well-behaved test would call QuarkusConfigFactory.setConfig(null) to
clean up all that, but it's easy to miss and there is potential for
ConfigProvider.getConfig() being called indirectly, so there's no way we
can guarantee all tests are well-behaved.

This should at least guarantee that after a badly behaving test
executes, the next test using a Quarkus*Test extension will clean up the
mess.

* More comprehensive registration/release of config in some tests

If someone calls ConfigProvider.getConfig() out of the blue in a test
that doesn't use any Quarkus*Test extension, this will indirectly call
QuarkusConfigFactory and leak config in two ways:

1. In QuarkusConfigFactory#config
2. In SmallRyeConfigProviderResolver, registering config for the TCCL,
   which in such a case is most likely the system CL.

Thus, a well-behaved test should call QuarkusConfigFactory.setConfig(null)
to clean up all that, no just SmallRyeConfigProviderResolver.releaseConfig().

Similarly, tests that register configuration explicitly can just call
QuarkusConfigFactory.setConfig(config) at the beginning and
QuarkusConfigFactory.setConfig(null) at the end,
which will properly simulate how a real Quarkus application behaves,
and should cover all edge cases involving multiple classloaders,
properly cleaning up everything at the end of the test.

* Merge test-related ConfigUtils into a single class

* Maven CLI: use recipes for platform extensions

* Raise FileSystemWatcherTestCase wait times

Consecutive to:
https://github.com/quarkusio/quarkus/runs/18068790284

* Improve error messages when an @Embedded type is not annotated with @embeddable

* Strimzi OAuth substitutions

* Changes to support jaeger remote sampler

* Ignore bridge methods when checking for @embeddable annotation on @Embedded/@EmbeddedId

* enable use layer 7 proxy for reactive pg client

* Remove type from ResolverMapKey

* Update OpenSearch container test configuration

- Limit OpenSearch memory usage
- Disable disk-based shard allocation thresholds

* Fix grpc-generation-reference.adoc

It was missing the header, not including the attributes and not using
the right syntax for subs=attributes+ leading to all sorts of rendering
issues.

* Fix a broken reference in grpc-getting-started.adoc

* docs: how to store secrets locally

Handy guide on how to deal with local secrets, SEO friendly.

* Add to Security JPA support for named persistence units

* Bump jaxb-runtime.version from 4.0.3 to 4.0.4

Bumps `jaxb-runtime.version` from 4.0.3 to 4.0.4.

Updates `org.glassfish.jaxb:jaxb-runtime` from 4.0.3 to 4.0.4

Updates `org.glassfish.jaxb:jaxb-core` from 4.0.3 to 4.0.4

Updates `org.glassfish.jaxb:txw2` from 4.0.3 to 4.0.4

---
updated-dependencies:
- dependency-name: org.glassfish.jaxb:jaxb-runtime
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.glassfish.jaxb:jaxb-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.glassfish.jaxb:txw2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Fix sockjs documentation

* ArC: improve how single-context normal scopes are found

* Disable Http2RSTFloodProtectionTest on Windows

* Fix typo in reactive-event-bus.adoc

* Validate Startup observers are not secured with RBAC annotations

* Cleanup codestarter tests

- Remove unnecessary modifiers
- Unify line-breaks
- Unify indentation

* Make contextResolverMap used for both reader and writer

* Update virtual thread documentation to Java 21

* Add a description to the Stork extension metadata

* Kc Admin Cl.:Fix typo that allows using customized ObjectMapper

* Bump apicurio-registry.version from 2.4.7.Final to 2.4.14.Final

* Kafka Confluent avro schema serializer doc update

Resolves quarkusio#36372

* Qute: dev mode - add config to skip restart for some templates

- resolves quarkusio#36692

* Maven CLI: add wildcard matching into recipes detection

* Recommend GraalVM CE

* Fix missing section in the gRPC getting started guide

* Security JPA: support Hibernate multitenancy

* Exclude resteasy-client from lra-proxy-api in narayana-lra extension

* Add jvmArgs option to Quarkus Gradle plugin task quarkusRun

* added discord as know oidc provider

added unittest for merging discord oidc properties

* Quarkus code-gen (Gradle): Fix behavior to filter unavailable services

Java Services (those in `META-INF/services/*` files) that are defined in the (Gradle) project that uses the Quarkus Gradle plugin, are not available when Quarkus code generation runs. This is simply a task-dependency requirement in Gradle, because Java compilation happens after code generation. If a Java service, for example a Smallrye config sources, is present and the (Smallrye) configuration is needed by a Quarkus extension, the build fails during Quarkus code generation with an error message like this:
```
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':quarkusGenerateCode'.
...
Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing io.quarkus.gradle.tasks.worker.CodeGenWorker
...
Caused by: java.util.ServiceConfigurationError: io.smallrye.config.ConfigSourceFactory: Provider xyz not found
```

`io.quarkus.deployment.CodeGenerator` has a mechanism to filter out unavailable services via `getUnavailableConfigServices()`. However the callback passed to `io.quarkus.paths.PathTree.apply()` can stop before all roots/trees (`io.quarkus.paths.PathTree.getRoots()`) have been "asked" (`MultiRootPathTree`), because the callback can return a non-`null` value. This "early stop" happens before the root/tree containing the source with the `META-INF/services/*` has been processed.

The bug is only triggered, if a Java service is defined in the Gradle project using the Quarkus Gradle plugin and if a Quarkus extension using the configuration is a dependency of that project.

This change updates the callback implementation to collect all unavailable services from all `PathTree` roots/trees.

An integration test using the Gradle plugin is included as well.

Two logging/spelling mistakes have been fixed as well.

Fixes quarkusio#36716

* Fix assertions in Hibernate ORM 5.6 compatibility tests

Hibernate ORM 5.6 does not, in fact, preserve information for OffsetTime
columns. It just slaps the current JVM timezone on a stored LocalTime.

* Gradle plugin: use full URI for configuration source locations

`io.quarkus.gradle.tasks.EffectiveConfig.CombinedConfigSourceProvider` passes only the "file extension" (e.g. `application.properties`) down to `io.smallrye.config.AbstractLocationConfigSourceLoader#loadConfigSources(java.lang.String[], int, java.lang.ClassLoader)`, which may let that function behave wrong and try to for example access an `application.properties` in the wrong location. This can be reproduced by placing an `application.properties` file in the project directory of a Gradle project that uses the Quarkus Gradle plugin.

This change fixes this behavior by passing down the correct locations as the `String` representation of the resource URIs, instead of just the "file extensions".

Fixes quarkusio#36767

* Tests to check content type between Services and OpenAPI

Signed-off-by: Phillip Kruger <[email protected]>

* Kafka Streams Dev UI migration to v2

* Fix codestarts snapshots

* [quarkusio#36582] Fix bug: TransactionalUniAsserter never fails

TransactionalUniAsserterTestMethodInvoker is a subclass of
RunOnVertxContextTestMethodInvoker.

The problem is that there were two separate pointers keeping
track of the asserter in the superclass and in the subclass.
This lead to only one pointer being initialized and, if the wrong
pointer was null-checked, the asserter was ignored causing the test
to never fail.

This commit fixes the issue by keeping only one reference to the
asserter in the superclass.

* [quarkusio#36582] Minor clean up in TransactionalUniAsserterTest

Use method reference where possible

* [quarkusio#36582] Minor clean up around lambdas

* [quarkusio#36582] Add UnwrappableUniAsserter interface

The goal is to extract the `asUni()` method from `UniAsserter`

* Duplicate Authorization Bearer Header Fix

* Tiny Vale tweaks for Datasource and Logging guide

Signed-off-by: Michal Maléř <[email protected]>

* More reliable test setup in integration-tests/hibernate-orm-tenancy/datasource

The previous config was relying on FlyWay on a default datasource to create other databases
which named datasources pointed at.

Which works well, until a named datasource gets initialized before the default datasource;
then named datasource initialization fails because the corresponding database doesn't exist yet.

This happened on my local laptop, I don't know why it didn't happen on CI.

* Skip non-existing directory when watching for changes

Fix quarkusio#32092.
The issue was not specific to Gradle.
It was problematic with Gradle, as it was configuring the watcher on not existing directories.

* Remove erroneous preview status from cache doc

* Fix OIDC key resolver to accept SHA256 certificate thumbprints

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Phillip Kruger <[email protected]>
Signed-off-by: Michal Maléř <[email protected]>
Co-authored-by: Guillaume Smet <[email protected]>
Co-authored-by: Pedro Igor <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sergey Beryozkin <[email protected]>
Co-authored-by: asjervanasten <[email protected]>
Co-authored-by: Andrea Peruffo <[email protected]>
Co-authored-by: Clement Escoffier <[email protected]>
Co-authored-by: Clement Escoffier <[email protected]>
Co-authored-by: Foivos Zakkak <[email protected]>
Co-authored-by: Jan Martiska <[email protected]>
Co-authored-by: Auri Munoz <[email protected]>
Co-authored-by: Martin Kouba <[email protected]>
Co-authored-by: Ales Justin <[email protected]>
Co-authored-by: George Gastaldi <[email protected]>
Co-authored-by: Ozan Gunalp <[email protected]>
Co-authored-by: Eric Deandrea <[email protected]>
Co-authored-by: Phillip Kruger <[email protected]>
Co-authored-by: Rostislav Svoboda <[email protected]>
Co-authored-by: Rui Balau <[email protected]>
Co-authored-by: Loïc Mathieu <[email protected]>
Co-authored-by: Georgios Andrianakis <[email protected]>
Co-authored-by: Andy Damevin <[email protected]>
Co-authored-by: jeanphi.baconnais <[email protected]>
Co-authored-by: Michal Maléř <[email protected]>
Co-authored-by: Rolfe Dlugy-Hegwer <[email protected]>
Co-authored-by: Ladislav Thon <[email protected]>
Co-authored-by: Matej Novotny <[email protected]>
Co-authored-by: mariofusco <[email protected]>
Co-authored-by: Michal Vavřík <[email protected]>
Co-authored-by: Yoann Rodière <[email protected]>
Co-authored-by: JiriOndrusek <[email protected]>
Co-authored-by: hiteshkhatri97 <[email protected]>
Co-authored-by: Juan Diego López V <[email protected]>
Co-authored-by: Alex Martel <[email protected]>
Co-authored-by: Max Rydahl Andersen <[email protected]>
Co-authored-by: marko-bekhta <[email protected]>
Co-authored-by: Geoffrey De Smet <[email protected]>
Co-authored-by: Bruno Baptista <[email protected]>
Co-authored-by: kdnakt <[email protected]>
Co-authored-by: Marco Bungart <[email protected]>
Co-authored-by: xstefank <[email protected]>
Co-authored-by: Alexey Loubyansky <[email protected]>
Co-authored-by: Roman Ziske <[email protected]>
Co-authored-by: Robert Stupp <[email protected]>
Co-authored-by: David Cotton <[email protected]>
Co-authored-by: Roberto Cortez <[email protected]>
Co-authored-by: Davide D'Alto <[email protected]>
Co-authored-by: sahuefficy <[email protected]>
@mr-mos
Copy link
Author

mr-mos commented Nov 16, 2023

Thanks @mkouba!
I tested it today on the current Snapshot (Quarkus 3.6.0.CR1). It's not working for me.
Config:
quarkus.qute.dev-mode.no-restart-templates=templates/openAI/openAIStart.html
Whenever I change the openAIStart.html the server is still restarting.

The (simple) application for this test can be found here: https://github.com/mr-mos/quarkus_play_app.

Seems like I can not reopen this issue?

@maxandersen
Copy link
Member

Probably best to open a bug for it.

@mkouba

@mkouba
Copy link
Contributor

mkouba commented Nov 16, 2023

Thanks @mkouba! I tested it today on the current Snapshot (Quarkus 3.6.0.CR1). It's not working for me. Config: quarkus.qute.dev-mode.no-restart-templates=templates/openAI/openAIStart.html Whenever I change the openAIStart.html the server is still restarting.

The (simple) application for this test can be found here: https://github.com/mr-mos/quarkus_play_app.

Seems like I can not reopen this issue?

Hm, it should work although the docs is wrong because the matched input is not the template path relative from the templates dir. I'll take a look at your reproducer first.

@mkouba
Copy link
Contributor

mkouba commented Nov 17, 2023

@mr-mos I cannot reproduce the problem locally.

I did:

  1. Clone your repo
  2. Change the quarkus version to 3.6.0.CR1
  3. Start the app in the dev mode
  4. HTTP GET http://localhost:8080/openAI/openAIStart -> redirected to http://localhost:8080/openAI/apiKey
  5. Change the openAIStart.html file
  6. HTTP GET http://localhost:8080/openAI/openAIStart -> redirected to http://localhost:8080/openAI/apiKey and in the log I can see:
2023-11-17 12:28:14,650 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (vert.x-worker-thread-1) File change detected: /opt/source/protean/bugs/qute-no-restart/quarkus_play_app/src/main/resources/templates/openAI/openAIStart.html
2023-11-17 12:28:14,651 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (vert.x-worker-thread-1) Files changed but restart not needed - notified extensions in: 0.002s 

@mr-mos
Copy link
Author

mr-mos commented Nov 20, 2023

@mkouba That's interesting. I did exactly the same steps you described above, but not sure about "2. Change the quarkus version to 3.6.0.CR1". What did you change here? The Snapshot includes 3.6.0.CR1 automatically, right?

Tested it again (with "clean" and deletion of all qute-maven-artifacts on disk).

Always get a full restart:

2023-11-20 14:54:03,138 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cache, cdi, hibernate-validator, qute, resteasy-reactive, resteasy-reactive-qute, smallrye-context-propagation, smallrye-health, vertx]
2023-11-20 14:54:26,046 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (vert.x-worker-thread-1) File change detected: D:\projects\tech_testing\quarkus_play_app\src\main\resources\templates\openAI\openAIStart.html
2023-11-20 14:54:26,254 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (vert.x-worker-thread-1) File change detected: D:\projects\tech_testing\quarkus_play_app\src\main\resources\templates\openAI
2023-11-20 14:54:26,256 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (vert.x-worker-thread-1) Restarting quarkus due to changes in openAI.
2023-11-20 14:54:26,272 INFO  [io.quarkus] (Quarkus Main Thread) quarkus_play_app stopped in 0.014s
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2023-11-20 14:54:26,558 INFO  [io.quarkus] (Quarkus Main Thread) quarkus_play_app 1.03 on JVM (powered by Quarkus 3.6.0.CR1) started in 0.286s. Listening on: http://localhost:8080
2023-11-20 14:54:26,559 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2023-11-20 14:54:26,559 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cache, cdi, hibernate-validator, qute, resteasy-reactive, resteasy-reactive-qute, smallrye-context-propagation, smallrye-health, vertx]
2023-11-20 14:54:26,559 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (vert.x-worker-thread-1) Live reload total time: 0.516s 

I assume that this line is the problem:
2023-11-20 14:54:26,254 INFO [io.qua.dep.dev.RuntimeUpdatesProcessor] (vert.x-worker-thread-1) File change detected: D:\projects\tech_testing\quarkus_play_app\src\main\resources\templates\openAI
I'm testing it on a windows machine. It seems that the folder gets also a change event. Could it be that this "directory change" needs to be ignored in your implementation?

But even if I change the config to quarkus.qute.dev-mode.no-restart-templates=templates/.+ (== all templates) I'm getting the restart.

@mkouba
Copy link
Contributor

mkouba commented Nov 20, 2023

That's interesting. I did exactly the same steps you described above, but not sure about "2. Change the quarkus version to 3.6.0.CR1". What did you change here? The Snapshot includes 3.6.0.CR1 automatically, right?

Not really. Your reproducer depends on io.quarkus.platform:quarkus-bom:999-SNAPSHOT which is probably the latest snaphot of the main branch deployed to https://s01.oss.sonatype.org/content/repositories/snapshots/io/quarkus/platform.

I assume that this line is the problem:
2023-11-20 14:54:26,254 INFO [io.qua.dep.dev.RuntimeUpdatesProcessor] (vert.x-worker-thread-1) File change detected: D:\projects\tech_testing\quarkus_play_app\src\main\resources\templates\openAI
I'm testing it on a windows machine. It seems that the folder gets also a change event. Could it be that this "directory change" needs to be ignored in your implementation?

Yes, this is weird.

But even if I change the config to quarkus.qute.dev-mode.no-restart-templates=templates/.+ (== all templates) I'm getting the restart.

Do you get the same log message?

Anyway, I would expect the NoRestartTemplatesDevModeTest.java to fail in the windows job on our CI.

Unfortunately, I don't have a windows machine to run the test. So it will take some time to debug this problem...

@mkouba
Copy link
Contributor

mkouba commented Nov 20, 2023

I've created #37224 to debug the windows job on the CI.

@mkouba
Copy link
Contributor

mkouba commented Nov 20, 2023

So I have modified the NoRestartTemplatesDevModeTest in a way that the modified template is located in templates/foo/norestart.html and the config property is quarkus.qute.dev-mode.no-restart-templates=templates/foo/norestart.html and it seems to work fine:

INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cache, cdi, qute, reactive-routes, smallrye-context-propagation, vertx]
INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (vert.x-worker-thread-1) File change detected: D:\a\quarkus\quarkus\extensions\qute\deployment\target\quarkus-dev-mode-test4150238348394994476\src\main\resources\templates\foo\norestart.html
INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (vert.x-worker-thread-1) Files changed but restart not needed - notified extensions in: 0.003s 
INFO  [io.quarkus] (Quarkus Main Thread) quarkus-qute-deployment stopped in 0.008s
2023-11-20T14:43:54.8364589Z [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.666 s -- in io.quarkus.qute.deployment.devmode.NoRestartTemplatesDevModeTest

@mr-mos
Copy link
Author

mr-mos commented Nov 20, 2023

Do you get the same log message?

Different. When using the regex the file (openAIStart.html) and the folder (openAI) are not recognized:

2023-11-20 17:16:13,639 INFO [io.qua.dep.dev.RuntimeUpdatesProcessor] (vert.x-worker-thread-1) Restarting quarkus due to changes in openAI, openAIStart.html.

Just debugged a little locally. The problem is definitely the directory templates\openAI\
In io.quarkus.deployment.dev.RuntimeUpdatesProcessor.WatchedPath#matches it's not matched.

But still don't understand why the regex templates/.+ is not matching. From the code it looks like "equals" instead of pattern-matching is used?

@mkouba
Copy link
Contributor

mkouba commented Nov 20, 2023

Do you get the same log message?

Different. When using the regex the file (openAIStart.html) and the folder (openAI) are not recognized:

2023-11-20 17:16:13,639 INFO [io.qua.dep.dev.RuntimeUpdatesProcessor] (vert.x-worker-thread-1) Restarting quarkus due to changes in openAI, openAIStart.html.

Just debugged a little locally. The problem is definitely the directory templates\openAI\ In io.quarkus.deployment.dev.RuntimeUpdatesProcessor.WatchedPath#matches it's not matched.

But still don't understand why the regex templates/.+ is not matching. From the code it looks like "equals" instead of pattern-matching is used?

I'll need to find a window box to debug your reproducer locally.

It does work on my linux machine (including templates/.+) and even the modified test passed in the windows job on the CI. So I'm a bit confused 🤷.

@mkouba
Copy link
Contributor

mkouba commented Nov 21, 2023

@mr-mos I've just tried to reproduce the problem with your demo on a windows 11 machine it worked just fine. So the only thing I can think of is that your local repository contains some outdated 999-SNAPSHOT artifacts.

Are you able to reproduce the problem with quarkus 3.6.0.CR1?

If yes, is there anything special in your config?

@mr-mos
Copy link
Author

mr-mos commented Nov 21, 2023

@mkouba That's strange. When starting Quarkus it runs on 3.6.0.CR1
2023-11-20 14:54:26,558 INFO [io.quarkus] (Quarkus Main Thread) quarkus_play_app 1.03 on JVM (powered by Quarkus 3.6.0.CR1) started in 0.286s.
My pom file looks like the one in GitHub. Should I change something in the POM?
Regarding config nothing special I can think of. During my debug-session I double-checked that the latest code is used. I saw the changes of your commit: fc1b83f
I also deleted all maven artifacts of Quarkus on my disk to make sure that nothing is outdated. Tested it also with WSL/Ubuntu. Same problem.

If you like we can do a screensharing/debug-session together? Thanks for your support.

@mkouba
Copy link
Contributor

mkouba commented Nov 21, 2023

That's strange. When starting Quarkus it runs on 3.6.0.CR1.

Strange indeed.

My pom file looks like the one in GitHub. Should I change something in the POM?

The only thing I've changed is <quarkus.platform.version>3.6.0.CR1</quarkus.platform.version>.

Tested it also with WSL/Ubuntu. Same problem.

That's even more weirder. I don't know how exactly WSL works but I thought that it runs a virtual machine.

If you like we can do a screensharing/debug-session together? Thanks for your support.

Thanks. But currently I have no idea how to proceed.

I still don't understand why is the templates\openAI directory watched at all. I need to look into the RuntimeUpdatesProcessor again...

@mkouba
Copy link
Contributor

mkouba commented Nov 21, 2023

I think that I found the reason why we watch the templates\openAI directory. I'll attach the fix to #37224.

@mr-mos The fact that ,in your case, the modification time of a directory changes if a containing file is modified, is probably a filesystem-specific configuration. I have tested Windows 11 + NTFS and Ubuntu + Ext4.

UPDATE: It seems that FAT32 shows this ^ behavior.

@mr-mos
Copy link
Author

mr-mos commented Nov 21, 2023

@mkouba
That's crazy. ;) I'm using Win 11 (latest version) and also NTFS.

I did some more testing and found the reason:
Whenever I save the file with IntelliJ (latest version) the modified date of the folder is changed.
If I use another editor like VS Code the date of the folder is not touched.
--> So it works with VS Code but not for IntelliJ
Whatever IntellI is doing here. ;)

@mkouba
Copy link
Contributor

mkouba commented Nov 21, 2023

@mkouba That's crazy. ;) I'm using Win 11 (latest version) and also NTFS.

I did some more testing and found the reason: Whenever I save the file with IntelliJ (latest version) the modified date of the folder is changed. If I use another editor like VS Code the date of the folder is not touched. --> So it works with VS Code but not for IntelliJ Whatever IntellI is doing here. ;)

Ah, interesting! I don't use IntelliJ so 🤷.

Anyway, it would be great if you could test the PR mentioned above.

@mr-mos
Copy link
Author

mr-mos commented Nov 21, 2023

Short on time. Could I test it in the SNAPSHOT tomorrow?

@mkouba
Copy link
Contributor

mkouba commented Nov 21, 2023

Short on time. Could I test it in the SNAPSHOT tomorrow?

Of course, assuming we merge the PR in time ;-)

@mr-mos
Copy link
Author

mr-mos commented Nov 23, 2023

@mkouba: Tried to update the SNAPSHOT build for re-testing. Still get the old code. Is it already integrated in the current snapshot?

@mkouba
Copy link
Contributor

mkouba commented Nov 27, 2023

@mkouba: Tried to update the SNAPSHOT build for re-testing. Still get the old code. Is it already integrated in the current snapshot?

I have no idea TBH 🤷

@mr-mos
Copy link
Author

mr-mos commented Jan 11, 2024

Works perfect in V3.6. Thanks..

holly-cummins pushed a commit to holly-cummins/quarkus that referenced this issue Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devmode area/qute The template engine kind/enhancement New feature or request
Projects
None yet
3 participants