NPE when merge base is not found
See original GitHub issueWhen I set compareToMergeBase
to true, and don’t ensure that I have all the refs properly fetched, I’m getting an NPE. There should be an actionable error message instead.
org.apache.maven.MavenExecutionException: Failed to execute gitflow-incremental-builder.
at com.vackosar.gitflowincrementalbuild.boundary.MavenLifecycleParticipant.perform (MavenLifecycleParticipant.java:94)
at com.vackosar.gitflowincrementalbuild.boundary.MavenLifecycleParticipant.afterProjectsRead (MavenLifecycleParticipant.java:64)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:264)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:61)
Caused by: java.lang.NullPointerException
at com.vackosar.gitflowincrementalbuild.control.DifferentFiles$Worker.getMergeBase (DifferentFiles.java:166)
at com.vackosar.gitflowincrementalbuild.control.DifferentFiles$Worker.resolveReference (DifferentFiles.java:232)
at com.vackosar.gitflowincrementalbuild.control.DifferentFiles$Worker.getBranchDiff (DifferentFiles.java:105)
at com.vackosar.gitflowincrementalbuild.control.DifferentFiles$Worker.access$200 (DifferentFiles.java:87)
at com.vackosar.gitflowincrementalbuild.control.DifferentFiles.get (DifferentFiles.java:64)
at com.vackosar.gitflowincrementalbuild.control.ChangedProjects.get (ChangedProjects.java:42)
at com.vackosar.gitflowincrementalbuild.boundary.UnchangedProjectsRemover.doAct (UnchangedProjectsRemover.java:107)
at com.vackosar.gitflowincrementalbuild.boundary.UnchangedProjectsRemover.act (UnchangedProjectsRemover.java:70)
at com.vackosar.gitflowincrementalbuild.boundary.MavenLifecycleParticipant.perform (MavenLifecycleParticipant.java:87)
at com.vackosar.gitflowincrementalbuild.boundary.MavenLifecycleParticipant.afterProjectsRead (MavenLifecycleParticipant.java:64)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:264)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:61)
Looks like adding a check if commit is not null would be enough: https://github.com/gitflow-incremental-builder/gitflow-incremental-builder/blob/master/src/main/java/com/vackosar/gitflowincrementalbuild/control/DifferentFiles.java#L164
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
git merge-base not working on merged branch - Stack Overflow
I have to make bash script which copy all commits from branch1 to another branch. If my branch was not merged then I...
Read more >integration plan not found when trying to start branch ... - Jira
After moving a plan with branch plans and automatic branch merging ... NullPointerException: integration plan PROJ-PLAN not found at com.google.common.base.
Read more >git-merge-base Documentation - Git
Compute the best common ancestors of all supplied commits, in preparation for an n-way merge.
Read more >Merger (JGit - Core 5.13.1.202206130422-r API) - javadoc.io
A RevWalk for computing merge bases, or listing incoming commits. ... IOException - the tree object is not found or cannot be read....
Read more >Repository.merge_base complains when the merge base is a ...
Rugged::Repository.merge_base complains when the merge base is a graft ... show_merge_base.rb:9:in `merge_base': object not found - no match ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks a lot, it’s always good to know how people are trying to use GIB!
FWIW, I integrated GIB in Quarkus via GH actions. I also ran into that depth problem and simply went for
fetch-depth: 0
, which hasn’t caused any issues thus far. Quarkus with ~27k commits is very similar to trino with ~25k so this might be worth a try.If you are interested, this is the main bit of GIB config in the Quarkus incremental CI: https://github.com/quarkusio/quarkus/blob/main/.github/workflows/ci-actions-incremental.yml#L135-L157 There is also a bit here: https://github.com/quarkusio/quarkus/blob/main/pom.xml#L303-L323
The setup is actually rather complex and is the result of multiple iterations to squeeze out the incremental approach as much as possible, which includes a dedicated job that controls whether subsequent ones are even started: https://github.com/quarkusio/quarkus/blob/main/.github/workflows/ci-actions-incremental.yml#L187-L229 (usage of those flags e.g.: https://github.com/quarkusio/quarkus/blob/main/.github/workflows/ci-actions-incremental.yml#L236)
Disclaimer: The full Quarkus CI consists of over 40 (!) jobs, so skipping an unrelated job entirely (or even multiple ones) is very desirable.
I can elaborate more if you like.
Btw, there is also a discussions section: https://github.com/gitflow-incremental-builder/gitflow-incremental-builder/discussions