Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

Rescope of Target/To branch triggers 2 RESCOPE_TO events #20

Closed
derekln1 opened this issue Apr 14, 2015 · 7 comments
Closed

Rescope of Target/To branch triggers 2 RESCOPE_TO events #20

derekln1 opened this issue Apr 14, 2015 · 7 comments
Labels

Comments

@derekln1
Copy link

When I update the target/to branch of an open pull request, 2 http requests are sent each with a different ${PULL_REQUEST_FROM_HASH}. One will contain the from commit of the source branch and the other will contain the previous commit of the target branch.

Is it possible to just trigger one http request with the PULL_REQUEST_FROM_HASH being the commit of the source branch?

@tomasbjerre
Copy link
Owner

Ok, just to make sure I get it =)

When pull request, source branch, is updated:

  • The RESCOPED_FROM is sent once and with correct value of ${PULL_REQUEST_FROM_HASH}?

When pull request, target branch, is updated:

  • Only the RESCOPED_TO is sent, it is sent 2 times and with different values of ${PULL_REQUEST_FROM_HASH}?

@derekln1
Copy link
Author

Yes that's correct for both cases when source branch and target branch are updated.

For the case when the target branch is updated, 2 RESCOPED_TO events are sent with different values for ${PULL_REQUEST_FROM_HASH}:

  1. One value will be the latest commit on the source branch
  2. One value will be the previous commit/hash on the target branch.

@tomasbjerre
Copy link
Owner

Ok. As I said in #17, I think I would need to debug it a bit. But I dont have a Stash instance to run it on. And the one in the SDK does not accept pushing any more commits on my installation.

EDIT: A Stash license for 1-10 developers cost $10, so I'll buy one later today =)

I'm pretty sure its:

@eventlistener
public void onEvent(final PullRequestRescopedEvent e) {

Being invoked twice by Stash, but I have no idea why...

@tomasbjerre
Copy link
Owner

I have tried this on a real Stash installation now. But I cant reproduce the bug.

What does:
git log --graph --full-history --all
look like?

What is the response of:
http://localhost:7990/stash/rest/prnfs-admin/1.0/
?

@derekln1
Copy link
Author

Hey Tomas,

I upgraded to your latest release via the Universal Plugin Manager and I was doing a lot of testing and didn't see that issue again lately... I also actually added a fix in my Jenkins job to ignore the extra RESCOPED_TO request (with the wrong from hash). I'll update you if I see the issue again.

The commit graph looks ok.

The response for trying that link was a 404 error "Oops, you've found a dead link".
I wonder if it's because I had a custom build and then upgraded to your official version... i only added in the http POST support in that custom build though.

thanks for the support

@tomasbjerre
Copy link
Owner

Ok, we can close this issue then? An re-open it if problem occurs again.

@derekln1
Copy link
Author

Thanks again, Tomas.

I'll close it now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants