-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix: allow migration of pluginsFile using env properties
#20770
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: allow migration of pluginsFile using env properties
#20770
Conversation
|
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
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 |
||||||||||||||||||||||||||||||||||
env properties
|
@elevatebart - Can you add details about what this is fixing and why to the PR description? |
| config.integrationFolder = 'tests/e2e' | ||
| config.testFiles = '**/*.spec.js' | ||
| // In the plugin @cypress/code-coverage this pattern is used | ||
| config.env.CYPRESS_RECORD_KEY_DRAGGING = 'true' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So as I understand it, this PR makes it so that this line no longer causes an error. Does it cause any change in the output post-migration that we can assert on (that it's persisted)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not.
I will indeed add a more detailed description of the changes.
|
@elevatebart looks good - can you get CI green so we can merge? Anything left? |
|
@lmiller1990 The PR seems ready for review. I will wait until CI is greeen to send you any slack message and re-request your review. |
|
✅ - let's get one more review. |
| // | ||
| // Add options in alphabetical order for better readability | ||
|
|
||
| // TODO - add boolean attribute to indicate read-only / static vs mutable options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a followup ticket for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no we don't. this file is a pure copy paste of the 9.X config/lib/options.ts. I should clean it up and remove all the not so useful fluff from it.
I could also add where it comes from at the top of the file with a warning to use it only to migrate 9.X projects.
|
Looks good @elevatebart, once we have an answer on the question above let's merge!! |
* 10.0-release: fix: add index.mjs to the published files of cli (#20884) refactor: lift indexHtmlFile up to component, add validation (#20870) fix: allow migration of pluginsFile using `env` properties (#20770) fix: viewport from CLI on CT (#20849) fix: git data source unit test failure (#20875) fix: Ensuring current browser is synchronized between app and launchpad (#20830) Fix missed await on merge conflict resolution test(unification): move record keys to contexts (#20860) test: move record keys to contexts (#20859) make alerts more responsive chore: Update Chrome (stable) to 100.0.4896.60 (#20841) Revise test. fix: cy.root respect timeout option. fix(deps): update dependency ansi-regex to v4.1.1 [security] (#20836) chore(deps): update dependency ansi-regex to 4.1.1 [security] (#20807) chore: Refactor cri-client to use async/await (#20825) remove automationId from runnerStore fix firefox automation and adress feedback feat: add automation warning/disconnected states in app
…ess into tgriesser/fix/UNIFY-1389 * 'tgriesser/fix/UNIFY-1389' of github.com:cypress-io/cypress: (56 commits) fix: add index.mjs to the published files of cli (#20884) refactor: lift indexHtmlFile up to component, add validation (#20870) fix: allow migration of pluginsFile using `env` properties (#20770) fix: viewport from CLI on CT (#20849) Don't communicate if process isn't connected Remove config.get Update packages/data-context/src/data/ProjectLifecycleManager.ts fix: git data source unit test failure (#20875) add comment for autoBindDebug PR comments Fix tests that visit app without a configured testing type Fix type script Fix issue with refreshing on the welcome screen Add test for migration scenario Fix types Move IPC logic to all be in ProjectConfigIPC Other minor cleanup Additional code cleanup Fix more tests Fix typo ...
* 10.0-release: (92 commits) chore: remove dependency-tree dep (#20905) chore(launchpad): work on infra for scaffold tests (#20818) fix: build mjs in the cli (#20889) fix(unify): Cypress version link should point to Cypress doc's changelog (#20869) fix: windows build (#20854) fix: add index.mjs to the published files of cli (#20884) refactor: lift indexHtmlFile up to component, add validation (#20870) fix: allow migration of pluginsFile using `env` properties (#20770) fix: viewport from CLI on CT (#20849) Don't communicate if process isn't connected Remove config.get Update packages/data-context/src/data/ProjectLifecycleManager.ts fix: git data source unit test failure (#20875) add comment for autoBindDebug fix: Ensuring current browser is synchronized between app and launchpad (#20830) Fix missed await on merge conflict resolution test(unification): move record keys to contexts (#20860) test: move record keys to contexts (#20859) PR comments Fix tests that visit app without a configured testing type ...
User facing changelog
Allow migrating a project that uses
config.envby adding a default env property to the config object.Details
In some pre-10.X plugins, the config object is modified to add variables to
config.env. In the migration process, we run thepluginsFilefunction. During this execution, plugins expect the config object contain certain values like "env" since they are provided as default values in 9.X.EDIT 1: I do not think it is a good idea to copy all the default values from 9 into the migration process. This would mean a lot of code to maintain. I preferred a more pragmatic approach: Check that most common plugins work and fix only the values that are actually used in those.
EDIT 2: Since I had to diff the output anyway, I finally opted for copying the full defaults from 9.X. I don't expect them to change much and it will be helpful for users. Migration now mirrors as well as possible the way the config is resolved in 9.X.
cypress-documentation?type definitions?cypress.schema.json?