Skip to content

Commit 154311a

Browse files
authored
chore: gate restricted contexts with approval job for contributor workflow (#27862)
1 parent 887cd40 commit 154311a

File tree

2 files changed

+32
-40
lines changed

2 files changed

+32
-40
lines changed

.circleci/workflows.yml

+30-40
Original file line numberDiff line numberDiff line change
@@ -2898,6 +2898,14 @@ linux-x64-contributor-workflow: &linux-x64-contributor-workflow
28982898
- build:
28992899
requires:
29002900
- node_modules_install
2901+
2902+
# In subsequent jobs, we use some contexts that are restricted to members of the Cypress organization.
2903+
# This job will allow for a Cypress member to approve and run the rest of the restricted jobs in the pipeline after the contributor code has been reviewed.
2904+
- contributor-pr:
2905+
type: approval
2906+
requires:
2907+
- build
2908+
29012909
- check-ts:
29022910
requires:
29032911
- build
@@ -2909,22 +2917,22 @@ linux-x64-contributor-workflow: &linux-x64-contributor-workflow
29092917
context: [test-runner:poll-circle-workflow, test-runner:percy]
29102918
required_env_var: PERCY_TOKEN # skips job if not defined (external PR)
29112919
requires:
2912-
- build
2920+
- contributor-pr
29132921
- lint-types:
29142922
requires:
29152923
- build
29162924
# unit, integration and e2e tests
29172925
- cli-visual-tests:
29182926
context: test-runner:percy
29192927
requires:
2920-
- build
2928+
- contributor-pr
29212929
- unit-tests:
29222930
requires:
29232931
- build
29242932
- verify-release-readiness:
29252933
context: test-runner:npm-release
29262934
requires:
2927-
- build
2935+
- contributor-pr
29282936
- server-unit-tests:
29292937
requires:
29302938
- build
@@ -2937,7 +2945,7 @@ linux-x64-contributor-workflow: &linux-x64-contributor-workflow
29372945
- system-tests-node-modules-install:
29382946
context: test-runner:performance-tracking
29392947
requires:
2940-
- build
2948+
- contributor-pr
29412949
- system-tests-chrome:
29422950
context: test-runner:performance-tracking
29432951
requires:
@@ -2962,46 +2970,46 @@ linux-x64-contributor-workflow: &linux-x64-contributor-workflow
29622970
- driver-integration-tests-chrome:
29632971
context: test-runner:cypress-record-key
29642972
requires:
2965-
- build
2973+
- contributor-pr
29662974
- driver-integration-tests-chrome-beta:
29672975
context: test-runner:cypress-record-key
29682976
requires:
2969-
- build
2977+
- contributor-pr
29702978
- driver-integration-tests-firefox:
29712979
context: test-runner:cypress-record-key
29722980
requires:
2973-
- build
2981+
- contributor-pr
29742982
- driver-integration-tests-electron:
29752983
context: test-runner:cypress-record-key
29762984
requires:
2977-
- build
2985+
- contributor-pr
29782986
- driver-integration-tests-webkit:
29792987
context: test-runner:cypress-record-key
29802988
requires:
2981-
- build
2989+
- contributor-pr
29822990
- driver-integration-memory-tests:
29832991
requires:
29842992
- build
29852993
- run-frontend-shared-component-tests-chrome:
29862994
context: [test-runner:cypress-record-key, test-runner:launchpad-tests, test-runner:percy]
29872995
percy: true
29882996
requires:
2989-
- build
2997+
- contributor-pr
29902998
- run-launchpad-integration-tests-chrome:
29912999
context: [test-runner:cypress-record-key, test-runner:launchpad-tests, test-runner:percy]
29923000
percy: true
29933001
requires:
2994-
- build
3002+
- contributor-pr
29953003
- run-launchpad-component-tests-chrome:
29963004
context: [test-runner:cypress-record-key, test-runner:launchpad-tests, test-runner:percy]
29973005
percy: true
29983006
requires:
2999-
- build
3007+
- contributor-pr
30003008
- run-app-integration-tests-chrome:
30013009
context: [test-runner:cypress-record-key, test-runner:launchpad-tests, test-runner:percy]
30023010
percy: true
30033011
requires:
3004-
- build
3012+
- contributor-pr
30053013
- run-webpack-dev-server-integration-tests:
30063014
context: [test-runner:cypress-record-key, test-runner:percy]
30073015
requires:
@@ -3014,16 +3022,16 @@ linux-x64-contributor-workflow: &linux-x64-contributor-workflow
30143022
context: [test-runner:cypress-record-key, test-runner:launchpad-tests, test-runner:percy]
30153023
percy: true
30163024
requires:
3017-
- build
3025+
- contributor-pr
30183026
- run-reporter-component-tests-chrome:
30193027
context: [test-runner:cypress-record-key, test-runner:percy]
30203028
percy: true
30213029
requires:
3022-
- build
3030+
- contributor-pr
30233031
- reporter-integration-tests:
30243032
context: [test-runner:cypress-record-key, test-runner:percy]
30253033
requires:
3026-
- build
3034+
- contributor-pr
30273035
- npm-webpack-dev-server:
30283036
requires:
30293037
- system-tests-node-modules-install
@@ -3167,28 +3175,16 @@ linux-x64-contributor-workflow: &linux-x64-contributor-workflow
31673175
- run-vite-dev-server-integration-tests
31683176
- v8-integration-tests
31693177

3170-
# This approval job will block the building of the binary on contributor jobs
3171-
# If a member of the Cypress team manually approves this job, then it will run with the required contexts
3172-
- approve-binary-build:
3173-
type: approval
3174-
requires:
3175-
- build
3176-
31773178
- create-and-trigger-packaging-artifacts:
3178-
context:
3179-
- test-runner:upload
3180-
- test-runner:build-binary
3181-
- publish-binary
3179+
context: [test-runner:upload, test-runner:build-binary, publish-binary]
31823180
requires:
3183-
- approve-binary-build
3181+
- contributor-pr
31843182
- wait-for-binary-publish:
31853183
type: approval
31863184
requires:
31873185
- create-and-trigger-packaging-artifacts
31883186
- get-published-artifacts:
3189-
context:
3190-
- publish-binary
3191-
- test-runner:commit-status-checks
3187+
context: [publish-binary, test-runner:commit-status-checks]
31923188
requires:
31933189
- wait-for-binary-publish
31943190
# various testing scenarios, like building full binary
@@ -3287,11 +3283,7 @@ linux-arm64-workflow: &linux-arm64-workflow
32873283

32883284
- create-and-trigger-packaging-artifacts:
32893285
name: linux-arm64-create-and-trigger-packaging-artifacts
3290-
context:
3291-
- test-runner:upload
3292-
- test-runner:commit-status-checks
3293-
- test-runner:build-binary
3294-
- publish-binary
3286+
context: [test-runner:upload, test-runner:commit-status-checks, test-runner:build-binary, publish-binary]
32953287
executor: linux-arm64
32963288
resource_class: arm.medium
32973289
requires:
@@ -3305,9 +3297,7 @@ linux-arm64-workflow: &linux-arm64-workflow
33053297

33063298
- get-published-artifacts:
33073299
name: linux-arm64-get-published-artifacts
3308-
context:
3309-
- publish-binary
3310-
- test-runner:commit-status-checks
3300+
context: [publish-binary, test-runner:commit-status-checks]
33113301
executor: linux-arm64
33123302
resource_class: arm.medium
33133303
requires:
@@ -3529,4 +3519,4 @@ workflows:
35293519
<<: *darwin-workflow-filters
35303520
windows:
35313521
<<: *windows-workflow
3532-
<<: *windows-workflow-filters
3522+
<<: *windows-workflow-filters

CONTRIBUTING.md

+2
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@ Additionally, we test the code by running it against various other example proje
363363

364364
If you're curious how we manage all of these tests in CI check out our [CircleCI config](.circleci/config.yml).
365365

366+
Some of our test jobs in CircleCI require access to environment variables that are sensitive and are restricted to Cypress maintainers only. If you are not a Cypress maintainer, when your CI job runs, only a subset of jobs will run at first. A Cypress maintainer will need to approve the `contributor-pr` job in your workflow in order for your CI pipeline to complete.
367+
366368
#### Docker
367369

368370
Sometimes tests pass locally, but fail in CI. Our CI environment is dockerized. In order to run the image used in CI locally:

0 commit comments

Comments
 (0)