diff --git a/pullrequest/OWNERS b/pullrequest/OWNERS new file mode 100644 index 0000000000..4642a8a098 --- /dev/null +++ b/pullrequest/OWNERS @@ -0,0 +1,4 @@ +approvers: +- bobcatfish +- wlynch +- chmouel \ No newline at end of file diff --git a/pullrequest/README.md b/pullrequest/README.md new file mode 100644 index 0000000000..59ecb55f4a --- /dev/null +++ b/pullrequest/README.md @@ -0,0 +1,195 @@ +# Generic PullRequest interaction + +This Task allows a user to interact with an SCM (source control management) system through an abstracted interface +(implemented uisng [jenkins-x/go-scm](https://github.com/jenkins-x/go-scm)). + +* [Install the Task](#install-the-tasks) +* [Configure the Task](#configure-the-tasks) +* [Usage](#usage) +* [PullRequest Image](#pullrequest-image) + +_This `Task` works with both public SCM instances and self-hosted/enterprise GitHub/GitLab instances. For a GitHub specific `Task` see [github](../github)._ + +## Mode: Upload or Download + +In `download` mode, this `Task` will look at the state of an existing pull request and populate +[the `pr` workspace](#workspaces) with the state of the pull request, including +the `.MANIFEST` file. + +If you want to update or delete existing attributes of a PR, running `download` +first will allow you to use `upload` to make those changes. + +In `upload` mode, this `Task` will look at the contents of [the `pr` workspace](#workspaces) +and compare it to the `.MANIFEST` file (if it exists). Any differences will result +in requests being made to bring the Pull Request into the state described in the +workspace. + +## Install the Tasks + +To install the Task: + +```bash +kubectl apply -f pullrequest/pr.yaml +``` + +## Configuring the Tasks + +### Parameters + +* `mode` (_Required_)- The [mode ("upload" or "download")](#mode-upload-or-download) +* `url` (_Required_) - The complete URL of the Pull Request, e.g. `https://github.com/bobcatfish/catservice/pull/16` +* `provider` (_Required_) - The type of SCM system, currently `github` or `gitlab` +* `secret-key-ref` (_Required_) - The name of a secret key containing + [the token required for SCM requests](#permissions) +* `insecure-skip-tls-verify` (_Default: `"false"`_) - If `"true"`, certificate validation will be disabled + +### Workspaces + +The `pr` workspace holds all the data about any labels, statuses, comments you want to update. + +The files in the `pr` workspace represent the state of [the configured PR](#parameters), +i.e. the current state when using [download mode](#mode-uploapr-sample-add-comment-q26vrd-or-download) and/or +the desired state when using [upload mode](#mode-upload-or-download). + +The structure of the workspace is: + +* `/labels/