Skip to content

Conversation

@HannesWell
Copy link
Member

This simplifies trying out changes in a submodule and their effect on the entire Eclipse-SDK in advance. Instead of always fetching the latest commit from the master branch of the specified remote, fetch the latest commit of the branch specified in .gitmodules from each submodule's remote (also specified in .gitmodules).

In order to try out a change with the entire Eclipse-SDK, now one just has to update the affected submodules in the .gitmodules file to point to the git-repository and the branch providing the change(s).

Before, one either had to push changes to the 'master' branch of the alternative repository providing a change or had to disable the fetch in this Jenkins pipeline and record the change's commit in this aggregator repository along with changing the of the remote in .gitmodules. Of course all of this had to be known.

Additionally add a comment explaining how to archive the just built product with a Jenkins build.

@HeikoKlare IIRC you recently had difficulties to try out a change from a fork in the Eclipse-SDK. This should make it much simpler.

@laeubi
Copy link
Contributor

laeubi commented Apr 27, 2025

I always though this was by intention... Would it not mean that we now can't verify changes outside before updating submodule manually?

@HeikoKlare
Copy link
Contributor

If I understand correctly, this change should basically do nothing but making it easier to consistently modify the submodules (i.e., remote and maybe branch) for testing, doesn't it? The problem was that Jenkins builds used master branch in a hard-coded way while you can now just change the branch to be taken in the .gitmodules, right?

But how does that relate to the version information of the submodules themselves (i.e., the references commit or tag id)? Will the commit/tag be taken unless you do a git submodule update --remote?

@HannesWell
Copy link
Member Author

If I understand correctly, this change should basically do nothing but making it easier to consistently modify the submodules (i.e., remote and maybe branch) for testing, doesn't it? The problem was that Jenkins builds used master branch in a hard-coded way while you can now just change the branch to be taken in the .gitmodules, right?

That's all correct.
By default Jenkins checks out the submodules at the commit-Ids recorded in this aggregator repository (like if you performed git submodule update or Update submodule on the Submodules element of a repository in EGit's Git Repositories view).

To quote from the git submodule update documentation:

Update the registered submodules to match what the superproject expects by cloning missing submodules, fetching missing commits in submodules and updating the working tree of the submodules. The "updating" can be done in several ways [...]. If neither is given, a checkout is performed.

checkout
    the commit recorded in the superproject will be checked out in the submodule on a detached HEAD.

In the current state (before this change) the Jenkins pipeline just always fetched the latest commit of the master branch at the specified remote of each submodule. This PR changes that to fetch the latest commit of the branch specified in .gitmodules at the specified remote of the respective submodule. By default that branch is the master branch, even if no branch is specified in the .gitmodules file. Nevertheless I specified the default explicitly to make it simpler to change the branch as well, as PRs are usually not created at the master branch of a fork.

To make a long story short. For the default case, i.e. with outh modifications everything stays (or should stay) as it is now, it just becomes simpler to change a submodule to a different repo and branch.

@HannesWell HannesWell force-pushed the build-latest-submodule-remote branch 2 times, most recently from 7889a56 to 96f6081 Compare May 1, 2025 19:06
This simplifies trying out changes in a submodule and their effect on
the entire Eclipse-SDK in advance. Instead of always fetching the latest
commit from the master branch of the specified remote, fetch the latest
commit of the branch specified in '.gitmodules' from each submodule's
remote (also specified in '.gitmodules'). On the CLI this can be
archived by the following command:
'''
git submodule update --remote
'''
But since the Jenkins job is already configured to checkout the
submodules this way, nothing actually has to be done and the
corresponding stage can just be removed.

In order to try out a change with the entire Eclipse-SDK, now one just
has to update the affected submodules in the '.gitmodules' file to
point to the git-repository and the branch providing the change(s).

Before, one either had to push changes to the 'master' branch of the
alternative repository providing a change or had to disable the fetch in
this Jenkins pipeline and record the change's commit in this aggregator
repository along with changing the of the remote in '.gitmodules'.
Of course all of this had to be known.

Additionally add a comment explaining how to archive the just built
product with a Jenkins build.
@HannesWell HannesWell force-pushed the build-latest-submodule-remote branch from 96f6081 to 1ea2bbd Compare May 1, 2025 20:45
@HannesWell
Copy link
Member Author

My final testing revealed that actually the Jenkins multibranch-pipeline job is already configured to have exactly the desired behavior:
grafik

I assume that was configured after the stage was introduced. So we can actually just remove the corresponding stage.

@HannesWell HannesWell merged commit f6f6263 into eclipse-platform:master May 2, 2025
6 checks passed
@HannesWell HannesWell deleted the build-latest-submodule-remote branch May 2, 2025 08:41
HannesWell added a commit to HannesWell/eclipse.platform.releng.aggregator that referenced this pull request Sep 8, 2025
This prevents maintenance branches from fetching the latest changes on
the master branches of all submodules and therefore failing all builds
early (because the submodule expect a newer parent-pom version).

Follow-up on:
- eclipse-platform#3000
HannesWell added a commit to HannesWell/eclipse.platform.releng.aggregator that referenced this pull request Sep 8, 2025
This prevents maintenance branches from fetching the latest changes on
the master branches of all submodules and therefore failing all builds
early (because the submodule expect a newer parent-pom version).

Follow-up on:
- eclipse-platform#3000
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.

3 participants