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

fix(server): correctly include projectRoot when adding a CI project from GUI #17514

merged 11 commits into from
Jul 29, 2021


Copy link

@lmiller1990 lmiller1990 commented Jul 29, 2021

  • Closes N/A

User facing changelog

Fix a bug where you cannot add a new CI project from the Cypress launcher GUI.

Additional details

This PR targets master, so we can do a patch release that just bundles this fix. It will probably need this fix for CI to be green.

How to reproduce:

  1. cd packages/desktop-gui (for example)
  2. Run with CYPRESS_INTERNAL_ENV=production yarn cross-env TZ=America/New_York node ../../scripts/cypress open --global
  3. Click "Drag your project here or select manually" and choose any project without a projectId in cypress.json
  4. Click "Runs" tab
  5. Log in to dashboard
  6. Enter a project name and "Set up project". You get this error:


Check out this branch and do the above to manually verify this is fixed. I also added some tests - the problem was we assume options.projectRoot exists, but it does not for projects added via global mode. The fix is to simply pass the projectRoot when adding a new project, instead of relying on options.projectRoot.

How has the user experience changed?

Can correctly create a CI project from the GUI.

Test: adding an existing project

Testing: adding a new project

PR Tasks

  • Have tests been added/updated?
  • Has the original issue or this PR been tagged with a release in ZenHub?
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Have API changes been updated in the type definitions?
  • Have new configuration options been added to the cypress.schema.json?

elevatebart and others added 3 commits July 27, 2021 12:26
* fix: make vite re-run on supportFile change

* chore: vite - add an example of support css

* fix lachlan's remarks
@lmiller1990 lmiller1990 requested a review from a team as a code owner July 29, 2021 01:09
@lmiller1990 lmiller1990 requested review from flotwig and jennifer-shehane and removed request for a team July 29, 2021 01:09
Copy link

cypress-bot bot commented Jul 29, 2021

Thanks for taking the time to open a PR!

@lmiller1990 lmiller1990 force-pushed the lmiller1990/fix-adding-ci-project-from-gui branch from 274c3a6 to b8cb29e Compare July 29, 2021 01:11
@lmiller1990 lmiller1990 changed the base branch from develop to master July 29, 2021 01:12
@@ -374,7 +374,7 @@ class SetupProject extends Component {
_setupProject () {
if (this.state.newProject) {
return dashboardProjectsApi.setupDashboardProject({
projectName: this.state.projectName,
projectRoot: this.props.project.path,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the fix - instead of using options.projectRoot, we should just pass the projectRoot when we call setupDashboardProject.

@lmiller1990 lmiller1990 requested review from panzarino and removed request for flotwig July 29, 2021 01:13
Copy link

cypress bot commented Jul 29, 2021

Test summary

4122 0 50 2Flakiness 0

Run details

Project cypress
Status Passed
Commit 40948ba
Started Jul 29, 2021 3:18 PM
Ended Jul 29, 2021 3:27 PM
Duration 09:44 💡
OS Linux Debian - 10.8
Browser Chrome 92

View run in Cypress Dashboard ➡️

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

Copy link

@lmiller1990 Have you tested this for selecting an existing project from the dashboard? This should only insert the projectId but I don't see any changes that directly touch this

Copy link
Contributor Author

@panzarino I will try this now.

Copy link
Contributor Author

lmiller1990 commented Jul 29, 2021

@panzarino good catch... fixed here: 4f68416

I added some videos showing manually testing in the PR description.

@jennifer-shehane jennifer-shehane changed the base branch from master to develop July 29, 2021 13:30
Copy link

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

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

I've manually verified that this fixes the original issue.

@chrisbreiding chrisbreiding self-requested a review July 29, 2021 14:37
@chrisbreiding chrisbreiding merged commit e49b3a4 into develop Jul 29, 2021
@lmiller1990 lmiller1990 deleted the lmiller1990/fix-adding-ci-project-from-gui branch July 29, 2021 16:59
Copy link

cypress-bot bot commented Jul 29, 2021

Released in 8.1.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v8.1.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jul 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

6 participants