gitlab4j-api icon indicating copy to clipboard operation
gitlab4j-api copied to clipboard

Start a second branch to work on a version 6 of this library?

Open jmini opened this issue 1 year ago • 9 comments

Context:

While there are a lot plans for the future (#817, #924, #925 and other issues with the Next label), it seems that we need also to think short term here.

The most wanted feature is to have a version of this library that is compatible with Spring Framework 6.0 (Spring Boot 3) which requires a Jersey client version update and the package change javax.ws.rs.* -> jakarta.ws.rs.* which is presented in PR https://github.com/gitlab4j/gitlab4j-api/pull/841


Branching model:

It seems reasonable to me to start a second main branch jakarta or 6.x.x or master/6.x.x next to the master branch (our current default branch dedicated to 5.1.0) to put the changes requested by the Spring community to have a version using jakarta.

As commented by @marcelstoer here https://github.com/gitlab4j/gitlab4j-api/pull/841#issuecomment-1348029230 we could have the 2 versions in parallel for a while.

For the branching model, I personally prefer a pattern with forward merge instead of doing cherry-picks.

git-flow

We have 2 main branches:

  • one to work on 5.x.x (the current version, java 8 &javax.ws.rs.* -- could stay the default branch for now)
  • one to work on 6.x.x where we would do have the breaking changes (jakarta.ws.rs.* namespace change in particular)

We always merge in the 5.x.x -> 6.x.x direction, not in the other way around. We are sure that all the changes in 5.x.x are properly merged into 6.x.x.

💡 I wrote a more detailed description about this branching model that we are using in all our projects in my company.


Scope:

If we want to have something quick, I think it makes sense to keep the 6.x.x as close as possible to 5.1.x for now.

So for me this would mean:

  • PR #841
  • PR #895 (maybe)
  • Java 11 as baseline (also not really mandatory)

And do a 6.0.0-rc.1 or a 6.0.0-beta.1 (not sure what is the preferred versioning scheme) really soon, so that we can get feedback from the community that uses Spring.

Other bigger refactoring tasks would be moved to a later version:

  • Elimination of the Jersey client #924
  • Move to java 17
  • Having too much overloaded methods for the same endpoint to handle all the optional parameters
  • Work on the consistency of the Api class.
  • Removal of the support of the GitLab API v3
  • ...

This would make version 6 a breaking version for technical reason. And make an other next major version (which would be version 7), where we could include more functional breaking changes, more cleanups, ... (and so on). We would have more time to figure out what needs to be done with this next major version.


Risk:

The risk of not doing a version compatible with the Spring Boot 3 is to fragment the project (some people will start their one version of this library).

To me this is more important than not being able to do all the breaking changes in one version.

I would also not keep this dual versioning for a too long period of time, because it is time-consuming and requires additional efforts, but in this way I think this is a good way to move forward quickly.


Feedback

This is open for feedback now, maybe we can give us until end of March 2023 to have a decision.

jmini avatar Mar 17 '23 08:03 jmini

👍 for a fast upgrade to Spring 3. Whatever way is the fastest way for you maintainers.

As Jürgen Höller mentioned in his keynote, Spring (Boot) switches to a much faster release cycle. Which in my opinion will also affect the Java ecosystem since Spring is such a huge player.

hemju avatar Mar 17 '23 11:03 hemju

Hi @jmini,

I agree with your proposal. I assigned this to myself. I will create all necessary branches (at least the one for version 6.x).

jabby avatar Mar 29 '23 15:03 jabby

Let me know when the branch is created so that I can start doing the necessary changes.

jmini avatar Apr 04 '23 12:04 jmini

Are there any updates on this issue? I can't find a version 6.x branch yet. Is this PR https://github.com/gitlab4j/gitlab4j-api/pull/943 actually something that will get merged?

hemju avatar Apr 10 '23 18:04 hemju

The branch 6.x to work on 6.x.x was created.

I have started to do the changes.

jmini avatar Apr 11 '23 13:04 jmini

Since name of the branches are now defined, I have updated the Git flow diagram (editable with diagrams.net):

git-flow

Read more about the approach

jmini avatar Apr 11 '23 19:04 jmini

When we implement the separation in multiple modules (see https://github.com/gitlab4j/gitlab4j-api/issues/1067) we can have a jersey 2 implementation next to a jersey 3 implementation.

At this point we will merge 6.x back into main and and work only on the 6.x.x version.

jmini avatar Nov 21 '23 08:11 jmini

Hi. I'm trying to set the merge_commit_template using ProjectApi. I've noticed that it was introduced in 6.X I'm using the 6.0.0-rc.4 maven dependency downloaded from maven central and I don't see those changes in the source code.

Is 6.0.0-rc.4 uploaded to maven central repo? Thank you very much in advance

Best regards

weinbergalfredo avatar Mar 04 '24 20:03 weinbergalfredo

There are a number of changes that landed on main after RC4 was released: https://github.com/gitlab4j/gitlab4j-api/compare/gitlab4j-api-6.0.0-rc.4...main Support for [issue|merge|squash]_branch_template is one of them.

marcelstoer avatar Mar 04 '24 21:03 marcelstoer