Details
-
Bug
-
Resolution: Duplicate
-
Low
-
None
-
None
Description
As specified in the document https://confluence.atlassian.com/display/STASH/Automatic+branch+merging, Automatic Branch Merging demands the use of semantic versioning in branch names. The suggestion is to reinforce this in the UI when this option is configured and a branch is being created (so maybe when creating a new branch, the user would be advised about the semantic versioning and/or Stash would even stop the customer from creating a branch that not attend to this rule).
Currently if this option is on and the user tries a merge using branches that do not attend to the semantic versioning an error occurs, not being clear about why it failed. The following is shown in the UI:
In the log:
2014-09-15 15:50:42,630 ERROR [http-bio-7990-exec-10] grefosco @1P3MBDHx950x235x0 55c8v1 fe80:0:0:0:0:0:0:1%1 "GET /rest/branch-utils/latest/projects/PROJ/repos/stash320two/automerge/path HTTP/1.1" c.a.s.r.e.UnhandledExceptionMapper Unhandled exception while processing REST call java.lang.IndexOutOfBoundsException: index (-1) must not be negative at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:301) ~[guava-11.0.2-atlassian-01.jar:na] at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:280) ~[guava-11.0.2-atlassian-01.jar:na] at com.google.common.collect.RegularImmutableList.get(RegularImmutableList.java:91) ~[guava-11.0.2-atlassian-01.jar:na] at com.atlassian.stash.internal.branch.model.version.BranchVersion.componentAt(BranchVersion.java:155) ~[stash-branch-utils-3.2.0_1406717432000.jar:na] at com.atlassian.stash.internal.branch.model.version.BranchVersion.compareTo(BranchVersion.java:67) ~[stash-branch-utils-3.2.0_1406717432000.jar:na] at com.atlassian.stash.internal.branch.model.version.VersionedBranch.compareTo(VersionedBranch.java:84) ~[stash-branch-utils-3.2.0_1406717432000.jar:na] at com.atlassian.stash.internal.branch.model.version.VersionedBranch$4.apply(VersionedBranch.java:77) ~[stash-branch-utils-3.2.0_1406717432000.jar:na] at com.atlassian.stash.internal.branch.model.version.VersionedBranch$4.apply(VersionedBranch.java:74) ~[stash-branch-utils-3.2.0_1406717432000.jar:na] at com.google.common.base.Predicates$AndPredicate.apply(Predicates.java:338) ~[guava-11.0.2-atlassian-01.jar:na] at com.google.common.collect.Iterators$7.computeNext(Iterators.java:649) ~[guava-11.0.2-atlassian-01.jar:na] at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143) ~[guava-11.0.2-atlassian-01.jar:na] at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) ~[guava-11.0.2-atlassian-01.jar:na] at com.google.common.collect.Lists.newArrayList(Lists.java:138) ~[guava-11.0.2-atlassian-01.jar:na] at com.google.common.collect.Lists.newArrayList(Lists.java:119) ~[guava-11.0.2-atlassian-01.jar:na] at com.google.common.collect.NaturalOrdering.sortedCopy(NaturalOrdering.java:57) ~[guava-11.0.2-atlassian-01.jar:na] at com.google.common.collect.Ordering.immutableSortedCopy(Ordering.java:534) ~[guava-11.0.2-atlassian-01.jar:na] at com.atlassian.stash.util.Chainable.sort(Chainable.java:102) ~[stash-util-3.2.0.jar:na] at com.atlassian.stash.internal.branch.model.SimpleBranchModel.getMergePath(SimpleBranchModel.java:72) ~[stash-branch-utils-3.2.0_1406717432000.jar:na] at com.atlassian.stash.internal.branch.automerge.DefaultAutoMergeService$$anonfun$getDownstreamBranches$2.apply(DefaultAutoMergeService.scala:44) ~[stash-branch-utils-3.2.0_1406717432000.jar:na] at com.atlassian.stash.internal.branch.automerge.DefaultAutoMergeService$$anonfun$getDownstreamBranches$2.apply(DefaultAutoMergeService.scala:44) ~[stash-branch-utils-3.2.0_1406717432000.jar:na] at scala.util.Either$RightProjection.map(Either.scala:536) ~[scala-2.10-provider-plugin-0.5.jar:na] at com.atlassian.stash.internal.branch.automerge.DefaultAutoMergeService.getDownstreamBranches(DefaultAutoMergeService.scala:44) ~[stash-branch-utils-3.2.0_1406717432000.jar:na] at com.atlassian.stash.internal.branch.automerge.DefaultAutoMergeService.getAutoMerge(DefaultAutoMergeService.scala:16) ~[stash-branch-utils-3.2.0_1406717432000.jar:na] at com.atlassian.stash.internal.branch.automerge.rest.AutoMergeResource.getMergePath(AutoMergeResource.java:59) ~[stash-branch-utils-3.2.0_1406717432000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) [applinks-plugin-4.2.2_1406629200000.jar:na] at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:86) [StashAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:111) [BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:77) [BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:100) [atlassian-trusted-apps-core-3.0.6.jar:na] at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:69) [atlassian-oauth-service-provider-plugin-1.9.2_1406629200000.jar:na] at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:33) [analytics-client-3.35_1406629204000.jar:na] at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) [atlassian-core-4.6.15.jar:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:89) [BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75) [BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:84) [stash-service-impl-3.2.0.jar:na] at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:446) [hazelcast-wm-3.3-RC2.jar:3.3-RC2] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_51] at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51] ... 198 frames trimmed
Steps to reproduce:
- Create a repository, enabling Automatic merge.
- Commit something to master.
- Create a branch release/next-big-release from master.
- Create a branch feature/AU-32 from next-big-release.
- Commit something to feature/AU-32 and push to the repo.
- Create a Pull Request from feature/AU-32 to release/next-big-release.
- Try to Merge, than the error occurs.
I found, however, if the user just closes the error message and tries to Merge again, it works.
Attachments
Issue Links
- duplicates
-
BSERV-5262 Auto merge fails with runtime exception when release branches don't have a number in the name
- Closed