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

build: add missing yarn.lock for cypress update if necessary #1066

Closed
wants to merge 1 commit into from

Conversation

MikeMcC399
Copy link
Collaborator

This PR increases the robustness of the update script

used by

npm run update:cypress

If the yarn.lock file is missing in the following Yarn Modern example directories, then Yarn will output an error message and not install:

This is due to the mixture of Yarn and npm in the same monorepo. To make the update script more robust, an empty yarn.lock is created in the above directories, if it is missing. Yarn will then populate the respective lockfile correctly and not look in higher level directories for a lockfile.

Verification

Delete

then execute

npm run update:cypress

ensuring that there are no Yarn errors reported. Restore the original contents of the yarn.lock files after the test.

@MikeMcC399 MikeMcC399 marked this pull request as ready for review October 24, 2023 15:50
@cypress-app-bot
Copy link

Copy link
Member

@emilyrohrbough emilyrohrbough left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why this change is needed since the yarn lock files are check into the project. When would someone experience an issue with the lock file missing?

@MikeMcC399
Copy link
Collaborator Author

@emilyrohrbough

Thanks for questioning the need for this PR. I have decided to withdraw it.

  • The reason for it is related to chore(deps): downgrade to qs@6.10.4 in yarn-classic example #1064. Due to a restriction in Yarn Classic, a deprecated version of qs was being installed. Although a workaround was added in fix(deps): lock qs to 6.10.4 request#44, Cypress has not updated the requirement of @cypress/request from ^3.0.0 to ^3.0.1. This means that the version of qs used by Cypress is not deterministic and depends instead on the installation history. To work around this problematic scenario it needs yarn.lock to be deleted and Cypress needs to be reinstalled. That is the situation which led to needing to delete yarn.lock and the update script couldn't cope with this.

So it's all about a workaround, which should not happen again, and so on reflection, it's probably better not to complicate the update script and just leave it the way it is.

Thank you by the way for merging some of my other open PRs!

@MikeMcC399 MikeMcC399 closed this Oct 27, 2023
@MikeMcC399 MikeMcC399 deleted the add-yarn-lock branch October 27, 2023 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants