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

[CI] - Quarkus Super Heroes + Quarkus main #23612

Open
quarkus-super-heroes-bot opened this issue Feb 11, 2022 · 292 comments · Fixed by quarkusio/quarkus-ecosystem-ci#161
Open

[CI] - Quarkus Super Heroes + Quarkus main #23612

quarkus-super-heroes-bot opened this issue Feb 11, 2022 · 292 comments · Fixed by quarkusio/quarkus-ecosystem-ci#161
Labels
triage/ci-participant Issue used to track when CI has failed for a ecosystem-ci participant.

Comments

@quarkus-super-heroes-bot
Copy link

quarkus-super-heroes-bot commented Feb 11, 2022

This issue will be open and closed dependent on the state of https://github.com/quarkusio/quarkus-super-heroes building against Quarkus main snapshot.

If you have interest in being notified of this subscribe to the issue.

Closing #23425 in favor of this one.

@quarkus-super-heroes-bot
Copy link
Author

The build is still failing:

@quarkus-super-heroes-bot
Copy link
Author

The build is still failing:

@quarkus-super-heroes-bot
Copy link
Author

The build is still failing:

@quarkus-super-heroes-bot
Copy link
Author

Build fixed:

@quarkus-super-heroes-bot
Copy link
Author

Unfortunately, the build failed:

@quarkus-super-heroes-bot
Copy link
Author

The build is still failing:

@edeandrea
Copy link
Contributor

@geoand is this a regression on Quarkus main?

Error: ] Some problems were encountered while processing the POMs:
Error:  'dependencies.dependency.version' for io.quarkus:quarkus-junit5-vertx:jar is missing. @ line 109, column 17
 @ 
Error:  The build could not read 1 project -> [Help 1]
Error:    
Error:    The project io.quarkus.workshop.super-heroes:rest-heroes:1.0 (/home/runner/work/quarkus-super-heroes/quarkus-super-heroes/current-repo/rest-heroes/pom.xml) has 1 error
Error:      'dependencies.dependency.version' for io.quarkus:quarkus-junit5-vertx:jar is missing. @ line 109, column 17

@geoand
Copy link
Contributor

geoand commented Mar 1, 2022

It's the result of #23905.

From the description:

N.B. This is a breaking change because the module name of quarkus-junit5-vertx was changed to quarkus-test-vertx (as it now needs to support quarkus-junit5-internal), the dependency on quarkus-junit5 was removed and the API changed packages (from io.quarkus.test.junit.vertx to io.quarkus.test.vertx).

@edeandrea
Copy link
Contributor

Got it. Thanks you. So does that mean until 2.7.3 is out this CI will fail every day?

@geoand
Copy link
Contributor

geoand commented Mar 1, 2022

Why do you say that?

CI should be green once you make the changes mentioned above.

@edeandrea
Copy link
Contributor

Is quarkus-test-vertx available pre 2.7.3?

@geoand
Copy link
Contributor

geoand commented Mar 1, 2022

Nope. Isn't CI testing against Quarkus main?

@edeandrea
Copy link
Contributor

It is. Which goes to my earlier comment that I can't make any changes until 2.7.3 is released, which also means the daily CI will continue to fail each day because of it. There isn't anything I can do to fix it until 2.7.3 is out.

@geoand
Copy link
Contributor

geoand commented Mar 1, 2022

2.7.3.Final should be out this week

@edeandrea
Copy link
Contributor

Sounds good. Thanks for the help!

Since this is a breaking change in a minor release I'd make sure it's well documented in the release notes :)

@geoand
Copy link
Contributor

geoand commented Mar 1, 2022

Yup, will do

@quarkus-super-heroes-bot
Copy link
Author

The build is still failing:

@quarkus-super-heroes-bot
Copy link
Author

The build is still failing:

@edeandrea
Copy link
Contributor

