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

Initialize dependency validation for gradle extensions #21856

Merged

Conversation

glefloch
Copy link
Member

@glefloch glefloch commented Dec 1, 2021

This branch adds a new task that aims to validate extension dependencies. This checks (based on extension detected in the runtime module):

  • all deployment artifact are declared in the deployment module
  • no deployment module appears in the runtime module classpath

This check can be disabled.

BTW, we start to have some tooling to create extension project. With some this could be externalize and re-used in other gradle tests.

@glefloch glefloch requested a review from aloubyansky December 1, 2021 15:48
@quarkus-bot quarkus-bot bot added area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle labels Dec 1, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Dec 1, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 85aebf3

Status Name Step Failures Logs Raw logs
Gradle Tests - JDK 11 Build Failures Logs Raw logs
Gradle Tests - JDK 11 Windows Build Failures Logs Raw logs
✔️ JVM Tests - JDK 11
JVM Tests - JDK 11 Windows Build Failures Logs Raw logs
✔️ JVM Tests - JDK 17

Full information is available in the Build summary check run.

Failures

⚙️ Gradle Tests - JDK 11 #

- Failing: integration-tests/gradle 

📦 integration-tests/gradle

io.quarkus.gradle.ConditionalDependenciesTest.shouldImportConditionalDependency line 80 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting path:

io.quarkus.gradle.ConditionalDependenciesTest.shouldNotImportConditionalDependency line 102 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting path:

io.quarkus.gradle.ConditionalDependenciesTest.shouldNotFailIfConditionalDependencyIsExplicitlyDeclared line 120 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting path:

io.quarkus.gradle.ConditionalDependenciesTest.scenarioTwo line 143 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting path:

⚙️ Gradle Tests - JDK 11 Windows #

- Failing: integration-tests/gradle 

📦 integration-tests/gradle

io.quarkus.gradle.ConditionalDependenciesTest.shouldImportConditionalDependency line 80 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting path:

io.quarkus.gradle.ConditionalDependenciesTest.shouldNotImportConditionalDependency line 102 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting path:

io.quarkus.gradle.ConditionalDependenciesTest.shouldNotFailIfConditionalDependencyIsExplicitlyDeclared line 120 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting path:

io.quarkus.gradle.ConditionalDependenciesTest.scenarioTwo line 143 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting path:

⚙️ JVM Tests - JDK 11 Windows #

- Failing: devtools/gradle/gradle-extension-plugin 

📦 devtools/gradle/gradle-extension-plugin

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (gradle) on project io.quarkus.extension.gradle.plugin: Command execution failed.

@glefloch glefloch force-pushed the feat/gradle-extension-validation branch from 85aebf3 to 460cb56 Compare December 2, 2021 17:05
@quarkus-bot
Copy link

quarkus-bot bot commented Dec 2, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 460cb56

Status Name Step Failures Logs Raw logs
Gradle Tests - JDK 11 Build ⚠️ Check → Logs Raw logs
Gradle Tests - JDK 11 Windows Build Failures Logs Raw logs
JVM Tests - JDK 11 Build Failures Logs Raw logs
JVM Tests - JDK 11 Windows Build Failures Logs Raw logs
JVM Tests - JDK 17 Build Failures Logs Raw logs

Full information is available in the Build summary check run.

⚠️ Errors occurred while downloading the build reports. This report is incomplete.

Failures

⚙️ Gradle Tests - JDK 11 Windows #

- Failing: integration-tests/gradle 

📦 integration-tests/gradle

io.quarkus.gradle.ConditionalDependenciesTest.shouldImportConditionalDependency line 80 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting path:

io.quarkus.gradle.ConditionalDependenciesTest.shouldNotImportConditionalDependency line 102 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting path:

io.quarkus.gradle.ConditionalDependenciesTest.shouldNotFailIfConditionalDependencyIsExplicitlyDeclared line 120 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting path:

io.quarkus.gradle.ConditionalDependenciesTest.scenarioTwo line 143 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting path:

⚙️ JVM Tests - JDK 11 #

- Failing: devtools/gradle/gradle-extension-plugin 

📦 devtools/gradle/gradle-extension-plugin

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (gradle) on project io.quarkus.extension.gradle.plugin: Command execution failed.


⚙️ JVM Tests - JDK 11 Windows #

- Failing: devtools/gradle/gradle-extension-plugin 

