-
Notifications
You must be signed in to change notification settings - Fork 100
Fails to fetch changes when pull request is made from a 'master' branch #33
Comments
Let me dive into this a little more. It was requested a while back that It's interesting this is the first time that this is come up. |
I see the PR that originally caused this. I've reached out to the original author for some clarification in their workflow. I don't want to break anything or make it backwards incompatible. Please expect this to be resolved shortly. |
This should have been resolved in f6210c9. The checkout branch name is being prefixed with |
Please reopen this issue if you have problems with it passed v15 release. |
Tested with the v15 release, but got an error:
|
Gah! |
I don't understand. I've tested this with the reproducing instructions you provided. This is the PR I am testing with. Do you see anything wrong with the PR? |
The reproducing steps from the
Any insight in the git repo you have would be great or minimal steps to reproduce. Sorry the above is stream of thought. |
I can't reproduce the error when following those commands on my repo. It seems something different is actually happening when running the v15 of the pullrequest-resource in my pipeline. Sorry I don't have time to investigate right now, but when I next get a chance I'll try building it myself and see if I can isolate it better for you. Might be a couple of days before I can do this. In the meantime perhaps setup a pipeline to reproduce? |
(╯°□°)╯︵ ┻━┻ I've recreated the issue with a pipeline. When I hijack the container and run the exact set of commands, it works fine. 👎 This is going to take some more debugging. Capturing the
|
@jtarchie What I've observed is that when there's a PR made to |
@vito I understand conceptually, but I don't know what to do. You think this problem would occur with people checking out PRs locally, but Google is pretty barren on this. |
@nathgs, it turns out I did solve it. It's just I forgot to rebuild the docker image and push that out. Woops. Please try again. |
@jtarchie It's working now. Thanks for following up on this and getting it sorted so quickly! Time to make a pipeline that automates the releasing of the pullrequest-resource docker image ;-) |
…nch issue Signed-off-by: Karthikeyan Jambu Rajaraman <[email protected]>
The pullrequest-resource
in
outputs the following error, but doesn't fail completely:This results in strange behaviour where the pullrequest-resource has cloned the git repository, but not fetched the changes from the pull request. The subsequent steps in the build plan continue to execute without including the pull request changes.
Steps to reproduce:
usera/repo
userb/repo
master
ofuserb/repo
(it's important the change is made inmaster
) and create a pull request fromuserb/repo:master
tousera/repo:master
in
for the pullrequest-resourceExpected outcome:
The
in
of pullrequest-resource should fetch the changes from the pull request we should see the changes fromuserb/repo:master
in Concourse.Actual outcome:
The
in
of pullrequest-resource fails to fetch the changes from the pull request. It also doesn't fail in an obvious way it outputs the error but then exits with success. We see only the contents ofusera/repo:master
in Concourse.This only happens when the pull request is made from the
master
branch of the fork. The asset/lib/in.rb seems to assume the pull request is made from a branch other thanmaster
branch_ref = pr['head']['ref']
what happens in this case isbranch_ref = 'master'
and thensystem("git fetch -q origin pull/#{id}/head:#{branch_ref} 1>&2")
results in theAlready on 'master'
error. Quick workaround hack is to hardcodebranch_ref = 'tmp'
, but that has other implications so not a full solution.The text was updated successfully, but these errors were encountered: