From 9148835dabd8253f66b64f7bf6ddde7d90a02d97 Mon Sep 17 00:00:00 2001 From: Neal Richardson Date: Wed, 12 Feb 2020 13:33:07 -0800 Subject: [PATCH 01/14] GH workflow to render docs --- .github/workflows/r_docs.yml | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/r_docs.yml diff --git a/.github/workflows/r_docs.yml b/.github/workflows/r_docs.yml new file mode 100644 index 00000000000..ed2795c7ad5 --- /dev/null +++ b/.github/workflows/r_docs.yml @@ -0,0 +1,43 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name: R documentation + +on: + pull_request: + paths: + - '.github/workflows/r_docs.yml' + - 'r/R/*.R' + +jobs: + roxygen: + name: Build and Push + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: r-lib/actions/setup-r@v1 + - name: Install dependencies + run: Rscript -e 'source("ci/etc/rprofile"); install.packages(c("remotes", "roxygen2")); remotes::install_deps("r")' + - name: Render docs + run: | + cd r + Rscript -e 'roxygen2::roxygenize()' + - name: Commit results + run: | + git add . + git commit -m 'Update docs' || echo "No changes to commit" + git push https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git HEAD:${{ github.ref }} || echo "No changes to commit" From be2d7bb8c805adc3c0971eeb6502c5edea966be3 Mon Sep 17 00:00:00 2001 From: Neal Richardson Date: Wed, 12 Feb 2020 13:37:16 -0800 Subject: [PATCH 02/14] Add message doclets --- r/R/message.R | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/r/R/message.R b/r/R/message.R index 51e0f965e27..82b6e2b95d5 100644 --- a/r/R/message.R +++ b/r/R/message.R @@ -17,7 +17,7 @@ #' @include arrow-package.R -#' @title class arrow::Message +#' @title Message #' #' @usage NULL #' @format NULL @@ -25,7 +25,13 @@ #' #' @section Methods: #' -#' TODO +#' * `$Equals(other)`: Test for equality +#' * `$body_length()`: +#' * `$Verify()`: +#' @section Active bindings: +#' * `$type`: +#' * `$metadata`: +#' * `$body`: #' #' @rdname Message #' @name Message @@ -74,7 +80,7 @@ MessageReader$create <- function(stream) { #' Read a Message from a stream #' #' @param stream an InputStream -#' +#' @return A [Message] #' @export read_message <- function(stream) { UseMethod("read_message") From faf8f45911077be533d6981050438c6dfcf51aea Mon Sep 17 00:00:00 2001 From: Neal Richardson Date: Wed, 12 Feb 2020 13:48:37 -0800 Subject: [PATCH 03/14] Debug the push --- .github/workflows/r_docs.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/r_docs.yml b/.github/workflows/r_docs.yml index ed2795c7ad5..88337605de6 100644 --- a/.github/workflows/r_docs.yml +++ b/.github/workflows/r_docs.yml @@ -38,6 +38,7 @@ jobs: Rscript -e 'roxygen2::roxygenize()' - name: Commit results run: | - git add . - git commit -m 'Update docs' || echo "No changes to commit" - git push https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git HEAD:${{ github.ref }} || echo "No changes to commit" + OWNER=$(jq --raw-output .pull_request.head.user.login ${GITHUB_EVENT_PATH}) + REPO=$(jq --raw-output .pull_request.head.repo.name ${GITHUB_EVENT_PATH}) + git commit -a -m 'Update docs' || echo "No changes to commit" + git push https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${OWNER}/${REPO}.git HEAD:${{ github.ref }} || echo "No changes to commit" From 3805c7e1a6f831d739ca5c742490592cfa186d41 Mon Sep 17 00:00:00 2001 From: Neal Richardson Date: Wed, 12 Feb 2020 13:51:14 -0800 Subject: [PATCH 04/14] add name --- .github/workflows/r_docs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/r_docs.yml b/.github/workflows/r_docs.yml index 88337605de6..98a119f66c4 100644 --- a/.github/workflows/r_docs.yml +++ b/.github/workflows/r_docs.yml @@ -38,6 +38,8 @@ jobs: Rscript -e 'roxygen2::roxygenize()' - name: Commit results run: | + git config user.name "$(git log -1 --pretty=format:%an)" + git config user.email "$(git log -1 --pretty=format:%ae)" OWNER=$(jq --raw-output .pull_request.head.user.login ${GITHUB_EVENT_PATH}) REPO=$(jq --raw-output .pull_request.head.repo.name ${GITHUB_EVENT_PATH}) git commit -a -m 'Update docs' || echo "No changes to commit" From ac5597aac81b1434922696a7a97bba09500052f2 Mon Sep 17 00:00:00 2001 From: Neal Richardson Date: Wed, 12 Feb 2020 13:57:54 -0800 Subject: [PATCH 05/14] Add remote --- .github/workflows/r_docs.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/r_docs.yml b/.github/workflows/r_docs.yml index 98a119f66c4..0b720d56309 100644 --- a/.github/workflows/r_docs.yml +++ b/.github/workflows/r_docs.yml @@ -42,5 +42,9 @@ jobs: git config user.email "$(git log -1 --pretty=format:%ae)" OWNER=$(jq --raw-output .pull_request.head.user.login ${GITHUB_EVENT_PATH}) REPO=$(jq --raw-output .pull_request.head.repo.name ${GITHUB_EVENT_PATH}) + git remote add deploy \ + https://x-access-token:${GITHUB_TOKEN}@github.com/${OWNER}/${REPO}.git + git fetch deploy + git checkout --track deploy/${{ github.ref }} git commit -a -m 'Update docs' || echo "No changes to commit" - git push https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${OWNER}/${REPO}.git HEAD:${{ github.ref }} || echo "No changes to commit" + git push deploy ${{ github.ref }} || echo "No changes to commit" From 52d142e81821f34631df5e390a6a1346943790c4 Mon Sep 17 00:00:00 2001 From: Neal Richardson Date: Wed, 12 Feb 2020 14:01:22 -0800 Subject: [PATCH 06/14] head_ref --- .github/workflows/r_docs.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/r_docs.yml b/.github/workflows/r_docs.yml index 0b720d56309..46b63e45ddd 100644 --- a/.github/workflows/r_docs.yml +++ b/.github/workflows/r_docs.yml @@ -29,6 +29,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 + - name: Set up git remote for pushing to + run: | + git config user.name "$(git log -1 --pretty=format:%an)" + git config user.email "$(git log -1 --pretty=format:%ae)" + OWNER=$(jq --raw-output .pull_request.head.user.login ${GITHUB_EVENT_PATH}) + REPO=$(jq --raw-output .pull_request.head.repo.name ${GITHUB_EVENT_PATH}) + git remote add deploy \ + https://x-access-token:${GITHUB_TOKEN}@github.com/${OWNER}/${REPO}.git + git fetch deploy + git checkout --track deploy/${{ github.head_ref }} - uses: r-lib/actions/setup-r@v1 - name: Install dependencies run: Rscript -e 'source("ci/etc/rprofile"); install.packages(c("remotes", "roxygen2")); remotes::install_deps("r")' @@ -38,13 +48,5 @@ jobs: Rscript -e 'roxygen2::roxygenize()' - name: Commit results run: | - git config user.name "$(git log -1 --pretty=format:%an)" - git config user.email "$(git log -1 --pretty=format:%ae)" - OWNER=$(jq --raw-output .pull_request.head.user.login ${GITHUB_EVENT_PATH}) - REPO=$(jq --raw-output .pull_request.head.repo.name ${GITHUB_EVENT_PATH}) - git remote add deploy \ - https://x-access-token:${GITHUB_TOKEN}@github.com/${OWNER}/${REPO}.git - git fetch deploy - git checkout --track deploy/${{ github.ref }} git commit -a -m 'Update docs' || echo "No changes to commit" - git push deploy ${{ github.ref }} || echo "No changes to commit" + git push deploy ${{ github.head_ref }} || echo "No changes to commit" From 914469db5ec3704d5128d501a25c455c68ed78bb Mon Sep 17 00:00:00 2001 From: Neal Richardson Date: Wed, 12 Feb 2020 14:12:51 -0800 Subject: [PATCH 07/14] Run on push (on fork) --- .github/workflows/r_docs.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/r_docs.yml b/.github/workflows/r_docs.yml index 46b63e45ddd..bbfad7740c1 100644 --- a/.github/workflows/r_docs.yml +++ b/.github/workflows/r_docs.yml @@ -18,7 +18,7 @@ name: R documentation on: - pull_request: + push: paths: - '.github/workflows/r_docs.yml' - 'r/R/*.R' @@ -31,14 +31,16 @@ jobs: - uses: actions/checkout@v1 - name: Set up git remote for pushing to run: | - git config user.name "$(git log -1 --pretty=format:%an)" - git config user.email "$(git log -1 --pretty=format:%ae)" OWNER=$(jq --raw-output .pull_request.head.user.login ${GITHUB_EVENT_PATH}) + echo "::set-env name=OWNER::${OWNER}" REPO=$(jq --raw-output .pull_request.head.repo.name ${GITHUB_EVENT_PATH}) - git remote add deploy \ - https://x-access-token:${GITHUB_TOKEN}@github.com/${OWNER}/${REPO}.git - git fetch deploy - git checkout --track deploy/${{ github.head_ref }} + if [ "$OWNER" != "apache" ]; then + git config user.name "$(git log -1 --pretty=format:%an)" + git config user.email "$(git log -1 --pretty=format:%ae)" + git remote add deploy https://x-access-token:${GITHUB_TOKEN}@github.com/${OWNER}/${REPO}.git + git fetch deploy + git checkout --track deploy/${{ github.head_ref }} + fi - uses: r-lib/actions/setup-r@v1 - name: Install dependencies run: Rscript -e 'source("ci/etc/rprofile"); install.packages(c("remotes", "roxygen2")); remotes::install_deps("r")' @@ -48,5 +50,7 @@ jobs: Rscript -e 'roxygen2::roxygenize()' - name: Commit results run: | - git commit -a -m 'Update docs' || echo "No changes to commit" - git push deploy ${{ github.head_ref }} || echo "No changes to commit" + if [ "$OWNER" != "apache" ]; then + git commit -a -m 'Update docs' || echo "No changes to commit" + git push deploy ${{ github.head_ref }} || echo "No changes to commit" + fi From 2fa8fa793b8e8a8878e79a20ce1ea609436ff3a9 Mon Sep 17 00:00:00 2001 From: Neal Richardson Date: Wed, 12 Feb 2020 14:18:29 -0800 Subject: [PATCH 08/14] Some fixes for own repo --- .github/workflows/r_docs.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/r_docs.yml b/.github/workflows/r_docs.yml index bbfad7740c1..ae2ffc77e2e 100644 --- a/.github/workflows/r_docs.yml +++ b/.github/workflows/r_docs.yml @@ -31,15 +31,12 @@ jobs: - uses: actions/checkout@v1 - name: Set up git remote for pushing to run: | - OWNER=$(jq --raw-output .pull_request.head.user.login ${GITHUB_EVENT_PATH}) - echo "::set-env name=OWNER::${OWNER}" - REPO=$(jq --raw-output .pull_request.head.repo.name ${GITHUB_EVENT_PATH}) - if [ "$OWNER" != "apache" ]; then + if [ "${{ github.repository }}" != "apache/arrow" ]; then git config user.name "$(git log -1 --pretty=format:%an)" git config user.email "$(git log -1 --pretty=format:%ae)" - git remote add deploy https://x-access-token:${GITHUB_TOKEN}@github.com/${OWNER}/${REPO}.git + git remote add deploy https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git git fetch deploy - git checkout --track deploy/${{ github.head_ref }} + git checkout --track deploy/${{ github.ref }} fi - uses: r-lib/actions/setup-r@v1 - name: Install dependencies @@ -50,7 +47,7 @@ jobs: Rscript -e 'roxygen2::roxygenize()' - name: Commit results run: | - if [ "$OWNER" != "apache" ]; then + if [ "${{ github.repository }}" != "apache/arrow" ]; then git commit -a -m 'Update docs' || echo "No changes to commit" - git push deploy ${{ github.head_ref }} || echo "No changes to commit" + git push deploy ${{ github.ef }} || echo "No changes to commit" fi From 7a2281fa4844e0dbfb4a0065b5302a92bdb2a755 Mon Sep 17 00:00:00 2001 From: Neal Richardson Date: Wed, 12 Feb 2020 14:19:32 -0800 Subject: [PATCH 09/14] Try simplifying again --- .github/workflows/r_docs.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/r_docs.yml b/.github/workflows/r_docs.yml index ae2ffc77e2e..974f76b654e 100644 --- a/.github/workflows/r_docs.yml +++ b/.github/workflows/r_docs.yml @@ -29,15 +29,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - name: Set up git remote for pushing to - run: | - if [ "${{ github.repository }}" != "apache/arrow" ]; then - git config user.name "$(git log -1 --pretty=format:%an)" - git config user.email "$(git log -1 --pretty=format:%ae)" - git remote add deploy https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git - git fetch deploy - git checkout --track deploy/${{ github.ref }} - fi - uses: r-lib/actions/setup-r@v1 - name: Install dependencies run: Rscript -e 'source("ci/etc/rprofile"); install.packages(c("remotes", "roxygen2")); remotes::install_deps("r")' @@ -49,5 +40,5 @@ jobs: run: | if [ "${{ github.repository }}" != "apache/arrow" ]; then git commit -a -m 'Update docs' || echo "No changes to commit" - git push deploy ${{ github.ef }} || echo "No changes to commit" + git push https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git HEAD:${{ github.ref }} || echo "No changes to commit" fi From 7eeacfbe24a991bcff6fd8f9050adf7c5173d00f Mon Sep 17 00:00:00 2001 From: Neal Richardson Date: Wed, 12 Feb 2020 14:21:36 -0800 Subject: [PATCH 10/14] Add git config back --- .github/workflows/r_docs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/r_docs.yml b/.github/workflows/r_docs.yml index 974f76b654e..f2c167366e6 100644 --- a/.github/workflows/r_docs.yml +++ b/.github/workflows/r_docs.yml @@ -39,6 +39,8 @@ jobs: - name: Commit results run: | if [ "${{ github.repository }}" != "apache/arrow" ]; then + git config user.name "$(git log -1 --pretty=format:%an)" + git config user.email "$(git log -1 --pretty=format:%ae)" git commit -a -m 'Update docs' || echo "No changes to commit" git push https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git HEAD:${{ github.ref }} || echo "No changes to commit" fi From 314847025905a09fdaa73e5153547e6aaae4ba5e Mon Sep 17 00:00:00 2001 From: Neal Richardson Date: Tue, 18 Feb 2020 09:32:48 -0800 Subject: [PATCH 11/14] Feedback from @kou and simplify a bit --- .github/workflows/r_docs.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/r_docs.yml b/.github/workflows/r_docs.yml index f2c167366e6..cac45858264 100644 --- a/.github/workflows/r_docs.yml +++ b/.github/workflows/r_docs.yml @@ -22,25 +22,24 @@ on: paths: - '.github/workflows/r_docs.yml' - 'r/R/*.R' + branches: + - '!master' jobs: roxygen: name: Build and Push runs-on: ubuntu-latest + if: github.repository != 'apache/arrow' steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: r-lib/actions/setup-r@v1 - name: Install dependencies run: Rscript -e 'source("ci/etc/rprofile"); install.packages(c("remotes", "roxygen2")); remotes::install_deps("r")' - name: Render docs - run: | - cd r - Rscript -e 'roxygen2::roxygenize()' + run: Rscript -e 'roxygen2::roxygenize("r")' - name: Commit results run: | - if [ "${{ github.repository }}" != "apache/arrow" ]; then - git config user.name "$(git log -1 --pretty=format:%an)" - git config user.email "$(git log -1 --pretty=format:%ae)" - git commit -a -m 'Update docs' || echo "No changes to commit" - git push https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git HEAD:${{ github.ref }} || echo "No changes to commit" - fi + git config user.name "$(git log -1 --pretty=format:%an)" + git config user.email "$(git log -1 --pretty=format:%ae)" + git commit -a -m 'Update docs [automated commit]' || echo "No changes to commit" + git push origin ${{ github.ref }} || echo "No changes to commit" From 3b4a6e022f8bccd9721e15d83f7d3ba33a0f11bc Mon Sep 17 00:00:00 2001 From: Neal Richardson Date: Tue, 18 Feb 2020 09:35:35 -0800 Subject: [PATCH 12/14] this? --- .github/workflows/r_docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/r_docs.yml b/.github/workflows/r_docs.yml index cac45858264..7e1999d9163 100644 --- a/.github/workflows/r_docs.yml +++ b/.github/workflows/r_docs.yml @@ -22,8 +22,8 @@ on: paths: - '.github/workflows/r_docs.yml' - 'r/R/*.R' - branches: - - '!master' + # branches: + # - '!master' jobs: roxygen: From 825dd9bc8a8f5629939c09d46b0abd6be443275a Mon Sep 17 00:00:00 2001 From: Neal Richardson Date: Tue, 18 Feb 2020 17:44:42 +0000 Subject: [PATCH 13/14] Update docs [automated commit] --- r/man/Message.Rd | 18 +++++++++++++++--- r/man/read_message.Rd | 3 +++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/r/man/Message.Rd b/r/man/Message.Rd index 84dd90a6459..4e3909ed27d 100644 --- a/r/man/Message.Rd +++ b/r/man/Message.Rd @@ -3,13 +3,25 @@ \docType{class} \name{Message} \alias{Message} -\title{class arrow::Message} +\title{Message} \description{ -class arrow::Message +Message } \section{Methods}{ +\itemize{ +\item \verb{$Equals(other)}: Test for equality +\item \verb{$body_length()}: +\item \verb{$Verify()}: +} +} -TODO +\section{Active bindings}{ + +\itemize{ +\item \verb{$type}: +\item \verb{$metadata}: +\item \verb{$body}: +} } diff --git a/r/man/read_message.Rd b/r/man/read_message.Rd index 444c76c862f..7339dba3a34 100644 --- a/r/man/read_message.Rd +++ b/r/man/read_message.Rd @@ -9,6 +9,9 @@ read_message(stream) \arguments{ \item{stream}{an InputStream} } +\value{ +A \link{Message} +} \description{ Read a Message from a stream } From d9141f9320d3a7fe5af53b93e2fb3d2e2c1614c2 Mon Sep 17 00:00:00 2001 From: Neal Richardson Date: Tue, 18 Feb 2020 10:14:03 -0800 Subject: [PATCH 14/14] Try branches-ignore --- .github/workflows/r_docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/r_docs.yml b/.github/workflows/r_docs.yml index 7e1999d9163..37d6192932e 100644 --- a/.github/workflows/r_docs.yml +++ b/.github/workflows/r_docs.yml @@ -22,8 +22,8 @@ on: paths: - '.github/workflows/r_docs.yml' - 'r/R/*.R' - # branches: - # - '!master' + branches-ignore: + - master jobs: roxygen: