-
Notifications
You must be signed in to change notification settings - Fork 8
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
git failed: exit status 128 #35
Comments
Hey! Could you include a trimmed down version of your pipeline definition, or just the part that shows your source configuration for the resource? |
@itsdalmo, they are referring to the fact that basic auth can be used with an |
@itsdalmo Sure, here it is: ---
resource_types:
- name: pull-request
type: docker-image
source:
repository: jtarchie/pr
tag: latest
registry_mirror: https://docker.mycompany.com
resources:
- name: pr-code
type: pull-request
source:
repo: my_org/code_repo
access_token: ((ci.personal_access_token))
uri: https://github.mycompany.com/my_org/code_repo
base: develop
private_key: ((ci.private_key))
api_endpoint: https://github.mycompany.com/api/v3/
disable_forks: false
only_mergeable: true
require_review_approval: false
username: ((ci.name))
password: ((ci.password))
ci_skip: true
skip_ssl_verification: true
webhook_token: ((token.webhook))
jobs:
- name: unit-tests
max_in_flight: 3
build_logs_to_retain: 5
disable_manual_trigger: true
plan:
- get: pr-code
trigger: true
params:
version: every
fetch_merge: true
- put: pr-code
params:
path: pr-code
status: pending
context: unit-tests
- task: unit-test
file: pr-code/ci/tasks/unit_test.yml
input_mapping: {code_src: pr-code}
params:
ci.private_key: ((ci.private_key))
GITHUB_TOKEN: ((ci.personal_access_token))
SLACK_WEBHOOK_URL: ((token.slack))
on_success:
put: pr-code
params:
path: pr-code
status: success
context: unit-tests
on_failure:
put: pr-code
params:
path: pr-code
status: failure
context: unit-tests @jtarchie I think you're correct. |
Thanks @jtarchie! The resource should already use https for the @TG-KK - Did your source configuration look a little something like the example below when using resource_types:
- name: pull-request
type: docker-image
source:
repository: teliaoss/github-pr-resource
tag: latest
resources:
- name: pr-code
type: pull-request
source:
repository: my_org/code_repo
access_token: ((ci.personal_access_token))
v3_endpoint: https://github.mycompany.com/api/v3/
v4_endpoint: https://github.mycompany.com/api/v4/ # Just examples
disable_ci_skip: false
webhook_token: ((token.webhook)) (Note: This resource is not a drop-in replacement for the |
@itsdalmo Sorry for delay! Here is the older config, where I get git exit 128 error: ---
resource_types:
- name: pull-request
type: docker-image
source:
repository: teliaoss/github-pr-resource
tag: latest
registry_mirror: https://docker.artifactory.mycompany.com
resources:
- name: pr-code
type: pull-request
source:
repository: my_org/code_repo
access_token: ((ci.personal_access_token))
v3_endpoint: https://github.mycompany.com/api/v3/
v4_endpoint: https://github.mycompany.com/api/graphql
webhook_token: ((token.webhook))
jobs:
- name: unit-tests
max_in_flight: 3
build_logs_to_retain: 5
disable_manual_trigger: false
plan:
- get: pr-code
trigger: true
params:
version: every
fetch_merge: true
- put: pr-code
params:
path: pr-code
status: pending
context: unit-tests
- task: unit-test
file: pr-code/ci/tasks/unit_test.yml
input_mapping: {code_src: pr-code}
params:
ci.private_key: ((ci.private_key))
GITHUB_TOKEN: ((ci.personal_access_token))
SLACK_WEBHOOK_URL: ((token.slack))
on_success:
put: pr-code
params:
path: pr-code
status: success
context: unit-tests
on_failure:
put: pr-code
params:
path: pr-code
status: failure
context: unit-tests |
Thanks @TG-KK! A successful
In your case you successfully initialise git, but fail before switching branch, which means the error has to occur somewhere in this area of the code: https://github.com/telia-oss/github-pr-resource/blob/master/in.go#L27-L38 Out of So it seems like If that is not the case, then I'll need to get some more information - perhaps you could run the following (which should be equivalent to what the resource would do) and see what happens? docker run -it --rm --entrypoint /bin/sh teliaoss/github-pr-resource:latest -c "
mkdir source && cd source
git init
git config user.name concourse-ci
git config user.email concourse@local
git pull https://x-access-token:<TOKEN>@github.mycompany.com/my_org/code_repo.git
ls -la
git rev-parse --verify master
echo exit code: $?
" And change |
@TG-KK - I've added more context to the rev-parse error in #40, which has now been merged and should be available under the source:
repository: teliaoss/github-pr-resource
tag: dev <--- INSTEAD OF LATEST
registry_mirror: https://docker.artifactory.mycompany.com
We should hopefully get a better idea about what is going on 😆 |
Ok, here is the output for docker run: + mkdir source
+ cd source
+ git init
Initialized empty Git repository in /git/source/.git/
+ git config user.name my_username
+ git config user.email my_email
+ git pull https://x-access-token:[email protected]/my_org/code_repo.git
remote: Counting objects: 3705, done.
remote: Total 3705 (delta 0), reused 0 (delta 0), pack-reused 3705
Receiving objects: 100% (3705/3705), 2.98 MiB | 402.00 KiB/s, done.
Resolving deltas: 100% (2339/2339), done.
From https://github.mycompany.com/my_org/code_repo
* branch HEAD -> FETCH_HEAD
+ ls -la
total 172
<list of files redacted>
+ git rev-parse --verify develop
fatal: Needed a single revision
+ echo exit code: 2
exit code: 2
bash-4.4$ Let me give a try on running with dev tag image. |
@TG-KK - The PR has been merged now and the changes are live under the |
@itsdalmo Thank you so much, PR now works when using the |
Great to hear! I'll close the issue now and make a new release 👍 |
Till now I was using jtarchie's pr resource, as that image has git username param. Whenever I used telia-oss version, I got the below error in the resource check itself:
SO says it could be due to missing username and email, and indeed the error disappeared when I used jtarchie's resource along with username param.
But now, since he's retiring his resource(#34), I think we need to add username param into this resource as well.
The text was updated successfully, but these errors were encountered: