Skip to content

Conversation

@dhananjay12
Copy link
Contributor

@dhananjay12 dhananjay12 commented Sep 10, 2021

Using the openapi-generator-maven-plugin to generate sources from boat-maven-plugin-api.yaml. Using Feign for internal requests. The dependencies were taken from the sample here.

For test using mockwebserver to mock the rest call. Using exsisting open-api sample yaml for tests.

@Parameter(property = "artifactId", defaultValue = "${project.artifactId}", required = true)
private String artifactId;

@Parameter(property = "version", defaultValue = "${project.version}", required = true)
Copy link
Contributor

@christopherm-backbase christopherm-backbase Sep 10, 2021

Choose a reason for hiding this comment

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

"The property parameter can be used to allow configuration of the mojo parameter from the command line by referencing a system property that the user sets via the -D option.", hence it is common to namespace them. e.g. boat.radio I would expect there could be other maven plugins/mojos with properties called things like version, or even system properties like username. The output parameter can then be just output with property="boat.radio.output" etc. Although that does make the command line longer, indeed a lot of Apaches maven plugins don't do this e.g. https://maven.apache.org/plugins/maven-dependency-plugin/get-mojo.html, just something to consider...

Copy link
Contributor

Choose a reason for hiding this comment

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

boat-bay radio is to be executed on spec projects as created by the ssdk archetype. We should inherit the GAV from the project. Why make these configurable?

Copy link
Contributor

Choose a reason for hiding this comment

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

GAV?

Copy link
Contributor Author

@dhananjay12 dhananjay12 Sep 13, 2021

Choose a reason for hiding this comment

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

I was a bit confused about where the plugin would be used. We usually have:

  1. specs
  2. api (built from specs)
  3. BOM (reference above)

At the moment, a project can only be registered via BOM (bom are only cal_ver). Can the plugin be used from api/spec level? Or it can only be used from the BOM level only. In that case, I guess I have to unzip and parse through all files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bartveenstra Should we add unzip logic incase the plugin is used from bom.
Or are we planning to add project creation in boatbay other than bom too?

BoatMavenPluginApi api = apiClient.buildClient(BoatMavenPluginApi.class);

UploadRequestBody uploadRequestBody = new UploadRequestBody();
uploadRequestBody.setGroupId(groupId);
Copy link
Contributor

@christopherm-backbase christopherm-backbase Sep 10, 2021

Choose a reason for hiding this comment

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

A lot of plugins allow the use of <artifact> A string of the form groupId:artifactId:version[:packaging[:classifier]].

https://maven.apache.org/plugins/maven-dependency-plugin/get-mojo.html#artifact

Copy link
Contributor

Choose a reason for hiding this comment

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

Contract is specified by boat-bay. So we need to change it there as well to a single string. Might as well change the data model to use this string instead of separate fields?

Copy link
Contributor

Choose a reason for hiding this comment

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

That would have just been a convenience option for the mojo. Technically not important so no need to change anything.

@bartveenstra
Copy link
Contributor

Does this PR invalides #214? If so, please close that PR.

@bartveenstra
Copy link
Contributor

With such a major feature, lets move to 0.15!

@dhananjay12
Copy link
Contributor Author

With such a major feature, lets move to 0.15!

Updated all poms to 0.15.0-SNAPSHOT.

Copy link
Contributor

@bartveenstra bartveenstra left a comment

Choose a reason for hiding this comment

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

Awesome stuff. I want to add some more output to the logging section. Also, I think you can also inject the slf4j logger. I'll add that a bit later today.

@dhananjay12
Copy link
Contributor Author

dhananjay12 commented Sep 13, 2021

@bartveenstra Added 3 conditions to fail the build:

  1. If spec have BREAKING changes. Default - false
  2. If there is a must violation in spec. Default - false
  3. If for boat-bay server responded in error. Default - true

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

88.3% 88.3% Coverage
0.0% 0.0% Duplication

@sophiejanssens sophiejanssens marked this pull request as ready for review September 15, 2021 08:57
@dhananjay12 dhananjay12 merged commit b168377 into main Sep 16, 2021
@santam85 santam85 deleted the upload-mojo branch July 6, 2022 13:51
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.

5 participants