Copilot commented on code in PR #68: URL: https://github.com/apache/arrow-erlang/pull/68#discussion_r3534360215
########## .htaccess: ########## @@ -0,0 +1,20 @@ +# 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. + +ErrorDocument 404 /erlang/main/404.html + +RedirectMatch permanent ^/erlang/(?!main/)(.*)$ https://arrow.hexdocs.pm/$1 Review Comment: This RedirectMatch also matches `/erlang/main` (no trailing slash), because the negative lookahead only excludes `main/`. That would incorrectly redirect the main docs entry point to HexDocs instead of letting Apache serve (or redirect to) `/erlang/main/`. ########## .github/workflows/pr_comment.yml: ########## @@ -0,0 +1,54 @@ +# 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: PR comment + +on: # zizmor: ignore[dangerous-triggers] + pull_request_target: + types: + - opened + +permissions: + contents: read + issues: write + pull-requests: write + +jobs: + preview-url: + name: Preview URL + if: github.event.pull_request.base.repo.full_name != 'apache/arrow-erlang' Review Comment: The job condition checks the PR base repo, so it will *not* run for the common case of a PR opened against `apache/arrow-erlang` from a fork (where you likely want to comment the preview URL). It currently only runs for PRs whose base repo is not `apache/arrow-erlang`, which doesn’t match the PR description about PR previews on forks. ########## CONTRIBUTING.md: ########## @@ -120,3 +120,38 @@ Please read our [development documentation](https://arrow.apache.org/docs/developers/index.html) or look through the [New Contributor's Guide](https://arrow.apache.org/docs/developers/guide/index.html). + +### Forks + +We deploy a preview of the ExDoc documentation of any fork as a part of our +tests. + +On a commit to all branches, the rendered static site will be +published to GitHub Pages using GitHub Actions. The latest commit is +only visible because all publications use the same url: +https://${YOUR_GITHUB_ACCOUNT}.github.io/arrow-erlang/ Review Comment: A few phrasing/grammar issues make this section harder to follow ("as a part", "On a commit to all branches", and "url" → "URL"). Tightening the wording will reduce confusion for contributors configuring preview docs. ########## .github/workflows/docs.yml: ########## @@ -15,34 +15,22 @@ # specific language governing permissions and limitations # under the License. -name: Generate Docs +name: Docs CI on: push: - branches: - - main - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write + pull_request: -# Allow only one concurrent deployment -concurrency: - group: "pages" - cancel-in-progress: true + workflow_dispatch: Review Comment: `on: push` currently runs on *all* branches. Since `asf_site` deploys by pushing to the `asf-site` branch, that push will re-trigger this workflow (at least the `build` job), creating unnecessary CI churn and potential feedback loops. ########## .github/workflows/pr_comment.yml: ########## @@ -0,0 +1,54 @@ +# 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: PR comment + +on: # zizmor: ignore[dangerous-triggers] + pull_request_target: + types: + - opened + +permissions: + contents: read + issues: write + pull-requests: write + +jobs: + preview-url: + name: Preview URL + if: github.event.pull_request.base.repo.full_name != 'apache/arrow-erlang' + runs-on: ubuntu-latest + steps: + - name: Comment + env: + GH_TOKEN: ${{ github.token }} + PR_REPOSITORY: ${{ github.event.pull_request.base.repo.full_name }} + FORK_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name }} + PR_NUMBER: ${{ github.event.number }} + run: | + configure_url="https://github.com/apache/arrow-erlang/blob/main/CONTRIBUTING.md#forks" + fork_owner=${FORK_REPOSITORY%/*} + fork_repository=${FORK_REPOSITORY#*/} + { + echo "Preview URL: https://${fork_owner}.github.io/${fork_repository}" + echo "" + echo "If the preview URL doesn't work, you may forget to configure your fork repository for preview." + echo "See ${configure_url} how to configure." + } | tee body.md + gh pr comment ${PR_NUMBER} \ + --body-file body.md \ + --repo ${PR_REPOSITORY} Review Comment: Minor grammar in the comment body ("may forget" → "may have forgotten") and unquoted shell variables in the `gh pr comment` invocation. Quoting reduces the chance of surprising behavior if values ever contain special characters. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