📦 devtools/gradle/gradle-extension-plugin

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (gradle) on project io.quarkus.extension.gradle.plugin: Command execution failed.


⚙️ JVM Tests - JDK 17 #

- Failing: devtools/gradle/gradle-extension-plugin 

📦 devtools/gradle/gradle-extension-plugin

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (gradle) on project io.quarkus.extension.gradle.plugin: Command execution failed.

@glefloch glefloch force-pushed the feat/gradle-extension-validation branch 2 times, most recently from b1e446f to 640dfdc Compare December 2, 2021 20:06
@quarkus-bot
Copy link

quarkus-bot bot commented Dec 2, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 640dfdc

Status Name Step Failures Logs Raw logs
Gradle Tests - JDK 11 Build Failures Logs Raw logs
Gradle Tests - JDK 11 Windows Build Failures Logs Raw logs
✔️ JVM Tests - JDK 11
JVM Tests - JDK 11 Windows Build Failures Logs Raw logs
✔️ JVM Tests - JDK 17

Full information is available in the Build summary check run.

Failures

⚙️ Gradle Tests - JDK 11 #

- Failing: integration-tests/gradle 

📦 integration-tests/gradle

io.quarkus.gradle.ConditionalDependenciesTest.scenarioTwo line 143 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting path:

⚙️ Gradle Tests - JDK 11 Windows #

- Failing: integration-tests/gradle 

📦 integration-tests/gradle

io.quarkus.gradle.ConditionalDependenciesTest.scenarioTwo line 143 - More details - Source on GitHub

java.lang.AssertionError: 

Expecting path:

⚙️ JVM Tests - JDK 11 Windows #

- Failing: devtools/gradle/gradle-extension-plugin 

📦 devtools/gradle/gradle-extension-plugin

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (gradle) on project io.quarkus.extension.gradle.plugin: Command execution failed.

@gsmet
Copy link
Member

gsmet commented Dec 7, 2021

@glefloch CI doesn't look happy.

@glefloch glefloch force-pushed the feat/gradle-extension-validation branch from 640dfdc to 6302beb Compare December 8, 2021 11:03
@glefloch
Copy link
Member Author

glefloch commented Dec 8, 2021

looks better now, @aloubyansky could you have a look ?

@@ -11,6 +11,7 @@ dependencies {

quarkusExtension {
deploymentArtifact = "org.acme:ext-f-deployment:1.0-SNAPSHOT"
disableValidation = true
Copy link
Member

Choose a reason for hiding this comment

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

What was the reason for disabling validation here and in other projects?

Copy link
Member Author

Choose a reason for hiding this comment

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

In the test module, we have multiple extensions in a multi module project. Dependencies between module are declared using the following syntax project(':ext-b:deployment'). In the validation task, when looking for deployment dependencies, we look for what was declared in quarkus-extension.properties files. In this project this differs from project.group:project.name (this is due to a limitation of having multiple module calls runtime and deployment). I was thinking of pushing a commit to improve that later on.

Copy link
Member

Choose a reason for hiding this comment

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

Does it mean that validation wouldn't work for extensions in the same project?

Copy link
Member Author

Choose a reason for hiding this comment

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

if we have multiple extension in a the same project that depends to each other, the validation will fail yes.

Copy link
Member

Choose a reason for hiding this comment

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

We probably shouldn't enable it by default then until it's supported.

Copy link
Member Author

Choose a reason for hiding this comment

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

Should I remove the task from the graph ? this would avoid introducing a "breaking change" in further versions.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think so.

Copy link
Member Author

Choose a reason for hiding this comment

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

I pushed a fix, the task must be explicitly called to be executed

Copy link
Member

Choose a reason for hiding this comment

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

So these disableValidation = true could be removed now?

Copy link
Member Author

Choose a reason for hiding this comment

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

sure done :)

@glefloch glefloch force-pushed the feat/gradle-extension-validation branch from 6302beb to 3e8a005 Compare December 8, 2021 20:45
@glefloch glefloch force-pushed the feat/gradle-extension-validation branch from 3e8a005 to 6a907d0 Compare December 8, 2021 21:03
@aloubyansky aloubyansky merged commit a071b84 into quarkusio:main Dec 9, 2021
@quarkus-bot quarkus-bot bot added this to the 2.7 - main milestone Dec 9, 2021
@glefloch glefloch deleted the feat/gradle-extension-validation branch December 9, 2021 10:18
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/gradle Gradle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants