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

upgrade-interactive row colours are incorrect #3815

Closed
jesstelford opened this issue Jul 4, 2017 · 5 comments · Fixed by #4183 or GulajavaMinistudio/yarn#102
Closed

upgrade-interactive row colours are incorrect #3815

jesstelford opened this issue Jul 4, 2017 · 5 comments · Fixed by #4183 or GulajavaMinistudio/yarn#102

Comments

@jesstelford
Copy link

Bug report

Current behaviour:

screen shot 2017-07-04 at 5 07 42 pm

Reproduction steps:

Have a repo with various out of date packages, and run yarn upgrade-interactive to see the incorrect colours applied to the rows.

Expected behaviour:

  • @domain-group/eslint-config-domain, @domain-group/fe-brary & @domain-group/fe-build should be neither red nor yellow - they have a major version bump with API incompatible changes.
  • babel-core should be yellow as it is a minor update.

Environment:

$ yarn --version
0.27.5
$ node --version
v7.10.0
$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: OS X 10.10.5 (14F2411)
      Kernel Version: Darwin 14.5.0
@BYK
Copy link
Member

BYK commented Jul 5, 2017

Hi @jesstelford - Can you provide a package.json or a small test repo/gist so we can reliably reproduce this.

@lirantal
Copy link
Contributor

I'm observing similar color/definition inconsistencies for my project at https://github.com/lirantal/dockly so you can easily reproduce using it's package.json file:

image

@carlrosell
Copy link
Contributor

carlrosell commented Aug 10, 2017

I created a small repository with eslint@^3.18.0 as the only dependency https://github.com/CarlRosell/yarn-upgrade-interactive. The lock file is from another repository at work. The one that bit me and made me look for issues was react-router 3.0.2 > 4.1.2:

screen shot 2017-08-10 at 17 39 13

@rally25rs
Copy link
Contributor

rally25rs commented Aug 11, 2017

You know, last time I was in the upgrade-interactive code I thought the function that determined colors looked a little suspect, but I didn't change it because I assumed it must have been right.

const colorizeName = ({current, wanted}) => (current === wanted ? reporter.format.yellow : reporter.format.red);

That doesn't seem to do anything to check the parts of the versions.

@BYK
Copy link
Member

BYK commented Aug 15, 2017

Was able to reproduce with the following:

git clone git@github.com:lirantal/dockly.git
cd dockly
yarn upgrade-interactive

I think this is quite broken. I also think the legend should be as follows:

  • Green: patch
  • Yellow: minor
  • Red: major

Thoughts?

@BYK BYK closed this as completed in #4183 Aug 20, 2017
BYK pushed a commit that referenced this issue Aug 20, 2017
…eractive commands (#4183)

**Summary**
This will fix #3815 by implementing a solution mentioned here #3815 (comment).
As the `outdated`-command displayed pretty much the same data I changed the colors of that command as well.

New output: 
![screen shot 2017-08-16 at 10 22 05](https://user-images.githubusercontent.com/2036823/29357714-c91f457a-8278-11e7-99fc-ef1a3be65b3e.png)
![screen shot 2017-08-16 at 11 48 54](https://user-images.githubusercontent.com/2036823/29357746-e4c1c1ea-8278-11e7-8541-6f71213d686d.png)

**Test plan**

I did not create any new tests as this is only a visual change and was not tested before. But if we decide to move the new "helper files" to a utils folder I can write a few tests to test the output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment