Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not creating auto MR in GitLab when we use fast forward merge strategy #34

Closed
aswiniabi opened this issue Oct 8, 2024 · 1 comment · Fixed by #35
Closed

Not creating auto MR in GitLab when we use fast forward merge strategy #34

aswiniabi opened this issue Oct 8, 2024 · 1 comment · Fixed by #35

Comments

@aswiniabi
Copy link

We tested ucascade with gitlab project which is having fast forward merge strategy and its not creating the auto MR. We got this below error , Exception while creating auto merge request. Project: '58879255', User: '19282984', SourceBranch: 'dev/1.2.x', TargetBranch: 'develop', MergeRequestNumber: '8', MergeSha: 'null'\njava.lang.IllegalArgumentException: ref cannot be empty or null\n\tat org.gitlab4j.api.AbstractApi.addFormParam(AbstractApi.java:645)\n\tat org.gitlab4j.api.RepositoryFileApi.getFile(RepositoryFileApi.java:169)\n\tat org.gitlab4j.api.RepositoryFileApi.getFile(RepositoryFileApi.java:123)\n\tat service.GitLabService.getBranchModelConfigurationFile(GitLabService.java:486)\n\tat service.GitLabService.createAutoMr(GitLabService.java:202)\n\tat service.GitLabService.handleMrMergeEvent(GitLabService.java:135)\n\tat service.GitLabService.mergeRequest(GitLabService.java:94)\n\tat service.GitLabService_ClientProxy.mergeRequest(Unknown Source)\n\tat service.GitLabService_VertxInvoker_mergeRequest_a4d1c2c568052411df78f735c61ae86d3766853c.invokeBean(Unknown Source)\n\tat io.quarkus.vertx.runtime.EventConsumerInvoker.invoke(EventConsumerInvoker.java:41)\n\tat io.quarkus.vertx.runtime.VertxRecorder$3$1$1.handle(VertxRecorder.java:116)\n\tat io.quarkus.vertx.runtime.VertxRecorder$3$1

There was an error rendering this math block. KaTeX parse error: Undefined control sequence: \n at position 33: …order.java:112)\̲n̲\tat io.vertx.c…
null

There was an error rendering this math block. KaTeX parse error: Undefined control sequence: \n at position 24: …tBase.java:137)\̲n̲\tat io.vertx.c…
executeBlocking$1(ContextBase.java:135)\n\tat io.quarkus.vertx.core.runtime.VertxCoreRecorder

There was an error rendering this math block. KaTeX parse error: Undefined control sequence: \n at position 39: …order.java:576)\̲n̲\tat org.jboss.…
Task.run(EnhancedQueueExecutor.java:2449)\n\tat org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)\n\tat org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)\n\tat org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)\n\tat io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\n\tat java.base/java.lang.Thread.run(Thread.java:833)\n","severity":"WARNING","timestamp":{"seconds":1727366774,"nanos":252056398},"logging.googleapis.com/sourceLocation":{"file":"GitLabService.java","line":"137","function":"service.GitLabService.handleMrMergeEvent"}}.

We gone through the code for cascading request and found object_attributes.merge_commit_sha is being sent as null but the solution appears to require it to have the value found in object_attributes.merge_params.sha. Please assist.
image001

fbpe added a commit that referenced this issue Oct 10, 2024
When the fast-forward merge strategy is used, there is no merge commit SHA. In this case, we use the last commit SHA as ref
Ref #34
fbpe added a commit that referenced this issue Oct 10, 2024
When the fast-forward merge strategy is used, there is no merge commit SHA. In this case, we use the last commit SHA as ref
Ref #34
fbpe added a commit that referenced this issue Oct 10, 2024
When the fast-forward merge strategy is used, there is no merge commit SHA. In this case, we use the last commit SHA as ref
Ref #34

Co-authored-by: Fábio Pereira <[email protected]>
@fbpe fbpe closed this as completed in #35 Oct 10, 2024
@fbpe
Copy link
Contributor

fbpe commented Oct 10, 2024

We managed to reproduce the problem when the merge is done without a merge commit (fast-forward).

With #35 we are adding support to the FF strategy. Please try it out and let us know.

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 a pull request may close this issue.

2 participants