I just merged in changes for 2.7.3.Final (quarkusio/quarkus-super-heroes#35), so this should go back to green tomorrow.

@quarkus-super-heroes-bot
Copy link
Author

Build fixed:

@bdemers
Copy link

bdemers commented Sep 10, 2024

Hey @bdemers do you know if there is a way in Maven to add a dependency rewrite rule on the fly during the build? Meaning if one of my project's transitive dependencies depends on A, maybe I want to re-write that dependency to B? Like you can do with Gradle (https://docs.gradle.org/current/userguide/resolution_rules.html#sub:conditional_dependency_substitution).

In Gradle I could do something like this in my build.gradle:

configurations.all {
  resolutionStrategy {
    eachDependency { dependency ->
      if ((dependency.requested.group == 'io.quarkus') && (dependency.requested.name == 'quarkus-rest-client-reactive-jackson')) {
        dependency.useTarget group: 'io.quarkus', name: 'quarkus-rest-client-jackson', version: dependency.requested.version
      }
    }
  }
}

Not really, but you could create a Maven extension could probably do it, but IMHO, that might obscure what is going on.

If you just want to test the same project with one lib (reactive), and run the build again to test it out with another (non-reactive) you could create profiles, and run the build twice: mvn verify && mvn verify -Preactive

If you want to run a build and test the integration of both libraries in the same build you could do that too, but how it's structured may depend on how your project is laid out (and it's goals, e.g. if the goal is testing or explaining to others how they should test a typical app).
TL;DR you could create maven sub-modules something like:
-common-jackson-tests (where src/main/java would contain reusable tests that are used in the following projects)

  • jackson-reactive-client (import the tests using surefire/failsafe's dependenciesToScan param)
  • jackson-rest-client (same as previous just with different dependencies).

If that doesn't help (or I'm way off on what you are trying to do) let me know and we can chat for a few minutes, and I see if I can point you in the right direction!

@edeandrea
Copy link
Contributor

Thanks for chiming in @bdemers!

The issue here is that in Quarkus itself, version 3.9+ renamed quarkus-rest-client-reactive-jackson to quarkus-rest-client-jackson. Up until what is on main there were "placeholder" artifacts in place to redirect quarkus-rest-client-reactive-jackson to quarkus-rest-client-jackson. Now on main those placeholder artifacts are gone, but one of the transitive dependencies of the application refer to an older version of quarkus that has those placeholders.

So now the build of the application fails. We were trying to figure out a clever way for the application to enforce the placeholders, which can be easily done in Gradle :)

@bdemers
Copy link

bdemers commented Sep 10, 2024

Ahh! Changing a GAV is hard!

Depending on what you did for the placeholder redirects, (Maven empty maven modules, or actual maven repository relocation files)

My suggestion would be to keep an empty module using the old name, that depends on the new name, add a deprecated note in the pom (nobody will read it though).
Quarkus could also create a Maven Enforcer rule (only works for Maven though), to detect potential problems (usage of the old dependency being one of them)
Or possibly this new wrapper jar some build time hook (using some Quarkus magic?) that adds a warning to build output, make that an error the next version, then fail builds in a future version (with a pointer to docs on how to upgrade)

We had a similar story with JJWT.
In an older release, used a single single jar, since then the packaging was made more modular (choice of JSON parser, etc). What we noticed is folks were stuck on the old version because lots of folks just depend on Dependabot, which don't work if you change a GAV. Our solution was to create a new module using the old coordinates, and include all the needed dependencies.
We added a note in the pom, which probably nobody will read 😆

🤔 Another idea would be to deploy an empty jar with an odd version name like quarkus-rest-client-reactive-jackson:3.9.999999, add that version in the Quarkus BOM. Any consumers of the BOM will automatically get the empty jar. If that empty jar depends on the new quarkus-rest-client-jackson jar (and that is also in the BOM), users should resolve the version in the BOM). You should only need to deploy quarkus-rest-client-reactive-jackson:3.9.999999, once and use it going forward.

@geoand
Copy link
Contributor

geoand commented Sep 11, 2024

Thanks a lot for the insight @bdemers.

Just for completeness I'll add that we did have relocations for the artifact in question, but those were removed since we don't want to maintain them forever.

@quarkus-super-heroes-bot
Copy link
Author

The build is still failing:

@quarkus-super-heroes-bot
Copy link
Author

The build is still failing:

@quarkus-super-heroes-bot
Copy link
Author

The build is still failing:

@quarkus-super-heroes-bot
Copy link
Author

The build is still failing:

@quarkusbot
Copy link

Unfortunately, the build failed:

@quarkusbot
Copy link

The build is still failing:

@quarkusbot
Copy link

Build fixed:

@quarkusbot quarkusbot reopened this Mar 3, 2025
@quarkusbot
Copy link

Unfortunately, the build failed:

@edeandrea
Copy link
Contributor

The error looks very weird. I'll wait and see if it fixes itself tomorrow.

@quarkusbot
Copy link

The build is still failing:

@quarkusbot
Copy link

The build is still failing:

@edeandrea
Copy link
Contributor

