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

Mark Missing Local Artifacts as optional #23245

Closed
wants to merge 4 commits into from

Conversation

tresat
Copy link
Member

@tresat tresat commented Dec 20, 2022

Fixes: #22875

Added an integration test that replicates the issue.

@tresat tresat self-assigned this Dec 20, 2022
@tresat
Copy link
Member Author

tresat commented Dec 20, 2022

@bot-gradle test this

@bot-gradle
Copy link
Collaborator

OK, I've already triggered the following builds for you:

@tresat tresat added this to the 7.6.1 milestone Dec 21, 2022
@tresat tresat requested a review from big-guy December 21, 2022 19:24
@tresat
Copy link
Member Author

tresat commented Dec 21, 2022

@bot-gradle test this

@bot-gradle
Copy link
Collaborator

I've triggered the following builds for you:

@tresat tresat marked this pull request as ready for review December 21, 2022 22:19
@tresat tresat requested a review from a team as a code owner December 21, 2022 22:19

@Override
public boolean isOptionalArtifact() {
return true;
Copy link
Member

@ljacomet ljacomet Dec 22, 2022

Choose a reason for hiding this comment

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

This is not a method I am super familiar with.
Can you explain why a blanket change like this to all instances of MissingLocalArtifactMetadata is not an issue?

And looks like we have tests that fail because of the change.

Copy link
Member Author

Choose a reason for hiding this comment

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

So my previous test run succeeded here, then my only change after was to add a new integration test. So that's a little strange.

I was looking for failing tests and when I didn't see any assumed we could mark missing but local metadata artifacts as optional so that we don't throw an exception when trying to get() them. I'll look a little deeper into these now failing tests, maybe they can throw some new light on this.

@tresat tresat marked this pull request as draft December 22, 2022 17:00
@tresat
Copy link
Member Author

tresat commented Dec 22, 2022

Now I'm wondering if the behavior in 7.5 was correct. Maybe this ought to have been failing there as well.

import org.gradle.integtests.fixtures.AbstractIntegrationSpec
import spock.lang.Issue

@Issue("https://github.com/gradle/gradle/pull/23245")
Copy link
Member

Choose a reason for hiding this comment

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

I think you meant to link to the issue here?

@tresat
Copy link
Member Author

tresat commented Dec 22, 2022

So we're no longer honoring this comment currently because of how we now attempt to get the lazily resolved artifacts prior to visiting them with a build operation.

artifacts = artifactsSupplier.get();
} catch (Exception e) {
return EMPTY;
}
if (artifacts.isEmpty()) {
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 there was an easy way to pass information about whether we are resolving leniently or strictly to the ArtifactBackedResolvedVariant#create method as it calls supplyResolvedArtifacts so that we can add this (or similar error handling) when this supplier's get() is called, this would be a straightforward change, I think.

Alternately, if we could change the Supplier to a Function and pass in the configuration doing the resolving when get()/call() is called, we could do the same thing.

As it is now, passing this information all the way into this Supplier when it is created seems like it would require sending a flag down a very long chain of resolution calls.

@big-guy big-guy changed the base branch from master to release7x December 23, 2022 16:09
@big-guy big-guy changed the base branch from release7x to master December 23, 2022 16:09
@big-guy
Copy link
Member

big-guy commented Jan 6, 2023

OBE #23399

@big-guy big-guy closed this Jan 6, 2023
@tresat tresat deleted the tt/76/pom-artifact-not-found branch September 18, 2023 21:54
@ov7a ov7a removed this from the 7.6.1 milestone Mar 28, 2024
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.

Regression with 7.6: @pom artifact in JVM library project is no longer found
5 participants