From 5808b787230d4049632a4d5b14c3b0a80cc86e77 Mon Sep 17 00:00:00 2001 From: David Glick Date: Fri, 31 Mar 2023 12:01:02 -0700 Subject: [PATCH 1/2] Trigger CI on pull_request event (#4629) I chatted with Maurits this afternoon as well, he agrees on the pull_request trigger. Let's see first how this works out and improve on what else we might find. Thanks for the extra feedback @wesleybl --- .github/workflows/acceptance.yml | 12 +++++++++++- .github/workflows/code-analysis.yml | 5 ++++- .github/workflows/unit.yml | 3 ++- news/4629.internal | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 news/4629.internal diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml index 41309bc3b6..cea3058c29 100644 --- a/.github/workflows/acceptance.yml +++ b/.github/workflows/acceptance.yml @@ -1,7 +1,8 @@ name: Acceptance Tests -on: [push] +on: [push, pull_request] jobs: core: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name runs-on: ubuntu-latest name: Core Basic timeout-minutes: 45 @@ -56,6 +57,7 @@ jobs: path: cypress/videos coreblocks: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name runs-on: ubuntu-latest name: Core Blocks timeout-minutes: 35 @@ -110,6 +112,7 @@ jobs: path: cypress/videos corevoltoslate: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name runs-on: ubuntu-latest name: Core Volto Slate timeout-minutes: 45 @@ -164,6 +167,7 @@ jobs: path: cypress/videos core5: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name runs-on: ubuntu-latest name: Core Basic - Plone 5 strategy: @@ -217,6 +221,7 @@ jobs: path: cypress/videos coresandbox: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name runs-on: ubuntu-latest name: Coresandbox timeout-minutes: 35 @@ -270,6 +275,7 @@ jobs: path: cypress/videos guillotina: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name name: Guillotina runs-on: ubuntu-latest timeout-minutes: 35 @@ -325,6 +331,7 @@ jobs: path: cypress/videos multilingual: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name name: Multilingual runs-on: ubuntu-latest timeout-minutes: 35 @@ -379,6 +386,7 @@ jobs: path: cypress/videos workingcopy: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name name: Working Copy runs-on: ubuntu-latest timeout-minutes: 35 @@ -458,6 +466,7 @@ jobs: path: cypress/videos generator: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name name: Project Generator runs-on: ubuntu-latest timeout-minutes: 35 @@ -553,6 +562,7 @@ jobs: working-directory: ${{env.generator-directory}} seamless: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name name: Seamless Mode runs-on: ubuntu-latest timeout-minutes: 35 diff --git a/.github/workflows/code-analysis.yml b/.github/workflows/code-analysis.yml index 66ad61e73b..9b4db344de 100644 --- a/.github/workflows/code-analysis.yml +++ b/.github/workflows/code-analysis.yml @@ -1,7 +1,8 @@ name: Code Analysis Check -on: [push] +on: [push, pull_request] jobs: prettier: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name name: Prettier runs-on: ubuntu-latest strategy: @@ -24,6 +25,7 @@ jobs: run: yarn run prettier eslint: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name name: ESlint runs-on: ubuntu-latest strategy: @@ -46,6 +48,7 @@ jobs: run: yarn run lint i18n: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name name: i18n runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 36880bd257..97428e6fe3 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -1,7 +1,8 @@ name: Unit Tests -on: [push] +on: [push, pull_request] jobs: unit: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name name: Core Unit Tests runs-on: ubuntu-latest strategy: diff --git a/news/4629.internal b/news/4629.internal new file mode 100644 index 0000000000..869b4a6d24 --- /dev/null +++ b/news/4629.internal @@ -0,0 +1 @@ +Trigger CI workflows to run from external pull requests. @davisagli From dac283a02396bcd88360b923fa3f9747660b936f Mon Sep 17 00:00:00 2001 From: Fred van Dijk Date: Fri, 31 Mar 2023 21:05:03 +0200 Subject: [PATCH 2/2] developer process for first time contributing (#4617) Co-authored-by: Maurits van Rees --- .../developer-guidelines/contributing.md | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/docs/source/developer-guidelines/contributing.md b/docs/source/developer-guidelines/contributing.md index 42568ce6e6..04446bf2db 100644 --- a/docs/source/developer-guidelines/contributing.md +++ b/docs/source/developer-guidelines/contributing.md @@ -33,10 +33,32 @@ In your report, please specify a few things: ```{include} ./branch-policy.md ``` -## Create a pull request +## Sign and send us the Plone Contributors Agreement You must sign the [Plone Contributor Agreement](https://plone.org/foundation/contributors-agreement) to contribute code and documentation to any Plone project. -This means that we can NOT accept pull requests from you until you do this. +This means that we can NOT accept pull requests from you from any location until you do this. + + +## First Time Contributors: work from a fork + +When we have received the Plone Contributor Agreement and it has been process by a community member, you will be added to the Plone organisation and added to the Contributors Team on GitHub. +You can create issues, add comments to existing issues, and discuss the development of Plone with others. +Creating branches and editing code on our main repositories is restricted and granted to members who have been active in the Plone community for a while and have shown continued interest to contributing. + +- First, verify that your issue is valid by creating it and discussing it with other developers. +- Then, create a fork of the repo in your own workspace, work on your code and make commits. +- When you want to run our code quality checks, create a Pull Request from your repo/branch to the main repository. +- As a security measure, the first run of code Quality checks need to be [approved by a member in our Developers Team](https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks) +- A Developer with full access to the workflow will need to review and approve your Pull request. + +Please be aware that as long as you are working from a fork, you are the only developer being able to commit to your branch. +Collaboration between developers on bigger pull requests is more efficient when these are done on branch on the main repo. +Therefore: as your first time contribution don't choose a too big problem to solve. +Pick something that you can fix or complete from start to end. + + + +## Documenting your changes All pull requests must include a `towncrier` news item. This is a file that is placed in the root of the repository directory at `/news`. @@ -57,7 +79,8 @@ strings as translatable as defined in the [i18n guide](../recipes/i18n.md). ## Code Quality All pull requests must pass tests, documentation builds, and other code quality checks. -Contributors are strongly encouraged to run these checks locally before creating a pull request. +Developers are strongly encouraged to run these checks locally before creating a pull request. +Contributors without full Developer access will need to create a Pull request first and get approval for their first PR from a Developer. These checks are enforced automatically on every pull request, so you might as well save time and frustration by doing these checks locally first. Specifically: