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

status: add icons to indicate package updatability #2906

Merged

Conversation

IanButterworth
Copy link
Sponsor Member

@IanButterworth IanButterworth commented Dec 31, 2021

Adds two icons to the status report:

  • for packages where a newer version can be installed
  • for packages where a newer version exists, but cannot be installed

Also adds padding to align the version numbers to make things a bit tidier?

If the user wants more information they can use pkg> status --outdated

I don't see a significant increase in execution time
master: 0.004629 seconds (8.33 k allocations: 722.516 KiB)
this PR: 0.006784 seconds (8.40 k allocations: 771.539 KiB)

Related issues
#1655
#2682

Todo

  • Needs tests adjusted for new padding etc.
  • Needs docs
  • Needs news

Edit:
Screen Shot 2022-01-03 at 10 41 34 AM

@KristofferC
Copy link
Sponsor Member

I think this is an appropriate level of noise to make. Originally I thought of mimicking the icon for the "not downloaded warning" but maybe having it close to the versions, as done here, makes more sense. I wonder if having a short hint towards status - -outdated at the bottom when one of these are printed is a good idea. That's also similar to the not downloaded warning telling you to do an instantiate.

@DilumAluthge
Copy link
Member

I wonder if having a short hint towards status - -outdated at the bottom when one of these are printed is a good idea.

I think this would be a good addition!

@IanButterworth
Copy link
Sponsor Member Author

Added!
I think is obvious enough so doesn't need a hint?

(@v1.8) pkg> st
Status `~/.julia/environments/v1.8/Project.toml`
  [336ed68f] CSV    v0.8.5 ⌅
  [295af30f] Revise v3.3.1
  [8dfed614] Test  
Info packages marked with ⌅ have new versions available that cannot be installed. To see why use `status --outdated`

@DilumAluthge
Copy link
Member

I think is obvious enough so doesn't need a hint?

I was thinking we would have a hint for either symbol.

@IanButterworth
Copy link
Sponsor Member Author

Ok. How about this

(@v1.8) pkg> st
Status `~/.julia/environments/v1.8/Project.toml`
  [336ed68f] CSV    v0.8.5 ⌃
  [295af30f] Revise v3.3.1
  [8dfed614] Test  
Info packages marked with ⌃ have new versions available
(@v1.8) pkg> st
Status `~/.julia/environments/v1.8/Project.toml`
  [336ed68f] CSV    v0.8.5 ⌅
  [295af30f] Revise v3.3.1
  [8dfed614] Test  
Info packages marked with ⌅ have new versions available but cannot be upgraded. To see why use `status --outdated`
(@v1.8) pkg> st
Status `~/.julia/environments/v1.8/Project.toml`
  [336ed68f] CSV    v0.8.5 ⌅
  [295af30f] Revise v3.3.0 ⌃
  [8dfed614] Test  
Info packages marked with ⌃ and ⌅ have new versions available, but those with ⌅ cannot be upgraded. To see why use `status --outdated`

@DilumAluthge
Copy link
Member

I like it!

@DilumAluthge
Copy link
Member

Missing a colon after Info?

@IanButterworth
Copy link
Sponsor Member Author

Info is colored green, like printpkgstyle

@IanButterworth IanButterworth force-pushed the ib/status_updatable_icons branch 2 times, most recently from 29b9a33 to 9c7b37e Compare December 31, 2021 23:57
@IanButterworth
Copy link
Sponsor Member Author

Is the last commit one reformat too far? It aligns the info past the version

     Status `/tmp/jl_BTeMGp/Project.toml`
  [54cfe95a] Pkg           v1.8.0    `~/work/Pkg.jl/Pkg.jl`
  [56f22d72] Artifacts               `@stdlib/Artifacts`
  [ade2ca70] Dates                   `@stdlib/Dates`
  [f43a241f] Downloads     v1.6.0    `@stdlib/Downloads`
  [76f85450] LibGit2                 `@stdlib/LibGit2`
  [8f399da3] Libdl                   `@stdlib/Libdl`
  [56ddb016] Logging                 `@stdlib/Logging`
  [d6f4376e] Markdown                `@stdlib/Markdown`
  [de0858da] Printf                  `@stdlib/Printf`
  [3fa0cd96] REPL                    `@stdlib/REPL`
  [9a3f8284] Random                  `@stdlib/Random`
  [ea8e919c] SHA           v0.7.0    `@stdlib/SHA`
  [9e88b42a] Serialization           `@stdlib/Serialization`
  [fa267f1f] TOML          v1.0.0    `@stdlib/TOML`
  [a4e569a6] Tar           v1.10.0   `@stdlib/Tar`
  [8dfed614] Test                    `@stdlib/Test`
  [cf7118a7] UUIDs                   `@stdlib/UUIDs`
  [3f19e933] p7zip_jll     v16.2.1+1 `@stdlib/p7zip_jll`
      Status `/tmp/jl_BTeMGp/Manifest.toml`
  [54cfe95a] Pkg                v1.8.0     `~/work/Pkg.jl/Pkg.jl`
  [0dad84c5] ArgTools           v1.1.1     `@stdlib/ArgTools`
  [56f22d72] Artifacts                     `@stdlib/Artifacts`
  [2a0f44e3] Base64                        `@stdlib/Base64`
  [ade2ca70] Dates                         `@stdlib/Dates`
  [f43a241f] Downloads          v1.6.0     `@stdlib/Downloads`
  [7b1f6079] FileWatching                  `@stdlib/FileWatching`
  [b77e0a4c] InteractiveUtils              `@stdlib/InteractiveUtils`
  [b27032c2] LibCURL            v0.6.3     `@stdlib/LibCURL`
  [76f85450] LibGit2                       `@stdlib/LibGit2`
  [8f399da3] Libdl                         `@stdlib/Libdl`
  [56ddb016] Logging                       `@stdlib/Logging`
  [d6f4376e] Markdown                      `@stdlib/Markdown`
  [ca575930] NetworkOptions     v1.2.0     `@stdlib/NetworkOptions`
  [de0858da] Printf                        `@stdlib/Printf`
  [3fa0cd96] REPL                          `@stdlib/REPL`
  [9a3f8284] Random                        `@stdlib/Random`
  [ea8e919c] SHA                v0.7.0     `@stdlib/SHA`
  [9e88b42a] Serialization                 `@stdlib/Serialization`
  [6462fe0b] Sockets                       `@stdlib/Sockets`
  [fa267f1f] TOML               v1.0.0     `@stdlib/TOML`
  [a4e569a6] Tar                v1.10.0    `@stdlib/Tar`
  [8dfed614] Test                          `@stdlib/Test`
  [cf7118a7] UUIDs                         `@stdlib/UUIDs`
  [4ec0a83e] Unicode                       `@stdlib/Unicode`
  [deac9b47] LibCURL_jll        v7.73.0+4  `@stdlib/LibCURL_jll`
  [29816b5a] LibSSH2_jll        v1.9.1+2   `@stdlib/LibSSH2_jll`
  [c8ffd9c3] MbedTLS_jll        v2.24.0+2  `@stdlib/MbedTLS_jll`
  [14a3606d] MozillaCACerts_jll v2020.7.22 `@stdlib/MozillaCACerts_jll`
  [83775a58] Zlib_jll           v1.2.12+1  `@stdlib/Zlib_jll`
  [8e850ede] nghttp2_jll        v1.41.0+1  `@stdlib/nghttp2_jll`
  [3f19e933] p7zip_jll          v16.2.1+1  `@stdlib/p7zip_jll`

@IanButterworth
Copy link
Sponsor Member Author

IanButterworth commented Jan 1, 2022

I'm happy with this now.

I think the new formatting of the status output into columns helps with readability, but it is a little tangential.. I just felt it was needed because the new indicators made it a little harder to read without column formatting

@IanButterworth IanButterworth changed the title add icons to indicate updatability to status prints status: add icons to indicate package updatability and format into columns Jan 1, 2022
@KristofferC
Copy link
Sponsor Member

Can't say I am an immediate fan of the aligning but it might be one of those things that take get used to.

When I thought about a feature like this, I was thinking of putting the icon in the left gutter (which we already use to show the icon when a package is not downloaded).

@IanButterworth
Copy link
Sponsor Member Author

IanButterworth commented Jan 2, 2022

yeah, that's definitely viable. Without the tips I thought it needed to be beside the version number to make it clearer, but with the tips I think the gutter is a good place for it, like the not downloaded icon & tip.

I'll undo the reformatting

@IanButterworth IanButterworth added this to the 1.8 milestone Jan 2, 2022
@IanButterworth
Copy link
Sponsor Member Author

IanButterworth commented Jan 2, 2022

Perhaps similarly to #2866 in the diff mode when there are no changes we could also list packages that are held back?

(@v1.8) pkg> st
Status `~/.julia/environments/v1.8/Project.toml`
  [336ed68f] CSV v0.9.11
  [c46f51b8] ProfileView v1.0.1
⌅ [295af30f] Revise v3.3.0
  [77ec8976] GTK3_jll v3.24.31+0 `~/.julia/dev/GTK3_jll`
Info packages marked with ⌅ have new versions available but cannot be upgraded. To see why use `status --outdated`

(@v1.8) pkg> up
    Updating registry at `~/.julia/registries/General.toml`
  No Changes to `~/.julia/environments/v1.8/Project.toml`
⌅ [295af30f] Revise v3.3.0
  No Changes to `~/.julia/environments/v1.8/Manifest.toml`
⌅ [295af30f] Revise v3.3.0
Info packages marked with ⌅ have new versions available but cannot be upgraded. To see why use `status --outdated`

currently you'd just get

(@v1.8) pkg> up
    Updating registry at `~/.julia/registries/General.toml`
  No Changes to `~/.julia/environments/v1.8/Project.toml`
  No Changes to `~/.julia/environments/v1.8/Manifest.toml

@DilumAluthge
Copy link
Member

DilumAluthge commented Jan 2, 2022

Seems reasonable to me.

@DilumAluthge
Copy link
Member

Although, would that make the view for ] up too noisy? Will users expect that ] up only prints the packages that are modified?

@IanButterworth
Copy link
Sponsor Member Author

Perhaps just

(@v1.8) pkg> up
    Updating registry at `~/.julia/registries/General.toml`
  No Changes to `~/.julia/environments/v1.8/Project.toml`
  No Changes to `~/.julia/environments/v1.8/Manifest.toml
Info some packages have new versions available but are held back. Use `status --outdated` for more information.

@DilumAluthge
Copy link
Member

Nice!

@DilumAluthge
Copy link
Member

DilumAluthge commented Jan 2, 2022

Presumably it's possible to get a situation where, after you do ] up, there are some packages that would have the symbol, right?

E.g. if there are two optima, and the resolver has to pick one.

In that case, there would be "some packages that have new versions available", except that they aren't being held back, right? Presumably we should still print some kind of message in that case?

@DilumAluthge
Copy link
Member

Maybe: "some packages have new versions available, but it is not possible to update to those new versions without downgrading some other packages".

@IanButterworth
Copy link
Sponsor Member Author

I think that's rare and Info some packages have new versions available but are held back. is accurate-enough for a generic message

@IanButterworth
Copy link
Sponsor Member Author

Added to up only. A no-change diff in any other status print won't show this info message

(@v1.8) pkg> up
    Updating registry at `~/.julia/registries/General.toml`
  No Changes to `~/.julia/environments/v1.8/Project.toml`
  No Changes to `~/.julia/environments/v1.8/Manifest.toml`
        Info Some packages have new versions but cannot be upgraded. To see why use `status --outdated`

@KristofferC
Copy link
Sponsor Member

KristofferC commented Jan 3, 2022

(@v1.7) pkg> st
Status `~/.julia/environments/v1.7/Project.toml`
⌃ [6e4b80f9] BenchmarkTools v1.1.0
→  [f68482b8] Cthulhu v2.4.4
  [31a5f54b] Debugger v0.7.0
...
Info Packages marked with → are not downloaded, use `instantiate` to download
Info Packages marked with ⌃ have new versions available

looks a bit misaligned.

Should the have some color?

@IanButterworth
Copy link
Sponsor Member Author

Should the ⌅ have some color?

Maybe the info color? I didn't think it warranted green or warning or error colors.

I'll look into that alignment bug

@IanButterworth
Copy link
Sponsor Member Author

IanButterworth commented Jan 3, 2022

Screen Shot 2022-01-03 at 10 41 34 AM

@KristofferC
Copy link
Sponsor Member

The --outdated looks like

image

so fram that, using yellow seems like it would match, or?

@IanButterworth
Copy link
Sponsor Member Author

Actually both upgradable and heldback lines in the --outdated report are yellow.. so yellow might not make sense?

But, I think the right answer might emerge after using it? We could go with yellow and see?

Copy link
Sponsor Member

@KristofferC KristofferC left a comment

Choose a reason for hiding this comment

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

Let's try with this iteration for now. Always possible to tweak based on feedback. Great job!

@DilumAluthge
Copy link
Member

Thank you Ian!

@IanButterworth IanButterworth merged commit 69a95ac into JuliaLang:master Jan 3, 2022
@IanButterworth IanButterworth deleted the ib/status_updatable_icons branch January 3, 2022 21:44
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.

3 participants