Skip to content

When PR already exists, no notification is sent #11

Description

@vincent-fuchs

Summary

When PR already exists but we still try to create one, an exception is thrown. commit has happen, but we don't receive any notification

Ideally, we should use a DirectPush instead of PullRequestGitHubInteraction, but in case we didn't we should still receive a notification

Type of Issue

It is a :

  • [X ] bug
  • request
  • question regarding the documentation

Motivation

Current Behavior


2018-08-14 15:02:25.761 []  WARN 22828 --- [github-events-1] c.s.c.t.c.i.ActionToPerformListener      : some unexpected error happened

feign.FeignException: status 422 reading FeignRemoteGitHub#createPullRequest(String,PullRequestToCreate); content:
{"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for ItecFccOsd:sonarMigrationAugust."}],"documentation_url":"https://developer.github.com/enterprise/2.13/v3/pulls/#create-a-pull-request"}
	at feign.FeignException.errorStatus(FeignException.java:62)
	at feign.codec.ErrorDecoder$Default.decode(ErrorDecoder.java:91)
	at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:138)
	at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:76)
	at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:103)
	at com.sun.proxy.$Proxy104.createPullRequest(Unknown Source)
	at com.societegenerale.cidroid.tasks.consumer.services.ActionToPerformService.createPrOnBranch(ActionToPerformService.java:207)
	at com.societegenerale.cidroid.tasks.consumer.services.ActionToPerformService.createPullRequest(ActionToPerformService.java:90)
	at com.societegenerale.cidroid.tasks.consumer.services.ActionToPerformService.perform(ActionToPerformService.java:74)
	at com.societegenerale.cidroid.tasks.consumer.infrastructure.ActionToPerformListener.onActionToPerform(ActionToPerformListener.java:70)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:180)


Expected Behavior

Exception should be caught (logged as warn), and flow should continue normally so that notification is sent.

Steps to Reproduce (for bugs)

Your Environment

  • Version used: 1.03
  • OS and version:
  • Version of libs used:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions