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

Ensure Yarn Workspace adapter supports ember try:reset. #467

Merged
merged 1 commit into from Mar 13, 2020

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Mar 12, 2020

Fundamentally, Adapter.prototype.cleanup cannot require Adatper.prototype.setup to have been called. Most of the time .setup is called before .cleanup (this happens with ember try:each and ember try:one), but when --skip-cleanup is specified (e.g. ember try:one scenario-name --skip-cleanup) and you subsequently run ember try:reset the .setup happened in a completely different process.

The issue here is a misunderstanding when we added the WorkspaceAdapter initially. Basically, the assumtion was that .setup was for setting up both local instance state (e.g. the this._packageAdapters array) and for actually preparing for a ember try:... run (doing backups / etc).

The fix is to move the internal state setup code directly into init/constructor, and ensure that .setup` is only used to create the backups themselves.

Fixes #466

Fundamentally, `Adapter.prototype.cleanup` **cannot** require
`Adatper.prototype.setup` to have been called. _Most_ of the time
`.setup` is called before `.cleanup` (this happens with `ember try:each`
and `ember try:one`), but when `--skip-cleanup` is specified (e.g.
`ember try:one scenario-name --skip-cleanup`) and you subsequently run
`ember try:reset` the `.setup` happened in a completely different
process.

The issue here is a misunderstanding when we added the
`WorkspaceAdapter` initially. Basically, the assumtion was that `.setup`
was for setting up both local instance state (e.g. the
`this._packageAdapters` array) **and** for actually preparing for a
`ember try:...` run (doing backups / etc).

The fix is to move the internal state setup code directly into
`init`/`constructor, and ensure that `.setup` is only used to create the
backups themselves.
@rwjblue rwjblue force-pushed the ensure-workspace-supports-reset branch from a82fc08 to 7648b01 Compare March 12, 2020 14:52
@codecov
Copy link

codecov bot commented Mar 12, 2020

Codecov Report

Merging #467 into master will not change coverage by %.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #467   +/-   ##
=======================================
  Coverage   96.91%   96.91%           
=======================================
  Files          17       17           
  Lines         584      584           
=======================================
  Hits          566      566           
  Misses         18       18           
Impacted Files Coverage Δ
lib/dependency-manager-adapters/workspace.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa4e3ff...7648b01. Read the comment docs.

Copy link
Contributor

@BarryThePenguin BarryThePenguin left a comment

Choose a reason for hiding this comment

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

Ahk.. makes more sense to be in the init() method

I can try this out today 👍🏻 Thanks! 🎉

@BarryThePenguin
Copy link
Contributor

Works well now, thank you 👏

@rwjblue rwjblue merged commit d47be24 into ember-cli:master Mar 13, 2020
@timiyay
Copy link

timiyay commented Apr 5, 2020

@rwjblue @kategengler Any chance of a new release to include the changes in this PR? 🙏

We're keen to upgrade from 3.12 LTS to 3.16 LTS, and we'd like to have ember-try in place to help us find issues, but are currently blocked by this yarn workspaces issue.

@rwjblue rwjblue deleted the ensure-workspace-supports-reset branch April 6, 2020 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ember try:reset with workspaces
4 participants