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 Resource: Derive API URL from PR URL #1817

Merged
merged 1 commit into from
Jan 7, 2020

Conversation

wlynch
Copy link
Member

@wlynch wlynch commented Jan 7, 2020

Changes

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

/cc @a-roberts

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Release Notes

PullRequest resource fixed to support custom URLs for hosted instances.

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Jan 7, 2020
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 7, 2020
- [Overriding where resources are copied from](#overriding-where-resources-are-copied-from)
- [Resource Status](#resource-status)
- [Optional Resources](#optional-resources)
- [Variable substitution](#variable-substitution)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting nit: this is the first time i've seen the three-spaces-for-bullets formatting. looks like it's only for this doc? Might be a formatting error. Suggest changing all bullets to single space ala -

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're already using it inconsistently throughout this file already (the - [Syntax](#syntax) parent uses the 3 space bullet).

(though it's entirely possible that my autoformatter is responsible for all of these 😅)

I added an AI to the productivity WG to define a standard formatter for us to recommend everyone. Until then, ¯_(ツ)_/¯

docs/resources.md Outdated Show resolved Hide resolved
@ghost
Copy link

ghost commented Jan 7, 2020

minor nits. otherwise lgtm.

/lgtm

@tekton-robot tekton-robot assigned ghost Jan 7, 2020
@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label 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 tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 7, 2020
@ghost
Copy link

ghost commented Jan 7, 2020

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 7, 2020
@ghost
Copy link

ghost commented Jan 7, 2020

/approve

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbwsg

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 7, 2020
@tekton-robot tekton-robot merged commit aeef18d into tektoncd:master Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PullRequest SCM Resource does not work with Custom URLs
3 participants