From c5fdfb5cc539a7ce4f1d3cd526ec1c1b9dd8bc65 Mon Sep 17 00:00:00 2001 From: Billy Lynch Date: Wed, 4 Dec 2019 13:19:08 -0500 Subject: [PATCH] Add read-only copy of pull request object in resource output. Also fixes minor permission issue (rwx -> rw for most files). Initial fix to grant users access to the rest of the PR information. This file is read-only so that we can use the subresources (e.g. labels, comments, etc.) as the source of truth. As a follow up, we may want to consider pruning this from the PR output. I wasn't sure how to do this without forking the scm.PullRequest resource. I'd like to avoid this in order to make updates to the upstream scm library as easy as possible. This should be fine for now to get into for 0.9.1, and we can iterate on this as needed. --- cmd/pullrequest-init/disk.go | 32 +++++---- cmd/pullrequest-init/disk_test.go | 10 +++ cmd/pullrequest-init/example/base.json | 1 + .../example/comments/505233618.json | 1 + .../example/comments/505476017.json | 1 + .../example/comments/505482755.json | 1 + .../example/comments/505529049.json | 1 + .../example/comments/505616303.json | 1 + .../example/comments/505676294.json | 1 + .../example/comments/505798994.json | 1 + .../example/comments/505890656.json | 1 + .../example/comments/505923534.json | 1 + .../example/comments/506032472.json | 1 + .../example/comments/506082430.json | 1 + .../example/comments/506082465.json | 1 + .../example/comments/507732301.json | 1 + .../example/comments/507763725.json | 1 + .../example/comments/508007084.json | 1 + cmd/pullrequest-init/example/head.json | 1 + cmd/pullrequest-init/example/labels/approved | 0 .../example/labels/cla%3A+yes | 0 cmd/pullrequest-init/example/labels/lgtm | 0 cmd/pullrequest-init/example/labels/size%2FL | 0 cmd/pullrequest-init/example/pr.json | 1 + .../example/status/cla%2Fgoogle.json | 1 + .../pull-tekton-pipeline-build-tests.json | 1 + .../pull-tekton-pipeline-go-coverage.json | 1 + ...ull-tekton-pipeline-integration-tests.json | 1 + .../pull-tekton-pipeline-unit-tests.json | 1 + cmd/pullrequest-init/example/status/tide.json | 1 + docs/resources.md | 66 +++---------------- 31 files changed, 62 insertions(+), 70 deletions(-) create mode 100644 cmd/pullrequest-init/example/base.json create mode 100644 cmd/pullrequest-init/example/comments/505233618.json create mode 100644 cmd/pullrequest-init/example/comments/505476017.json create mode 100644 cmd/pullrequest-init/example/comments/505482755.json create mode 100644 cmd/pullrequest-init/example/comments/505529049.json create mode 100644 cmd/pullrequest-init/example/comments/505616303.json create mode 100644 cmd/pullrequest-init/example/comments/505676294.json create mode 100644 cmd/pullrequest-init/example/comments/505798994.json create mode 100644 cmd/pullrequest-init/example/comments/505890656.json create mode 100644 cmd/pullrequest-init/example/comments/505923534.json create mode 100644 cmd/pullrequest-init/example/comments/506032472.json create mode 100644 cmd/pullrequest-init/example/comments/506082430.json create mode 100644 cmd/pullrequest-init/example/comments/506082465.json create mode 100644 cmd/pullrequest-init/example/comments/507732301.json create mode 100644 cmd/pullrequest-init/example/comments/507763725.json create mode 100644 cmd/pullrequest-init/example/comments/508007084.json create mode 100644 cmd/pullrequest-init/example/head.json create mode 100644 cmd/pullrequest-init/example/labels/approved create mode 100644 cmd/pullrequest-init/example/labels/cla%3A+yes create mode 100644 cmd/pullrequest-init/example/labels/lgtm create mode 100644 cmd/pullrequest-init/example/labels/size%2FL create mode 100644 cmd/pullrequest-init/example/pr.json create mode 100644 cmd/pullrequest-init/example/status/cla%2Fgoogle.json create mode 100644 cmd/pullrequest-init/example/status/pull-tekton-pipeline-build-tests.json create mode 100644 cmd/pullrequest-init/example/status/pull-tekton-pipeline-go-coverage.json create mode 100644 cmd/pullrequest-init/example/status/pull-tekton-pipeline-integration-tests.json create mode 100644 cmd/pullrequest-init/example/status/pull-tekton-pipeline-unit-tests.json create mode 100644 cmd/pullrequest-init/example/status/tide.json diff --git a/cmd/pullrequest-init/disk.go b/cmd/pullrequest-init/disk.go index bc6cfab766d..6bef194f25a 100644 --- a/cmd/pullrequest-init/disk.go +++ b/cmd/pullrequest-init/disk.go @@ -33,6 +33,7 @@ import ( // /workspace/ // /workspace// +// /workspace//pr.json // /workspace//labels/ // /workspace//labels/