Skip to content

Make Maven reactor build work#1522

Merged
k8s-ci-robot merged 1 commit into
kubernetes-client:masterfrom
dsyer:modules
Feb 25, 2021
Merged

Make Maven reactor build work#1522
k8s-ci-robot merged 1 commit into
kubernetes-client:masterfrom
dsyer:modules

Conversation

@dsyer

@dsyer dsyer commented Feb 3, 2021

Copy link
Copy Markdown

This will make IDEs work better (especially VSCode) because
otherwise they cannot compute the classpath for the examples.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 3, 2021
Comment thread examples/examples-release-10/pom.xml Outdated
<parent>
<groupId>io.kubernetes</groupId>
<artifactId>client-java-examples-parent</artifactId>
<version>11.0.1-SNAPSHOT</version>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we want this, do we? This makes these examples part of the overall release build (which definitely messed things up before.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It doesn't get deployed because the parent has <skip>true</true> in the the deploy plugin. What else could go wrong?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The maven release plugin looks for these strings and replaces them every time you run a release.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The trick is to not make your modules break if the project version changes. I don't think this one will. It looks safe to me.

Comment thread examples/pom.xml
<kubernetes.client.version>${project.version}</kubernetes.client.version>
</properties>

<modules>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I explicitly pulled this out last time I did a release because I didn't want these included in the release.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This isn't anything to do with a release. It's just a property that is used to specify a dependency.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The maven release plugin pulls in everything that is referenced by the top level POM (at least it did the last time I ran a release) so including these as sub-modules for this pom causes them to get pulled into a release.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

You can switch off plugins with skip=true (as is done for the deploy plugin in the examples here). But that's probably not what you want - you want to just make sure that the projects don't break if their artifact version changes. I'm pretty sure these ones don't now. The problem is that without this change nothing in the examples is built automatically from the top level, so it's easy to miss something important when refactoring.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The problem is that without this change nothing in the examples is built automatically from the top level, so it's easy to miss something important when refactoring.

my IDE (intellj-idea) won't build the examples unless applying some tricky manual configuration. i suppose we can explicitly skip the deploying steps for the release plugin here's an example configuration

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Actually I don't know because I don't know how the release was performed. Is there a script or something? I don't see it in the Github actions.

@dsyer dsyer Feb 18, 2021

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is strange, for instance, given that I believe the release plugin has been used: https://github.com/kubernetes-client/java/blob/master/pom.xml#L421 (<skip>true</skip> in the parent). I'm not sure that's a good idea. But mvn deploy would work, once the versions were set up correctly. Personally I don't find the release plugin very useful, but if you do want to use it, probably it's best not to disable it at the top level?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@dsyer

The current release process is documented here:
https://github.com/kubernetes-client/java/blob/master/RELEASES.md

I'm definitely open to suggestions about changing/improving the release process, especially if it included a GitHub action for continuous snapshot releases. I currently find the release process quite cumbersome.

Happy for someone who is more knowledgeable than me about releasing things via Maven take a look. What we have was cobbled together by amateurs :)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

A GitHub Action for snapshots would be excellent, but I don't think it's within the scope of this PR. You can easily set one up if you have permission to deploy snapshots somewhere. You could probably ask Sonatype for permission based on whatever credentials you use for the releases.

It looks like there is a bug in the release plugin (https://issues.apache.org/jira/browse/MRELEASE-799) which makes the examples a bit awkward to configure - they have to use a hard-coded version for the kubernetes-api dependencies. That seems like a small price to pay to get this whole thing working properly. (IMO the examples for older versions should just be in a branch in git, but we discussed that before and you didn't agree, so we have to work with this.)

My latest change includes a workaround for that bug, and I tested it by running mvn release:prepare (which failed when it tried to git push the change, but that's expected since I don't have permission).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 it will be great if we can publish snapshots on a daily basis via GH actions automatically

@dsyer dsyer force-pushed the modules branch 3 times, most recently from 8be9448 to 20ebdae Compare February 22, 2021 08:15
@brendandburns

Copy link
Copy Markdown
Contributor

One last question and then I think this is good to go:

Why use 12.0.0 instead of 12.0.0-SNAPSHOT don't we want to use a snapshot version for now so that when we do an actual 12.0.0 release people with local builds of 12.0.0 don't use an old build?

Also, needs a rebase.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 23, 2021
@dsyer

dsyer commented Feb 23, 2021

Copy link
Copy Markdown
Author

Why use 12.0.0 instead of 12.0.0-SNAPSHOT

Duh. That was a mistake (caused by the release plugin, but lets continue to work with that while we have no other easy options). Fixed it when I rebased.

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 23, 2021
Signed-off-by: Dave Syer <dsyer@vmware.com>
@brendandburns

Copy link
Copy Markdown
Contributor

/lgtm
/approve

Thanks for the patience on this one.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 25, 2021
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brendandburns, dsyer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 25, 2021
@k8s-ci-robot k8s-ci-robot merged commit 8dc8659 into kubernetes-client:master Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants