Skip to content

Conversation

aloubyansky
Copy link
Member

Fixes #4315

@aloubyansky aloubyansky force-pushed the platform-resolver branch 3 times, most recently from 7d2442d to 2ade2b0 Compare October 17, 2019 14:49
@ia3andy ia3andy self-requested a review October 17, 2019 15:04
@aloubyansky aloubyansky marked this pull request as ready for review October 17, 2019 16:51
@aloubyansky aloubyansky added this to the 0.26.0 milestone Oct 17, 2019
@aloubyansky aloubyansky added the area/platform Issues related to definition and interaction with Quarkus Platform label Oct 17, 2019
@aloubyansky aloubyansky force-pushed the platform-resolver branch 2 times, most recently from f24f76e to c4842eb Compare October 18, 2019 08:51
Copy link
Contributor

@ia3andy ia3andy left a comment

Choose a reason for hiding this comment

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

LGTM

return this;
}

public QuarkusPlatformDescriptor resolve() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you could split that big method in a few sub private ones?

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 would if those method would be re-usable in other places. Otherwise, it's not that long and I'm pretty sure it's be changing pretty soon anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I am allergic to long methods 😂 I prefer shorter unit testable ones

@Override
public void execute() throws MojoExecutionException {

validateParameters();
Copy link
Contributor

Choose a reason for hiding this comment

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

@aloubyansky this one is too long too bug I think it's copied code right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really, I actually type it in :)

public static void setupQuarkusJsonPlatformDescriptor(
RepositorySystem repoSystem, RepositorySystemSession repoSession, List<RemoteRepository> repos,
String platformGroupId, String platformArtifactId, String defaultPlatformVersion,
final Log log)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why log is final but not the rest 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

It doesn't have to be now. Originally, it was referenced from an anonymous class, so it had to be final.


@Override
public QuarkusJsonPlatformDescriptor load(QuarkusJsonPlatformDescriptorLoaderContext context) {
context.getMessageWriter().debug("Loading Platform Descriptor from JSON %s", context.getJsonDescriptorFile());
Copy link
Contributor

Choose a reason for hiding this comment

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

too long too :)

Copy link
Member Author

Choose a reason for hiding this comment

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

This is not too long :)

Copy link
Contributor

Choose a reason for hiding this comment

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

it's too long :)

private final MessageWriter log;

public QuarkusLegacyPlatformDescriptor(ClassLoader cl, MessageWriter log) {
this.cl = cl;
Copy link
Contributor

Choose a reason for hiding this comment

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

too much logic for a constructor, this might need a factory?

@geoand
Copy link
Contributor

geoand commented Oct 18, 2019

This is going to need a rebase for the CI fix.

Thanks

<parent>
<groupId>org.jboss</groupId>
<artifactId>jboss-parent</artifactId>
<version>31</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<version>31</version>
<version>36</version>

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@maxandersen
Copy link
Member

just so I don't have to remember in future, context from https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/quarkus-dev/snbwLidlOq8/pbusfmiOAAAJ

"The main purpose of that PR is to detach the project generating and manipulating functionality from the manually maintained extensions.json file stored in the same JAR as the common devtools classes and also make the first step in the direction of making the tooling API not specific to a Quarkus release. Most of the code from devtools/common has been moved to independent-projects/tools for now.

The reason this was done now is for Quarkus 1.0 release we want to also release a so called Quarkus Platform that will include extensions that are in the Quarkus repo plus Camel Quarkus extension which has been developed and maintained in a different repo. The platform will have its own BOM and it's equivalent of the extensions.json file.
So to be able to promote the platform with the extended set of extensions through our tooling and code.quarkus.io, we need to be able to redirect the tools to a different metadata.

The PR introduces basic abstractions to do that, point to a specific release of the platform or look for the latest version of the desired "platform".

The extension.json file is now going to be generated (the previous manually maintained version is not removed, the tools can still be configured to use it as a legacy descriptor) from a BOM. There is a new Maven goal generate-extensions-json that generates a JSON file for a specific BOM by collecting metadata from the extensions it includes.
One such JSON file is now generated during the Quarkus build (devtools/bom-descriptor-json). So in Quarkus at this point we are going to have the legacy extensions.json file (which I kept for now, just in case) and the generated one (which is now the default one).

https://github.com/quarkusio/quarkus-platform will be releasing its own BOM and the JSON descriptor.
So the tools could be pointed to use either the platform metadata or the core Quarkus one.

It's not all perfectly crafted at this point, of course, it's just the first step.
"

platform = mapper.readValue(is, QuarkusJsonPlatformDescriptor.class);
}
} catch (IOException e) {
e.printStackTrace();
Copy link
Member

Choose a reason for hiding this comment

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

should be removed.


public static String getPluginArtifactId() {
return get("plugin-artifactId");
return "quarkus-maven-plugin";
Copy link
Member

Choose a reason for hiding this comment

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

is this really right? same question on the next 2 getters....why isn't this resolving the properties rather than being hardcoded ?

public static String getBomVersionForTemplate() {
final String v = getBomVersion();
if(v.equals(getQuarkusVersion())) {
// this might not always work but at this point we're assuming the bom is coming from Quarkus itself
Copy link
Member

Choose a reason for hiding this comment

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

this would (almost) always be wrong when using a platform wouldn't it ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, in which case we'll use specific version instead of ${quarkus.version}. I left it this way until we adjust the templates and the tests for the platform use-case.

@gsmet
Copy link
Member

gsmet commented Oct 21, 2019

All the native tests are red AFAICS.

@gsmet gsmet modified the milestones: 0.26.0, 0.27.0 Oct 21, 2019
@gsmet
Copy link
Member

gsmet commented Oct 21, 2019

Unfortunately, there's a conflict. I'm rebasing and running the tests. Will push soon.

@gsmet gsmet force-pushed the platform-resolver branch from e180646 to c92f285 Compare October 21, 2019 20:05
@gsmet
Copy link
Member

gsmet commented Oct 21, 2019

Rebased, force pushed and added a commit to exclude the sisu inject dependency from quarkus-core-deployment. Otherwise Kogito was generating a javax.inject.Named file again.

@aloubyansky
Copy link
Member Author

ok, thanks @gsmet

@gsmet gsmet added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Oct 21, 2019
@gsmet gsmet merged commit a6f335f into quarkusio:master Oct 21, 2019
@gsmet gsmet removed the backport? label Oct 21, 2019
@gsmet gsmet modified the milestones: 0.27.0, 0.26.0 Oct 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/platform Issues related to definition and interaction with Quarkus Platform triage/waiting-for-ci Ready to merge when CI successfully finishes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create tooling SPI to allow platform separation

6 participants