From 0a58cc61aa03e560b5bbe92001f571207947119f Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Thu, 6 Jul 2023 12:03:41 +0200 Subject: [PATCH] Introduce ci:normal label Co-authored-by: Kasper Peulen --- .circleci/config.yml | 59 +------------------ .github/PULL_REQUEST_TEMPLATE.md | 3 +- .../workflows/trigger-circle-ci-workflow.yml | 23 +------- 3 files changed, 6 insertions(+), 79 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 596da221fa85..144428777e9c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,8 +4,8 @@ parameters: workflow: description: Which workflow to run type: enum - enum: ['ci', 'pr', 'merged', 'daily'] - default: 'ci' + enum: ['pr', 'merged', 'daily'] + default: 'pr' executors: sb_node_16_classic: @@ -257,7 +257,6 @@ jobs: parameters: parallelism: type: integer - default: 2 executor: class: medium name: sb_node_16_browsers @@ -282,7 +281,6 @@ jobs: parameters: parallelism: type: integer - default: 2 executor: class: medium name: sb_node_16_browsers @@ -303,7 +301,6 @@ jobs: parameters: parallelism: type: integer - default: 2 executor: class: large name: sb_node_16_browsers @@ -338,7 +335,6 @@ jobs: parameters: parallelism: type: integer - default: 2 executor: class: medium name: sb_playwright @@ -359,7 +355,6 @@ jobs: parameters: parallelism: type: integer - default: 2 executor: class: large name: sb_playwright @@ -380,7 +375,6 @@ jobs: parameters: parallelism: type: integer - default: 2 executor: class: medium name: sb_node_16_browsers @@ -400,7 +394,6 @@ jobs: parameters: parallelism: type: integer - default: 2 executor: class: medium name: sb_playwright @@ -424,7 +417,6 @@ jobs: parameters: parallelism: type: integer - default: 2 executor: class: medium name: sb_playwright @@ -448,7 +440,6 @@ jobs: parameters: parallelism: type: integer - default: 2 executor: class: medium name: sb_playwright @@ -468,51 +459,6 @@ jobs: template: $(yarn get-template --cadence << pipeline.parameters.workflow >> --task bench) workflows: - ci: - when: - and: - - equal: [api, << pipeline.trigger_source >>] - - equal: [ci, << pipeline.parameters.workflow >>] - jobs: - - pretty-docs - - build - - lint: - requires: - - build - - check: - requires: - - build - - unit-tests: - requires: - - build - - script-unit-tests: - requires: - - build - - chromatic-internal-storybooks: - requires: - - build - - create-sandboxes: - requires: - - build - - build-sandboxes: - requires: - - create-sandboxes - - chromatic-sandboxes: - requires: - - build-sandboxes - - e2e-production: - requires: - - build-sandboxes - - e2e-dev: - requires: - - create-sandboxes - - test-runner-production: - requires: - - build-sandboxes - # TODO: reenable once we find out the source of flakyness - # - test-runner-dev: - # requires: - # - create-sandboxes pr: when: equal: [pr, << pipeline.parameters.workflow >>] @@ -554,6 +500,7 @@ workflows: requires: - build-sandboxes - e2e-dev: + parallelism: 2 requires: - create-sandboxes - test-runner-production: diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 655dd310ffaf..c4caf9cb3f0e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -27,8 +27,7 @@ Closes # #### Maintainers -- [ ] If this PR should be tested against many or all sandboxes, - make sure to add the `ci:merged` or `ci:daily` GH label to it. +- [ ] When this PR is ready for testing, make sure to add `ci:normal`, `ci:merged` or `ci:daily` GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in `code/lib/cli/src/sandbox-templates.ts` - [ ] Make sure this PR contains **one** of the labels below. `["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]` diff --git a/.github/workflows/trigger-circle-ci-workflow.yml b/.github/workflows/trigger-circle-ci-workflow.yml index 7b1f853bde1e..235d05833824 100644 --- a/.github/workflows/trigger-circle-ci-workflow.yml +++ b/.github/workflows/trigger-circle-ci-workflow.yml @@ -32,29 +32,10 @@ jobs: outputs: branch: ${{ env.branch }} - trigger-ci-tests: - runs-on: ubuntu-latest - needs: get-branch - if: github.event_name == 'pull_request_target' && github.event.pull_request.draft == true && !contains(github.event.pull_request.labels.*.name, 'ci:pr') && !contains(github.event.pull_request.labels.*.name, 'ci:merged') && !contains(github.event.pull_request.labels.*.name, 'ci:daily') - steps: - - name: Trigger draft PR tests - run: > - curl -X POST --location "https://circleci.com/api/v2/project/gh/storybookjs/storybook/pipeline" \ - -H "Content-Type: application/json" \ - -H "Circle-Token: $CIRCLE_CI_TOKEN" \ - -d '{ - "branch": "'"$BRANCH"'", - "parameters": { - "workflow": "ci" - } - }' - env: - CIRCLE_CI_TOKEN: ${{ secrets.CIRCLE_CI_TOKEN }} - BRANCH: ${{ needs.get-branch.outputs.branch }} trigger-pr-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && (((github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'release')) || contains(github.event.pull_request.labels.*.name, 'ci:pr')) && !contains(github.event.pull_request.labels.*.name, 'ci:merged') && !contains(github.event.pull_request.labels.*.name, 'ci:daily')) + if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci:normal') steps: - name: Trigger PR tests run: > @@ -73,7 +54,7 @@ jobs: trigger-merged-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'push' || (contains(github.event.pull_request.labels.*.name, 'ci:merged') && !contains(github.event.pull_request.labels.*.name, 'ci:daily')) + if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'ci:merged') steps: - name: Trigger merged tests run: >