Skip to content

Commit 0acdd2c

Browse files
chore: remove zenhub from release process (#25701)
Co-authored-by: Matt Schile <mschile@cypress.io>
1 parent 41512c4 commit 0acdd2c

8 files changed

+56
-60
lines changed

.circleci/workflows.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,8 @@ jobs:
14431443
- update_known_hosts
14441444
- run: yarn test-npm-package-release-script
14451445
- run: node ./scripts/semantic-commits/validate-binary-changelog.js
1446+
- store_artifacts:
1447+
path: /tmp/releaseData
14461448

14471449
lint-types:
14481450
<<: *defaults

.github/PULL_REQUEST_TEMPLATE.md

-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,5 @@ DO NOT DELETE the PR checklist.
3232
-->
3333

3434
- [ ] Have tests been added/updated?
35-
- [ ] Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
3635
- [ ] Has a PR for user-facing changes been opened in [`cypress-documentation`](https://github.com/cypress-io/cypress-documentation)? <!-- Link to PR here -->
3736
- [ ] Have API changes been updated in the [`type definitions`](https://github.com/cypress-io/cypress/blob/develop/cli/types/cypress.d.ts)?

CONTRIBUTING.md

-7
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,6 @@ We do not continuously deploy the Cypress binary, so `develop` contains all of t
476476
- `test` - Adding missing or correcting existing tests
477477
- For user-facing changes that will be released with the next Cypress version, be sure to add a changelog entry to the appropriate section in [`cli/CHANGELOG.md`](./cli/CHANGELOG.md). See [Writing the Cypress Changelog Guide](./guides/writing-the-cypress-changelog.md) for more details.
478478
- Fill out the [Pull Request Template](./.github/PULL_REQUEST_TEMPLATE.md) completely within the body of the PR. If you feel some areas are not relevant add `N/A` as opposed to deleting those sections. PRs will not be reviewed if this template is not filled in.
479-
- If the PR is a user facing change and you're a Cypress team member that has logged into [ZenHub](https://www.zenhub.com/) and downloaded the [ZenHub for GitHub extension](https://www.zenhub.com/extension), set the release the PR is intended to ship in from the sidebar of the PR. Follow semantic versioning to select the intended release. This is used to generate the changelog for the release. If you don't tag a PR for release, it won't be mentioned in the changelog.
480-
![Select release for PR](https://user-images.githubusercontent.com/1271364/135139641-657015d6-2dca-42d4-a4fb-16478f61d63f.png)
481479
- Please check the "Allow edits from maintainers" checkbox when submitting your PR. This will make it easier for the maintainers to make minor adjustments, to help with tests or any other changes we may need.
482480
![Allow edits from maintainers checkbox](https://user-images.githubusercontent.com/1271181/31393427-b3105d44-ada9-11e7-80f2-0dac51e3919e.png)
483481
- All Pull Requests require a minimum of **two** approvals.
@@ -561,10 +559,6 @@ Below are guidelines to help during code review. If any of the following require
561559
- [ ] There is no irrelevant code to the issue being addressed. If there is, ask the contributor to break the work out into a separate PR.
562560
- [ ] Tests are testing the code's intended functionality in the best way possible.
563561

564-
#### Internal
565-
566-
- [ ] The original issue has been tagged with a release in ZenHub.
567-
568562
### Code Review of Dependency Updates
569563

570564
Below are some guidelines Cypress uses when reviewing dependency updates.
@@ -579,7 +573,6 @@ Below are some guidelines Cypress uses when reviewing dependency updates.
579573

580574
- [ ] Code using the dependency has been updated to accommodate any breaking changes
581575
- [ ] The dependency still supports the version of Node that the package requires.
582-
- [ ] The PR been tagged with a release in ZenHub.
583576
- [ ] Appropriate labels have been added to the PR (for example: label `type: breaking change` if it is a breaking change)
584577

585578
## Releases

cli/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ _Released 02/14/2023 (PENDING)_
3030

3131
## 12.5.1
3232

33-
_Released 02/10/2023_
33+
_Released 02/02/2023_
3434

3535
**Bugfixes:**
3636

guides/release-process.md

+16-25
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ The `@cypress/`-namespaced NPM packages that live inside the [`/npm`](../npm) di
1313
- Ensure you have the following permissions set up:
1414
- An AWS account with permission to access and write to the AWS S3, i.e. the Cypress CDN.
1515
- Permissions for your npm account to publish the `cypress` package.
16-
- Permissions to update releases in ZenHub.
1716

1817
- [Set up](https://cypress-io.atlassian.net/wiki/spaces/INFRA/pages/1534853121/AWS+SSO+Cypress) an AWS SSO profile with the [Team-CypressApp-Prod](https://cypress-io.atlassian.net/wiki/spaces/INFRA/pages/1534853121/AWS+SSO+Cypress#Team-CypressApp-Prod) role. The release scripts assumes the name of your profile is `prod`. Make sure to open the "App Developer" expando for some necessary config values. Your AWS config file should end up looking like the following:
1918

@@ -27,19 +26,17 @@ The `@cypress/`-namespaced NPM packages that live inside the [`/npm`](../npm) di
2726
```
2827
2928
- Set up the following environment variables:
30-
- For the `release-automations` steps, you will need setup the following envs:
29+
- For the `release-automations` step, you will need setup the following envs:
3130
- GitHub token - Found in 1Password.
32-
- [ZenHub API token](https://app.zenhub.com/dashboard/tokens) to interact with Zenhub. Found in 1Password.
3331
- The `cypress-bot` GitHub app credentials. Found in 1Password.
3432
```text
3533
GITHUB_TOKEN="..."
36-
ZENHUB_API_TOKEN="..."
3734
GITHUB_APP_CYPRESS_INSTALLATION_ID=
3835
GITHUB_APP_ID=
3936
GITHUB_PRIVATE_KEY=
4037
```
4138
42-
- For purging the Cloudflare cache (part of the `move-binaries` step), you'll need `CF_ZONEID` and `CF_TOKEN` set. These can be found in 1Password.
39+
- For purging the Cloudflare cache (needed for the `prepare-release-artifacts` script in step 6), you'll need `CF_ZONEID` and `CF_TOKEN` set. These can be found in 1Password.
4340
```text
4441
CF_ZONEID="..."
4542
CF_TOKEN="..."
@@ -78,13 +75,14 @@ In the following instructions, "X.Y.Z" is used to denote the [next version of Cy
7875
- [cypress-realworld-app](https://github.com/cypress-io/cypress-realworld-app) uses yarn and represents a typical consumer implementation.
7976
- Optionally, do more thorough tests, for example test the new version of Cypress against the Cypress Cloud repo.
8077
81-
2. Confirm that every issue labeled [stage: pending release](https://github.com/cypress-io/cypress/issues?q=label%3A%22stage%3A+pending+release%22+is%3Aclosed) has a ZenHub release set. **Tip:** there is a command in [`release-automations`](https://github.com/cypress-io/release-automations)'s `issues-in-release` tool to list and check such issues. Without a ZenHub release issues will not be included in the right changelog. Also ensure that every closed issue in any obsolete releases are moved to the appropriate release in ZehHub. For example, if the open releases are 9.5.5 and 9.6.0, the current release is 9.6.0, then all closed issues marked as 9.5.5 should be moved to 9.6.0. Ensure that there are no commits on `develop` since the last release that are user facing and aren't marked with the current release.
78+
2. Ensure all changes to the links manifest to [`on.cypress.io`](https://github.com/cypress-io/cypress-services/tree/develop/packages/on) have been merged to `develop` and deployed.
8279
8380
3. Create a Release PR Bump, submit, get approvals on, and merge a new PR. This PR Should:
84-
- Bump the Cypress `version` in [`package.json`](package.json)
85-
- Bump the [`packages/example`](../packages/example) dependency if there is a new [`cypress-example-kitchensink`](https://github.com/cypress-io/cypress-example-kitchensink/releases) version
86-
- Follow the writing the [Cypress Changelog release steps](./writing-the-cypress-changelog.md#release) to update the [`cli/CHANGELOG.md`](../cli/CHANGELOG.md).
87-
4. Once the `develop` branch is passing for all test projects with the new changes and the `linux-x64` binary is present at `https://cdn.cypress.io/beta/binary/X.Y.Z/linux-x64/develop-<sha>/cypress.zip`, and the `linux-x64` cypress npm package is present at `https://cdn.cypress.io/beta/npm/X.Y.Z/linux-x64/develop-<sha>/cypress.tgz`, publishing can proceed.
81+
- Bump the Cypress `version` in [`package.json`](package.json)
82+
- Bump the [`packages/example`](../packages/example) dependency if there is a new [`cypress-example-kitchensink`](https://github.com/cypress-io/cypress-example-kitchensink/releases) version
83+
- Follow the writing the [Cypress Changelog release steps](./writing-the-cypress-changelog.md#release) to update the [`cli/CHANGELOG.md`](../cli/CHANGELOG.md).
84+
85+
4. Once the `develop` branch is passing in CI and you have confirmed the `cypress-bot` has commented on the commit with the pre-release versions for `darwin-x64`, `darwin-arm64`, `linux-x64`,`linux-arm64`, and `win32-x64`, publishing can proceed.
8886
8987
5. Log into AWS SSO with `aws sso login --profile <name_of_profile>`. If you have setup your credentials under a different profile than `prod`, be sure to set the `AWS_PROFILE` environment variable to that profile name for the remaining steps. For example, if you are using `production` instead of `prod`, do `export AWS_PROFILE=production`.
9088
@@ -142,36 +140,29 @@ In the following instructions, "X.Y.Z" is used to denote the [next version of Cy
142140
yarn binary-release --version X.Y.Z
143141
```
144142
145-
15. If needed, push out any updated changes to the links manifest to [`on.cypress.io`](https://github.com/cypress-io/cypress-services/tree/develop/packages/on).
146-
147-
16. Merge the documentation PR from step 11 and the new docker image PR created in step 12 to release the image.
148-
149-
17. If needed, deploy the updated [`cypress-example-kitchensink`][cypress-example-kitchensink] to `example.cypress.io` by following [these instructions under "Deployment"](../packages/example/README.md).
143+
15. Merge the documentation PR from step 11 and the new docker image PR created in step 12 to release the image.
150144
151-
18. Update the releases in [ZenHub](https://app.zenhub.com/workspaces/test-runner-5c3ea3baeb1e75374f7b0708/reports/release):
152-
- Close the current release in ZenHub.
153-
- Create a new patch release (and a new minor release, if this is a minor release) in ZenHub, and schedule them both to be completed 2 weeks from the current date.
154-
- Move all issues that are still open from the current release to the appropriate future release.
145+
16. If needed, deploy the updated [`cypress-example-kitchensink`][cypress-example-kitchensink] to `example.cypress.io` by following [these instructions under "Deployment"](../packages/example/README.md).
155146
156-
19. Once the release is complete, create a Github tag off of the release commit which bumped the version:
147+
17. Once the release is complete, create a Github tag off of the release commit which bumped the version:
157148
```shell
158149
git checkout develop
159150
git pull origin develop
160151
git log --pretty=oneline
161-
# copy sha of the previous commit
152+
# copy sha of the version bump commit
162153
git tag -a vX.Y.Z -m vX.Y.Z <sha>
163154
git push origin vX.Y.Z
164155
```
165156
166-
20. Create a new [GitHub release](https://github.com/cypress-io/cypress/releases). Choose the tag you created previously and add contents to match previous releases.
157+
18. Create a new [GitHub release](https://github.com/cypress-io/cypress/releases). Choose the tag you created previously and add contents to match previous releases.
167158
168-
21. Inside of [cypress-io/release-automations][release-automations], run the following to add a comment to each GH issue that has been resolved with the new published version:
159+
19. Add a comment to each GH issue that has been resolved with the new published version. Download the `releaseData.json` artifact from the `verify-release-readiness` CircleCI job and run the following command inside of [cypress-io/release-automations][release-automations]:
169160
170161
```shell
171-
cd packages/issues-in-release && npm run do:comment -- --release X.Y.Z
162+
cd packages/issues-in-release && npm run do:comment -- --release-data <path_to_releaseData.json>
172163
```
173164
174-
22. Confirm there are no issues with the label [stage: pending release](https://github.com/cypress-io/cypress/issues?q=label%3A%22stage%3A+pending+release%22+is%3Aclosed) left
165+
22. Confirm there are no issues from the release with the label [stage: pending release](https://github.com/cypress-io/cypress/issues?q=label%3A%22stage%3A+pending+release%22+is%3Aclosed) left.
175166
176167
23. Check all `cypress-test-*` and `cypress-example-*` repositories, and if there is a branch named `x.y.z` for testing the features or fixes from the newly published version `x.y.z`, update that branch to refer to the newly published NPM version in `package.json`. Then, get the changes approved and merged into that project's main branch. For projects without a `x.y.z` branch, you can go to the Renovate dependency issue and check the box next to `Update dependency cypress to X.Y.Z`. It will automatically create a PR. Once it passes, you can merge it. Try updating at least the following projects:
177168
- [cypress-example-todomvc](https://github.com/cypress-io/cypress-example-todomvc/issues/99)

scripts/semantic-commits/get-binary-release-data.js

+16-20
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const getReleaseData = async (latestReleaseInfo) => {
7070
return
7171
}
7272

73-
const { data: pullRequest } = await octokit.request('GET /repos/{owner}/{repo}/pulls/{pull_number}', {
73+
const { data: pullRequest } = await octokit.request('GET /repos/{owner}/{repo}/pull/{pull_number}', {
7474
owner: 'cypress-io',
7575
repo: 'cypress',
7676
pull_number: references[0].issue,
@@ -92,6 +92,20 @@ const getReleaseData = async (latestReleaseInfo) => {
9292
})
9393
}))
9494

95+
console.log('Next release version is', nextVersion)
96+
97+
console.log(`${prsInRelease.length} pull requests have merged since ${latestReleaseInfo.version} was released.`)
98+
99+
prsInRelease.forEach((link) => {
100+
console.log(' -', link)
101+
})
102+
103+
console.log(`${issuesInRelease.length} issues addressed since ${latestReleaseInfo.version} was released.`)
104+
105+
issuesInRelease.forEach((link) => {
106+
console.log(' -', link)
107+
})
108+
95109
return {
96110
nextVersion,
97111
changedFiles,
@@ -112,23 +126,5 @@ if (require.main !== module) {
112126
(async () => {
113127
const latestReleaseInfo = await getCurrentReleaseData()
114128

115-
const {
116-
changelogData,
117-
issuesInRelease,
118-
prsInRelease,
119-
} = await getReleaseData(latestReleaseInfo)
120-
121-
console.log('Next release version is', changelogData.nextVersion)
122-
123-
console.log(`${prsInRelease.length} user-facing pull requests have merged since ${latestReleaseInfo.version} was released.`)
124-
125-
.prsInRelease.forEach((link) => {
126-
console.log(' -', link)
127-
})
128-
129-
console.log(`${issuesInRelease.length} user-facing issues addressed since ${latestReleaseInfo.version} was released.`)
130-
131-
issuesInRelease.forEach((link) => {
132-
console.log(' -', link)
133-
})
129+
await getReleaseData(latestReleaseInfo)
134130
})()

scripts/semantic-commits/get-current-release-data.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,20 @@ const childProcess = require('child_process')
77
const getCurrentReleaseData = (verbose = true) => {
88
verbose && console.log('Get Current Release Information\n')
99

10-
const stdout = childProcess.execSync('npm info cypress --json')
11-
const npmInfo = JSON.parse(stdout)
10+
const stdout = childProcess.execSync('yarn info cypress --json')
11+
const { data: npmInfo } = JSON.parse(stdout)
1212

1313
const latestReleaseInfo = {
1414
version: npmInfo['dist-tags'].latest,
15+
distTags: npmInfo['dist-tags'],
1516
commitDate: npmInfo.buildInfo.commitDate,
1617
buildSha: npmInfo.buildInfo.commitSha,
1718
}
1819

1920
verbose && console.log({ latestReleaseInfo })
2021

22+
latestReleaseInfo.versions = npmInfo.versions
23+
2124
return latestReleaseInfo
2225
}
2326

scripts/semantic-commits/validate-binary-changelog.js

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/* eslint-disable no-console */
2+
const fs = require('fs')
3+
const path = require('path')
24
const { validateChangelog } = require('./validate-changelog')
35
const { getCurrentReleaseData } = require('./get-current-release-data')
46
const { getReleaseData } = require('./get-binary-release-data')
57
const checkedInBinaryVersion = require('../../package.json').version
68

79
const changelog = async () => {
810
const latestReleaseInfo = await getCurrentReleaseData()
9-
let hasVersionBump = checkedInBinaryVersion !== latestReleaseInfo.version
11+
const hasVersionBump = !latestReleaseInfo.versions.includes(checkedInBinaryVersion) // account for branches behind develop
1012

1113
if (process.env.CIRCLECI) {
1214
console.log({ checkedInBinaryVersion })
@@ -18,13 +20,23 @@ const changelog = async () => {
1820
}
1921
}
2022

23+
const releaseData = await getReleaseData(latestReleaseInfo)
24+
25+
const dirPath = path.join(path.sep, 'tmp', 'releaseData')
26+
27+
if (!fs.existsSync(dirPath)) {
28+
fs.mkdirSync(dirPath)
29+
}
30+
31+
fs.writeFileSync(path.join(dirPath, 'releaseData.json'), JSON.stringify(releaseData, null, 2))
32+
33+
console.log('Release data saved to', path.join(dirPath, 'releaseData.json'))
34+
2135
const {
2236
nextVersion,
2337
changedFiles,
2438
commits,
25-
} = await getReleaseData(latestReleaseInfo)
26-
27-
console.log({ nextVersion })
39+
} = releaseData
2840

2941
return validateChangelog({
3042
nextVersion,

0 commit comments

Comments
 (0)