-
Notifications
You must be signed in to change notification settings - Fork 3.4k
chore: Add a CircleCI parameter for target publish-binary branch #32665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 2 commits
8d8f718
f944cd3
284b03d
b3cd415
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,11 @@ base-internal-minimum-node: &base-internal-minimum-node cypress/base-internal:20 | |
ubuntu-2004-current: &ubuntu-2004-current ubuntu-2004:2024.11.1 | ||
ubuntu-2004-older: &ubuntu-2004-older ubuntu-2004:2024.05.1 | ||
|
||
parameters: | ||
publish-binary-branch: | ||
type: string | ||
default: main | ||
|
||
orbs: | ||
browser-tools: circleci/[email protected] | ||
|
||
|
@@ -1366,19 +1371,6 @@ commands: | |
paths: | ||
- cypress/cypress.zip | ||
|
||
trigger-publish-binary-pipeline: | ||
steps: | ||
- run: | ||
name: "Trigger publish-binary pipeline" | ||
command: | | ||
source ./scripts/ensure-node.sh | ||
echo $SHOULD_PERSIST_ARTIFACTS | ||
node ./scripts/binary/trigger-publish-binary-pipeline.js | ||
- persist_to_workspace: | ||
root: ~/ | ||
paths: | ||
- triggered_pipeline.json | ||
|
||
build-cypress-npm-package: | ||
parameters: | ||
executor: | ||
|
@@ -2474,7 +2466,8 @@ jobs: | |
- restore_cached_workspace | ||
- check-if-binary-exists | ||
- setup_should_persist_artifacts | ||
- trigger-publish-binary-pipeline | ||
- trigger-publish-binary-pipeline: | ||
target-repo-branch: << pipeline.parameters.publish-binary-branch >> | ||
|
||
get-published-artifacts: | ||
<<: *defaults | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
parameters: | ||
target-repo-branch: | ||
type: string | ||
default: main | ||
|
||
steps: | ||
- run: | ||
name: Trigger publish-binary pipeline | ||
command: | | ||
if [[ -z "$CIRCLE_TOKEN" ]] || \ | ||
[[ -z "$CIRCLE_SHA1" ]] || \ | ||
[[ -z "$CIRCLE_JOB" ]] || \ | ||
[[ -z "$CIRCLE_WORKFLOW_ID" ]] || \ | ||
[[ -z "$CIRCLE_BUILD_URL" ]] || \ | ||
[[ -z "$CIRCLE_BRANCH" ]]; then | ||
echo "Missing required environment variables. Skipping pipeline trigger." | ||
exit 1 | ||
fi | ||
if [[ -n "$SHOULD_PERSIST_ARTIFACTS" && "$SHOULD_PERSIST_ARTIFACTS" != "true" && "$SHOULD_PERSIST_ARTIFACTS" != "false" ]]; then | ||
echo "SHOULD_PERSIST_ARTIFACTS must be true, false, or undefined. Skipping pipeline trigger." | ||
exit 1 | ||
fi | ||
if [[ -z $(which node) ]] || [[ -z $(which curl) ]] || [[ -z $(which jq) ]]; then | ||
echo "Missing required commands. Skipping pipeline trigger. Ensure: jo, jq, curl, node are installed." | ||
exit 1 | ||
fi | ||
echo "Determining next binary version..." | ||
export NEXT_VERSION=$(node ./scripts/get-next-version.js) | ||
if [[ $? != 0 ]]; then | ||
echo "Failed to determine next binary version. Skipping pipeline trigger." | ||
exit 1 | ||
fi | ||
echo "Next binary version: $NEXT_VERSION" | ||
export BODY=$(cat \<<JSON_BODY_EOF | ||
{ | ||
"branch": "<< parameters.target-repo-branch >>", | ||
"parameters": { | ||
"temp_dir": "${TMPDIR:-/tmp}", | ||
"sha": "$CIRCLE_SHA1", | ||
"job_name": "$CIRCLE_JOB", | ||
"triggered_workflow_id": "$CIRCLE_WORKFLOW_ID", | ||
"triggered_job_url": "$CIRCLE_BUILD_URL", | ||
"branch": "$CIRCLE_BRANCH", | ||
"should_persist_artifacts": ${SHOULD_PERSIST_ARTIFACTS:-false}, | ||
"binary_version": "$NEXT_VERSION" | ||
} | ||
} | ||
JSON_BODY_EOF | ||
) | ||
if [[ $? != 0 ]]; then | ||
echo "Failed to compose the request body. Skipping pipeline trigger." | ||
exit 1 | ||
fi | ||
echo "Triggering new pipeline in cypress-publish-binary project on branch << parameters.target-repo-branch >>..." | ||
curl -X POST \ | ||
-o ~/triggered_pipeline.json \ | ||
-H "Circle-Token: $CIRCLE_TOKEN" \ | ||
-H "Content-Type: application/json" \ | ||
-d "$BODY" \ | ||
https://circleci.com/api/v2/project/github/cypress-io/cypress-publish-binary/pipeline | ||
if [[ $? != 0 ]]; then | ||
echo "Failed to trigger new pipeline. Skipping pipeline trigger." | ||
exit 1 | ||
fi | ||
echo "Pipeline saved to triggered_pipeline.json" | ||
echo "Triggered pipeline: https://app.circleci.com/pipelines/github/cypress-io/cypress-publish-binary/$(jq -r '.number' triggered_pipeline.json)" | ||
- persist_to_workspace: | ||
root: ~/ | ||
paths: | ||
- triggered_pipeline.json | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: File Path Mismatch Causes Command FailuresThe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't how |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,9 +176,8 @@ Upgrading `electron` involves more than just bumping this package's `package.jso | |
- [ ] Update `electron` version in `package.json` | ||
- [ ] Update the target `electron` version in the circle configuration | ||
- [ ] Update the docker image to the new browsers-internal image made in the previous step | ||
- [ ] Temporarily update the circle configuration to allow `cypress` to run against the branch | ||
- [ ] Temporarily set target `cypress-publish-binary` branch as a `branch` property on the request body in [../../scripts/binary/trigger-publish-binary-pipeline.js](../../scripts/binary/trigger-publish-binary-pipeline.js) script, so that you can test against this branch from the electron upgrade branch. This property must be set both at the root of the body object, and on the `parameters` key. If it is not set at the root, the binary pipeline will continue to use the primary branch. | ||
|
||
- [ ] Add your branch name to the `&full-workflow-filters` anchor in [`@pipeline.yml`](../../.circleci/src/pipeline/@pipeline.yml) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this can be parameterized as well (separately, to reduce delta surface) |
||
- [ ] Trigger the pipeline in CircleCI's UI, and set the `publish-binary-branch` parameter to the branch you created in the `cypress-publish-binary` repository. | ||
|
||
- [ ] **Manually smoke test `cypress open`.** Upgrading Electron can break the `desktop-gui` in unexpected ways. Since testing in this area is weak, double-check that things like launching `cypress open`, signing into Cypress Cloud, and launching Electron tests still work. | ||
- [ ] **Manually smoke test `cypress run` in record mode** Upgrading Electron can cause `better-sqlite3` to SIGSEGV the Electron process. | ||
|
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.