Skip to content
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

chore: use SKIP_RELEASE_CHANGELOG_VALIDATION env var to skip release-… #27670

Merged
merged 6 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions guides/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The `@cypress/`-namespaced NPM packages that live inside the [`/npm`](../npm) di
- [`cypress-documentation`](https://github.com/cypress-io/cypress-documentation)
- [`cypress-docker-images`](https://github.com/cypress-io/cypress-docker-images)
- [cypress-io/release-automations][release-automations]


If you don't have access to 1Password, ask a team member who has done a deploy.

Expand Down Expand Up @@ -88,7 +88,7 @@ _Note: It is advisable to notify the team that the `develop` branch is locked do

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.

3. Create a Release PR -
3. Create a Release PR -
Bump, submit, get approvals on, and merge a new PR. This PR should:
- Bump the Cypress `version` in [`package.json`](package.json)
- 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
Expand Down Expand Up @@ -185,7 +185,9 @@ _Note: It is advisable to notify the team that the `develop` branch is locked do

23. Notify the team that `develop` is reopen, and post a message to the Releases Slack channel with a link to the changelog.

24. 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:
24. If utilizing the `SKIP_RELEASE_CHANGELOG_VALIDATION_FOR_BRANCHES` to override and skip changelog validation for this release, change its value as needed or delete it from CircleCI so that subsequent releases and PRs will go through changelog validation.

25. 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:
- [cypress-example-todomvc](https://github.com/cypress-io/cypress-example-todomvc/issues/99)
- [cypress-realworld-app](https://github.com/cypress-io/cypress-realworld-app/issues/41)
- [cypress-example-recipes](https://github.com/cypress-io/cypress-example-recipes/issues/225)
Expand Down
2 changes: 1 addition & 1 deletion scripts/semantic-commits/validate-binary-changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const changelog = async () => {
if (process.env.CIRCLECI) {
console.log({ checkedInBinaryVersion })

if (process.env.CIRCLE_BRANCH !== 'develop' && process.env.CIRCLE_BRANCH !== 'fix-changelog-script' && !/^release\/\d+\.\d+\.\d+$/.test(process.env.CIRCLE_BRANCH) && !hasVersionBump) {
if (process.env.CIRCLE_BRANCH !== 'develop' && process.env.CIRCLE_BRANCH !== 'add-skip-changelog-validation' && !/^release\/\d+\.\d+\.\d+$/.test(process.env.CIRCLE_BRANCH) && !hasVersionBump) {
console.log('Only verify the entire changelog for develop, a release branch or any branch that bumped to the Cypress version in the package.json.')

return
Expand Down
14 changes: 14 additions & 0 deletions scripts/semantic-commits/validate-changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,22 @@ const _handleErrors = (errors) => {
/**
* Determines if the Cypress changelog has the correct next version and changelog entires given the provided
* list of commits.
*
* Can be skipped by setting the SKIP_RELEASE_CHANGELOG_VALIDATION_FOR_BRANCHES
* environment variable in CircleCI to a branch or comma-separated list of
* branches
*/
async function validateChangelog ({ changedFiles, nextVersion, pendingRelease, commits }) {
if (process.env.SKIP_RELEASE_CHANGELOG_VALIDATION_FOR_BRANCHES) {
const branches = process.env.SKIP_RELEASE_CHANGELOG_VALIDATION_FOR_BRANCHES.split(',')

if (branches.includes(process.env.CIRCLE_BRANCH)) {
console.log(`Skipping changelog validation because branch (${process.env.CIRCLE_BRANCH}) is included in SKIP_RELEASE_CHANGELOG_VALIDATION_FOR_BRANCHES (${process.env.SKIP_RELEASE_CHANGELOG_VALIDATION_BRANCHES})`)

return []
}
}

const hasUserFacingCommits = commits.some(({ semanticType }) => hasUserFacingChange(semanticType))

if (!hasUserFacingCommits) {
Expand Down