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

PullRequest SCM Resource does not work with Custom URLs #1816

Closed
wlynch opened this issue Jan 7, 2020 · 1 comment · Fixed by #1817
Closed

PullRequest SCM Resource does not work with Custom URLs #1816

wlynch opened this issue Jan 7, 2020 · 1 comment · Fixed by #1817
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@wlynch
Copy link
Member

wlynch commented Jan 7, 2020

Expected Behavior

Be able to use the Pull Request resource for custom URLs (e.g. GitHub Enterprise, self hosted GitLab).

Actual Behavior

PullRequest resources uses default client for GitHub/GitLab, defaulting to the public hosts (e.g. api.github.com).

Additional Info

We should move away from the use of NewDefault() and use New(url) instead.

See tektoncd/experimental#419 for the original report.

/cc @a-roberts

/assign @wlynch

@vdemeester
Copy link
Member

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 7, 2020
wlynch added a commit to wlynch/pipeline that referenced this issue Jan 7, 2020
Currently, we always use the default API URL for all requests, which
means that the PR resource cannot be used with GitHub Enterprise or self
hosted GitLab instances. This changes the behavior to build the API Base
URL from the PR resource if the URL is not the default:

PR URL | API Base URL
-------|-------------
https://github.com | https://api.github.com
https://github.example.com | https://github.example.com/v3/api
https://gitlab.com | https://gitlab.com
https://gitlab.example.com | https://gitlab.example.com

GitHub Documentation: https://developer.github.com/v3/#schema
GitHub Enterprise Documentation:
https://developer.github.com/enterprise/2.17/v3/#schema
GitLab Documentation: https://developer.github.com/enterprise/2.17/v3/#current-version

Fixes tektoncd#1816
wlynch added a commit to wlynch/pipeline that referenced this issue Jan 7, 2020
Currently, we always use the default API URL for all requests, which
means that the PR resource cannot be used with GitHub Enterprise or self
hosted GitLab instances. This changes the behavior to build the API Base
URL from the PR resource if the URL is not the default:

PR URL                     | API Base URL
---------------------------|-------------
https://github.com         | https://api.github.com
https://github.example.com | https://github.example.com/v3/api
https://gitlab.com         | https://gitlab.com
https://gitlab.example.com | https://gitlab.example.com

GitHub Documentation: https://developer.github.com/v3/#schema
GitHub Enterprise Documentation:
https://developer.github.com/enterprise/2.17/v3/#schema
GitLab Documentation: https://developer.github.com/enterprise/2.17/v3/#current-version

Fixes tektoncd#1816
wlynch added a commit to wlynch/pipeline that referenced this issue Jan 7, 2020
Currently, we always use the default API URL for all requests, which
means that the PR resource cannot be used with GitHub Enterprise or self
hosted GitLab instances. This changes the behavior to build the API Base
URL from the PR resource if the URL is not the default:

PR URL                     | API Base URL
---------------------------|-------------
https://github.com         | https://api.github.com
https://github.example.com | https://github.example.com/v3/api
https://gitlab.com         | https://gitlab.com
https://gitlab.example.com | https://gitlab.example.com

GitHub Documentation: https://developer.github.com/v3/#schema
GitHub Enterprise Documentation:
https://developer.github.com/enterprise/2.17/v3/#schema
GitLab Documentation: https://developer.github.com/enterprise/2.17/v3/#current-version

Fixes tektoncd#1816
wlynch added a commit to wlynch/pipeline that referenced this issue Jan 7, 2020
Currently, we always use the default API URL for all requests, which
means that the PR resource cannot be used with GitHub Enterprise or self
hosted GitLab instances. This changes the behavior to build the API Base
URL from the PR resource if the URL is not the default:

PR URL                     | API Base URL
---------------------------|-------------
https://github.com         | https://api.github.com
https://github.example.com | https://github.example.com/v3/api
https://gitlab.com         | https://gitlab.com
https://gitlab.example.com | https://gitlab.example.com

GitHub Documentation: https://developer.github.com/v3/#schema
GitHub Enterprise Documentation:
https://developer.github.com/enterprise/2.17/v3/#schema
GitLab Documentation: https://developer.github.com/enterprise/2.17/v3/#current-version

Fixes tektoncd#1816
tekton-robot pushed a commit that referenced this issue Jan 7, 2020
Currently, we always use the default API URL for all requests, which
means that the PR resource cannot be used with GitHub Enterprise or self
hosted GitLab instances. This changes the behavior to build the API Base
URL from the PR resource if the URL is not the default:

PR URL                     | API Base URL
---------------------------|-------------
https://github.com         | https://api.github.com
https://github.example.com | https://github.example.com/v3/api
https://gitlab.com         | https://gitlab.com
https://gitlab.example.com | https://gitlab.example.com

GitHub Documentation: https://developer.github.com/v3/#schema
GitHub Enterprise Documentation:
https://developer.github.com/enterprise/2.17/v3/#schema
GitLab Documentation: https://developer.github.com/enterprise/2.17/v3/#current-version

Fixes #1816
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants