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

Adds the possibility to override values while generating the extension.json as described by issue #4320 #4861

Closed
wants to merge 1 commit into from

Conversation

quintesse
Copy link
Contributor

@quintesse quintesse commented Oct 25, 2019

Issue #4320

@@ -59,6 +64,9 @@
@Parameter(property = "bomVersion", defaultValue = "${project.version}")
private String bomVersion;

@Parameter(property = "overridesFile", defaultValue = "${project.basedir}/src/main/resources/extensions-overrides.json")
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems fishy - users can ovveride the name of resources folder - isn't there a more maven agnostic way to look these up ?

Copy link
Member

Choose a reason for hiding this comment

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

${project.build.outputDirectory} the resources will end up being there, also possibly filtered.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using ${project.build.outputDirectory} doesn't seem to work. There's no output directory basically (there's just target, no target/classes)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before I was using ${project.resources[0].resource} but that doesn't work. The expression is probably too complex.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, that's right.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, why is this fishy? All paths are basically overridable, right? I mean is there some way this could be abused?

Copy link
Contributor

Choose a reason for hiding this comment

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

ah this the defaultvalue...oh well then i don't care at this stage - maybe post 1.0 if ever ;)

}
} catch (IOException e) {
throw new IOException("Failed to parse " + descriptor, e);
}
}

private String extensionId(JsonObject extObject) {
return extObject.getString("groupId", "") + "." + extObject.getString("artifactId");
Copy link
Contributor

Choose a reason for hiding this comment

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

this gives a NPE if you forget to put groupid/artifactid in extension entry. need to handle that better.

Copy link
Contributor 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
Contributor

Left a few minor comments - if fixed lets merge it.

One issue is though that using this does not result in categories being in the final document:


{
    "categories": [
        { "name": "Web",
          "id": "web",
          "metadata": {
              "pinned": [
                  "blha",
                  "wodf"
              ]
          }
        }
    ],


    "extensions": [
        {
            "groupId": "io.quarkus",
            "artifactId": "quarkus-core",

            "name": "Quarkus - Core",
            "metadata": {
                "keywords": [
                    "wonka"
                ]
            },
            "description": "monkey",
            "status": "stable"
        }
    ]
}

}
} catch (IOException e) {
throw new IOException("Failed to parse " + descriptor, e);
}
}

private String extensionId(JsonObject extObject) {
return extObject.getString("groupId", "") + "." + extObject.getString("artifactId");
Copy link
Member

Choose a reason for hiding this comment

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

Why not keep the traditional : as a separator? It'll work either way but it'l be more intuitive and easier to read in case we need to display those if it is :.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@quintesse
Copy link
Contributor Author

One issue is though that using this does not result in categories being in the final document:

@maxandersen where is that defined? I don't see anything about a categories section at the toplevel of that document being discussed in the issue?

@maxandersen
Copy link
Contributor

@maxandersen where is that defined? I don't see anything about a categories section at the toplevel of that document being discussed in the issue?

because there aren't any (yet). in this case they are just added during this patching.

@maxandersen
Copy link
Contributor

I expected that just as I added a new "status" property inside extension I could add new "categoreies" property at the root.

@quintesse
Copy link
Contributor Author

@maxandersen well that's very easy to do if you want that :-)

@quintesse
Copy link
Contributor Author

@maxandersen well actually it's not that trivial, now that I think about it. So are you sure you want this? It's not the work (probably 15mins) but it's more about adding features that might need to be maintained etc

@maxandersen
Copy link
Contributor

We need someway to add categories. If not using this patch approach then we can do a separate file and bulk add it in.

Copy link
Contributor

@maxandersen maxandersen left a comment

Choose a reason for hiding this comment

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

lgtm

@maxandersen
Copy link
Contributor

rebased against master and now merged.

@gsmet gsmet added this to the 0.27.0 milestone Oct 29, 2019
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.

None yet

4 participants