@geoand There must be something going on. I'm at an event until Friday, so probably won't have time to troubleshoot until then.

@geoand
Copy link
Contributor

geoand commented Mar 5, 2025

Same here

@quarkusbot
Copy link

The build is still failing:

@quarkusbot
Copy link

The build is still failing:

@edeandrea
Copy link
Contributor

edeandrea commented Mar 7, 2025

@geoand I can reproduce this locally. Seems to be an issue with kotlin and/or grpc? The grpc plugin runs and generates the code but then I get all these compile errors in the generated code:

[INFO] --- kotlin:2.1.10:compile (compile) @ grpc-locations ---
[INFO] Applied plugin: 'all-open'
[ERROR] /Users/edeandre/workspaces/quarkus/quarkus-super-heroes-main/grpc-locations/target/generated-sources/grpc/io/quarkus/sample/superheroes/location/grpc/AllLocationsRequestKt.kt: (15, 17) Annotation argument must be a compile-time constant.
[ERROR] /Users/edeandre/workspaces/quarkus/quarkus-super-heroes-main/grpc-locations/target/generated-sources/grpc/io/quarkus/sample/superheroes/location/grpc/AllLocationsRequestKt.kt: (15, 37) Unresolved reference 'kotlin'.
[ERROR] /Users/edeandre/workspaces/quarkus/quarkus-super-heroes-main/grpc-locations/target/generated-sources/grpc/io/quarkus/sample/superheroes/location/grpc/AllLocationsRequestKt.kt: (16, 24) Unresolved reference 'kotlin'.

Its using kotlin-maven-allopen and kotlin-maven-plugin version 2.1.10. This version hasn't changed since January 2025, so something in Quarkus broke on March 2.

Here is one of the classes that was generated:

// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: locationservice-v1.proto

// Generated files should ignore deprecation warnings
@file:Suppress("DEPRECATION")
package io.quarkus.sample.superheroes.location.grpc;

@kotlin.jvm.JvmName("-initializeallLocationsRequest")
public inline fun allLocationsRequest(block: io.quarkus.sample.superheroes.location.grpc.AllLocationsRequestKt.Dsl.() -> kotlin.Unit): io.quarkus.sample.superheroes.location.grpc.AllLocationsRequest =
  io.quarkus.sample.superheroes.location.grpc.AllLocationsRequestKt.Dsl._create(io.quarkus.sample.superheroes.location.grpc.AllLocationsRequest.newBuilder()).apply { block() }._build()
/**
 * Protobuf type `io.quarkus.sample.superheroes.location.v1.AllLocationsRequest`
 */
public object AllLocationsRequestKt {
  @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
  @com.google.protobuf.kotlin.ProtoDslMarker
  public class Dsl private constructor(
    private val _builder: io.quarkus.sample.superheroes.location.grpc.AllLocationsRequest.Builder
  ) {
    public companion object {
      @kotlin.jvm.JvmSynthetic
      @kotlin.PublishedApi
      internal fun _create(builder: io.quarkus.sample.superheroes.location.grpc.AllLocationsRequest.Builder): Dsl = Dsl(builder)
    }

    @kotlin.jvm.JvmSynthetic
    @kotlin.PublishedApi
    internal fun _build(): io.quarkus.sample.superheroes.location.grpc.AllLocationsRequest = _builder.build()
  }
}
@kotlin.jvm.JvmSynthetic
public inline fun io.quarkus.sample.superheroes.location.grpc.AllLocationsRequest.copy(block: `io.quarkus.sample.superheroes.location.grpc`.AllLocationsRequestKt.Dsl.() -> kotlin.Unit): io.quarkus.sample.superheroes.location.grpc.AllLocationsRequest =
  `io.quarkus.sample.superheroes.location.grpc`.AllLocationsRequestKt.Dsl._create(this.toBuilder()).apply { block() }._build()

Image

It also seems like its now generating both Java & Kotlin classes with the same name...

Image

@cescoffier ^^^

@geoand
Copy link
Contributor

geoand commented Mar 7, 2025

I guess #44552 could the culprit?

@edeandrea
Copy link
Contributor

I think you're right. Following that PR, if I set quarkus.generate-code.grpc.kotlin.generate=false then everything works fine. I've commented on that PR.

@edeandrea
Copy link
Contributor

I created #46675

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/ci-participant Issue used to track when CI has failed for a ecosystem-ci participant.
Projects
None yet
Development

Successfully merging a pull request may close this issue.