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

Credential issue with gitlab provider #193

Open
edramos-97 opened this issue Nov 8, 2023 · 1 comment
Open

Credential issue with gitlab provider #193

edramos-97 opened this issue Nov 8, 2023 · 1 comment

Comments

@edramos-97
Copy link

edramos-97 commented Nov 8, 2023

cli version: 1.39
Hi!

I'm experiencing a credential issue, more specifically using the gitlab provider when requesting to create a pull request the commits fail to fetch. Following are my job configuration and partial output

job:
  package-manager: npm_and_yarn
  allowed-updates:
    - dependency-type: direct
      update-type: all
  source:
    provider: gitlab
    hostname: example.com
    api-endpoint: https://example.com/api/v4
    repo: my-project
    directory: /my-folder
credentials:
  - type: git_source
    host: example.com
    password: token
updater | 2023/11/08 10:57:07 INFO Submitting @apollo/client pull request for creation
proxy | 2023/11/08 10:57:15 [119] GET https://example.com:443/api/v4/projects/my-project/repository/commits?
proxy | 2023/11/08 10:57:15 [119] * authenticating git server request (host: example.com)
proxy | 2023/11/08 10:57:15 [119] 404 https://example.com:443/api/v4/projects/my-project/repository/commits?
proxy | 2023/11/08 10:57:15 [119] * auth'd git request returned 404, retrying without auth
proxy | 2023/11/08 10:57:15 [119] * de-auth'd request returned 404, ignoring response

I've looked through the codebase and noticed the dependency on the gitlab api ruby project so I did some testing with that one to understand where the problem lies and found that project to be working fine running the following command.
gitlab commits my-project

@arielsrv
Copy link

arielsrv commented Nov 15, 2023

I think the problem is that it doesn't propagate the token in the PRIVATE_TOKEN header, more info here: https://docs.gitlab.com/ee/api/commits.html.

Steps to reproduce in your code:
curl 'https://example.com:443/api/v4/projects/my-project/repository/commits?'
curl -H 'PRIVATE-TOKEN: token' 'https://example.com:443/api/v4/projects/my-project/repository/commits?'

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

No branches or pull requests

2 participants