Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

Replace ascii cue to visual cue for "installing package" #376

Merged
merged 1 commit into from Jun 17, 2014
Merged

Replace ascii cue to visual cue for "installing package" #376

merged 1 commit into from Jun 17, 2014

Conversation

Redsandro
Copy link
Contributor

Change old school ascii "underline" style cue to a visual cue by writing installing package title in brighter green.

This is especially convenient when you install 10 packages at once.

Just a proposition. Pending review.

See #374 @ #374

Change old school ascii "underline" style cue to a visual cue by writing installing package title in brighter green.

This is especially convenient when you install 10 packages at once.

Just a proposition. Pending review.

See #374 @ #374
@Redsandro
Copy link
Contributor Author

@ferventcoder : For every package you see the full statement

Chocolatey (v0.9.8.23) is installing 'SomePackage' and dependencies. By installing you accept the license for 'renamemaster' and each dependency you are installing.
SomePackage v1.1.1.1
(...)
Chocolatey (v0.9.8.23) is installing 'OtherPackage' and dependencies. By installing you accept the license for 'renamemaster' and each dependency you are installing.
OtherPackage v1.1.1.1
(...)

Would be nice to see the message about Chocolatey once (and licenses also once, if you have to). The packages can be mentioned once (apt-get style) because the package is mentioned again on the next line anyway.

Chocolatey (v0.9.8.23) is installing the following packages:
SomePackage OtherPackage ThisPackage ThatPackage

By installing you accept the licenses for these packages and dependencies.

SomePackage v1.1.1.1
(...)
OtherPackage v1.1.1.1
(...)

Or something. I don't know where to add a once-only message in the installation process, but then these messages can be left out: https://github.com/chocolatey/chocolatey/search?q=is+installing+%27&ref=cmdform

@Redsandro
Copy link
Contributor Author

Following up on #375 (comment) : Am home now (where I have Windows 8) and here is the output of default 80 width terminal for installing krita and paint.net:

C:\Users\Redsandro>cinst krita paint.net
Chocolatey (v0.9.8.21-beta1) is installing 'krita' and dependencies. By 
installing you accept the license for 'krita' and each dependency you are 
installing.
______ krita v2.7.9.0 ______
Downloading Calligra Krita 64 bit (
http://heap.kogmbh.net/downloads/krita_x64_2.7.9.0.msi) to 
C:\Users\Redsandro\AppData\Local\Temp\chocolatey\Calligra Krita\Calligra 
KritaInstall.MSI
Installing Calligra Krita...
Elevating Permissions and running msiexec /i 
"C:\Users\Redsandro\AppData\Local\Temp\chocolatey\Calligra Krita\Calligra 
KritaInstall.MSI" /quiet /norestart . This may take awhile, depending on the 
statements.
Calligra Krita has been installed.
Calligra Krita has finished successfully! The chocolatey gods have answered 
your request!
Calligra Krita has finished successfully! The chocolatey gods have answered 
your request!
Finished installing 'krita' and dependencies - if errors not shown in 
console, none detected. Check log for errors if unsure.
Reading environment variables from registry. Please wait... Done.
Chocolatey (v0.9.8.21-beta1) is installing 'paint.net' and dependencies. By 
installing you accept the license for 'paint.net' and each dependency you 
are installing.
______ paint.net v3.5.11.20130909 ______

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
da---        12/21/2013     14:39            paint.net
Downloading paint.net 64 bit (
http://www.dotpdn.com/files/Paint.NET.3.5.11.Install.zip) to 
C:\Users\Redsandro\AppData\Local\Temp\chocolatey\paint.net\paint.netInstall.zi
p
Extracting 
C:\Users\Redsandro\AppData\Local\Temp\chocolatey\paint.net\paint.netInstall.zi
p to C:\Common\Chocolatey\lib\paint.net.3.5.11.20130909\tools...
C:\Common\Chocolatey\lib\paint.net.3.5.11.20130909\tools
paint.net has finished successfully! The chocolatey gods have answered your 
request!
Installing paint.net...
Elevating Permissions and running 
C:\Common\Chocolatey\lib\paint.net.3.5.11.20130909\tools\Paint.NET.3.5.11.Inst
all.exe /auto DESKTOPSHORTCUT=0 . This may take awhile, depending on the 
statements.
paint.net has been installed.
paint.net has finished successfully! The chocolatey gods have answered your 
request!
Finished installing 'paint.net' and dependencies - if errors not shown in 
console, none detected. Check log for errors if unsure.
Reading environment variables from registry. Please wait... Done.

Here is what I think it should look like:

C:\Users\Redsandro>cinst krita paint.net

Chocolatey (v0.9.8.23) is installing the following packages:
krita paint.net

By installing you accept the licenses for these packages and dependencies.

krita v2.7.9.0
Downloading Calligra Krita 64 bit
From: http://heap.kogmbh.net/downloads/krita_x64_2.7.9.0.msi
To:   %Temp%\chocolatey\Calligra Krita\Calligra KritaInstall.MSI
Installing Calligra Krita...
Elevating Permissions...
Running MSI installer...
Calligra Krita has been installed.

paint.net v3.5.11.20130909
Downloading paint.net 64 bit
From: http://www.dotpdn.com/files/Paint.NET.3.5.11.Install.zip
To:   %Temp%\chocolatey\paint.net\paint.netInstall.zip
Extracting...
Installing paint.net...
Elevating Permissions...
Running EXE installer...
paint.net has been installed.

Chocolatey installed 2 packages. 0 packages failed.
See the log for details.
The chocolatey gods have answered your request!

@ferventcoder
Copy link
Contributor

That last couple of lines looks somewhat like Yum report summary.

@Redsandro
Copy link
Contributor Author

I'm not even using Yum (apt-get here) but I am not surprised because #GMTA. 😉

To illustrate that we don't need large error messages. Just output the error to the log, and output a single line saying installation failed to the output. It will say, e.g.

(...)
paint.net installation failed. :(

Chocolatey installed 1 packages. 1 packages failed.
See the log for details.
The chocolatey gods have answered your request!

@gep13
Copy link
Member

gep13 commented Dec 21, 2013

If we are going to say see the log for details, then I think we should include where the log file is located, or have a Read-Host, or something, asking if you want to open the log file.

@gep13
Copy link
Member

gep13 commented Dec 21, 2013

By the way, I really like the suggestion for the new, trimmed, output.

@ferventcoder
Copy link
Contributor

The only thing I would change with the new output might be to list the
failed pkg names so one would nit have to crack open a log file just to
figure out what did not install.

On Saturday, December 21, 2013, Gary Ewan Park wrote:

By the way, I really like the suggestion for the new, trimmed, output.


Reply to this email directly or view it on GitHubhttps://github.com//pull/376#issuecomment-31072941
.

Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

@mwrock
Copy link
Contributor

mwrock commented Dec 22, 2013

A few suggestions:

  • output psobjects to the pipeline with info like success/fail, exceptions, packagename
  • all verbose info that goes to the log should also gk to the console if -verbose is passed or $verbose preference is set to continue.

@rismoney
Copy link
Contributor

Agree with @mwrock wholeheartedly.

@Redsandro
Copy link
Contributor Author

If we are going to say see the log for details, then I think we should include where the log file is located

I agree*, as long as it fits in a 80 character line, otherwise it needs to be shortened.

or have a Read-Host, or something, asking if you want to open the log file.

I absolutely disagree. Nothing should hang the process. Not waiting for input. It should be able to complete on it's own. Maybe with an exit code.

list the failed pkg names so one would not have to crack open a log file just to figure out what did not install.

I agree*, but you would not have to open the log file to figure that out. Because now that the new output is actually a pleasure to read, you'll quickly spot a red line. Here's a colored mockup:

Clean output mockup for Chocolatey
http://cssdesk.com/JUTPR

all verbose info that goes to the log should also gk to the console if -verbose is passed or $verbose preference is set to continue.

I agree.

output psobjects to the pipeline with info like success/fail, exceptions, packagename

I don't understand so I'll leave opinions to the professionals. :)

*) There's more interesting stuff we could do, for example, list the dependencies of all packages after the to-be-installed packages. But I thought: Let's clean this up first, and add features later. Small steps have a bigger chance of actually being stepped. :)

We could also remove the To: %Temp% line and put it in the log, because it doesn't really add anything. But the From: line is important (seeing (and trusting) the source is important).

@gep13
Copy link
Member

gep13 commented Dec 22, 2013

@mwrock is this the way Boxstarter currently does it? Can you link to a specific example?

@Redsandro all valid points :-)

@mwrock
Copy link
Contributor

mwrock commented Dec 24, 2013

Yeah. In v2.1 I reworked Boxstarter output to this model.

Regarding the verbose output, you can handle this with Write-Verbose or Write-Debug or both. Its not always crystal clear when to use one over the other. I use Write-Verbose but Chocolatey already makes use of Write-Debug and proxies the "real" Write-Debug function in order to intercept the output and write it to the log. So as long as you use Write-Debug for all output you want to be logged but NOT displayed, that is exactly what will happen. If the user wants the debug output to print to the console, they just need to set $DebugPreference to "Continue". Thats a PowerShell automatic variable and tells PS how to handle Write-Debug. The default value of $DebugPreference is "SilentlyContinue" which causes Write-Debug to do nothing (or in Choco's case, JUST log to disk). What makes this tricky for choco are the Batch redirects. Setting $debugPreference to "Continue" wil only have the desired effect if calling choco's Chocolatey.ps1 directly because then the choco call runs in the same scope as the caller. Using the batch redirect like cinst creates a new powershell session with the preferences set to the defaults. So you would need to add -Debug parameters to the choco commands that will set the $debugPreference of the choco powershell session to print debug output if specified.

The PSObjects make parsing and reacting to chocolatey results much more script friendly. Instead of (or in addition to)

Write-Host "Chocolatey failed to install $packageName yadayadayada"

You have

Write-Output @{PackageName=$PackageName;Success=$true;Exceptions=$TheExceptionsRaised}

This means I can inspect the results like so:

$result=Chocolatey-Install MyPackage
if(!$result.Success){
   #Do something to deal with the failure
}

Again this is tricky due to the batch stuff. I lose the Powershell pipeline since the chocolatey batch file spawns a new PS session. So using cinst or another one of the batch file gateways, $result would not capture the output but I do believe it would at least print the object to the console. Users who want to take advantage of the pipeline would just need to call chocolateys powershell functions directly.

@ferventcoder
Copy link
Contributor

What do you think of this format?
image

I had a good example to read while working on this. ;)

@Redsandro
Copy link
Contributor Author

Textually this is pretty awesome! 👍

However, the color doesn't really add anything. And the text can be more 80-friendly. So please allow me to comment on that:

  1. Using all the same color has no visual benefit. Alternate between key information and verbose information (and successful information and error information) with color and weight.
  2. Take care of the default console width, you don't want a sentence wrap it's last two characters to the next line.
    • Preferably, you don't want to wrap at all. You don't really have to be polite and say please to the user when you can say it in one line. :)

Mockup:

image

@ferventcoder
Copy link
Contributor

Right. :)
Color is used on debug, error and warnings but haven't added colorization
and bolding in the same info quite yet, but I have an idea how I can do it
elegantly. Not yet sure if I can bold parts of a line and leave other parts
normal.

On Friday, April 18, 2014, Sander notifications@github.com wrote:

Textually this is pretty awesome! [image: 👍]

However, the color doesn't really add anything. And the text can be more
80-friendly. So please allow me to comment on that:

  1. Using all the same color has no visual benefit. Alternate between
    key information and verbose information (and successful information and
    error information) with color and weight.
  2. Take care of the default console width, you don't want a sentence
    wrap it's last two characters to the next line.
    • Preferably, you don't want to wrap at all. You don't really have
      to be polite and say please to the user when you can say it in one line. :)

Mockup:

[image: image]https://cloud.githubusercontent.com/assets/1702193/2741881/b860a346-c6f6-11e3-93e9-f80cc86c0488.png


Reply to this email directly or view it on GitHubhttps://github.com//pull/376#issuecomment-40806257
.

Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

@Redsandro
Copy link
Contributor Author

Ah I already made a two-package mockup, shame to throw it away. So I'll paste it anyway.

But sounds cool. I'm not sure about anything PowerShell either, but it is supported in Unix escape codes and I used to do that for curses text output in python scripts for Linux. They could be run on Windows too, and it just displayed the bold text in the console. I have no idea if curses does that or if the console just supports that natively.


image

@ferventcoder
Copy link
Contributor

Who said anything about powershell? You mught look at the image I pasted a
leeetle more closely... ;)

On Friday, April 18, 2014, Sander notifications@github.com wrote:

Ah I already made a two-package mockup, shame to throw it away. So I'll
paste it anyway.

But sounds cool. I'm not sure about anything PowerShell either, but it is
supported in Unix escape codes and I used to do that for curses text
output in python scripts for Linux. They could be run on Windows too, and

it just displayed the bold text in the console. I have no idea if cursesdoes that or if the console just supports that natively.

[image: image]https://cloud.githubusercontent.com/assets/1702193/2741972/b80c492e-c6f9-11e3-8f00-92fc3e1e0326.png


Reply to this email directly or view it on GitHubhttps://github.com//pull/376#issuecomment-40806963
.

Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

@Redsandro
Copy link
Contributor Author

It's a frickin binary!
Are you doing a complete rewrite or something?

@ferventcoder
Copy link
Contributor

Well I've only been talking about it since late 2011, ask @jeremydmiller.

@ferventcoder
Copy link
Contributor

A little better:
image

@Redsandro
Copy link
Contributor Author

I believe you. :) This is better!

Any rough* idea when we're all going to use this?


*) a month, season, year, lustrum?

@ferventcoder
Copy link
Contributor

Roughly less than a month.

@ferventcoder
Copy link
Contributor

I added some messages to the end so you can see all the different logging:
image

Also with debugging:
image

@Redsandro
Copy link
Contributor Author

Very nice!
This is convenient for both audiences, neat and simple, or optional verbosity!

👍

@ferventcoder
Copy link
Contributor

And I forgot verbose, so here you go:

image

By the way, this is what that last set of code looks like (super clean, IMO):

this.Log().Debug("This is a normal debug message.");
this.Log().Debug(ChocolateyLoggers.Important, "This is an important debug message.");
this.Log().Info("This is a normal message.");
this.Log().Info(ChocolateyLoggers.Important, "This is an important message.");
this.Log().Warn("This is a normal warning.");
this.Log().Warn(ChocolateyLoggers.Important, "This is an important warning.");
this.Log().Error("This is a normal error.");
this.Log().Error(ChocolateyLoggers.Important, "This is an important error.");
this.Log().Fatal("This is a normal catastrophic error.");
this.Log().Fatal(ChocolateyLoggers.Important, "This is an important catastrophic error.");
this.Log().Info(ChocolateyLoggers.Verbose, "This is a verbose logging statement.");

@ferventcoder
Copy link
Contributor

I added the code because I'm removing those lines now... ;)

@ferventcoder
Copy link
Contributor

Help system updates:

image

@ferventcoder
Copy link
Contributor

Of course I can update that a bit now that I have the better logging constructs in.

@jberezanski
Copy link
Contributor

The new output formatting looks really nice, much more readable than current Chocolatey output. But the fact that it comes from the new binary implementation is even better news :)

Do you plan on providing only an exe, or perhaps a PowerShell module as well? Personally, I find it very convenient to be able to invoke chocolatey.ps1 directly from a PS script without paying the overhead of spawning a new process. PS cmdlets could also return objects as their output, making processing that output in scripts much easier and more reliable.

@ferventcoder
Copy link
Contributor

Module as well... First step is this

On Friday, April 18, 2014, Jakub Berezanski notifications@github.com
wrote:

The new output formatting looks really nice, much more readable than
current Chocolatey output. But the fact that it comes from the new binary
implementation is even better news :)

Do you plan on providing only an exe, or perhaps a PowerShell module as
well? Personally, I find it very convenient to be able to invoke
chocolatey.ps1 directly from a PS script without paying the overhead of
spawning a new process. PS cmdlets could also return objects as their
output, making processing that output in scripts much easier and more
reliable.


Reply to this email directly or view it on GitHubhttps://github.com//pull/376#issuecomment-40826809
.

Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

@bill-long
Copy link
Contributor

Love this output. +1 for a Powershell module.

@Redsandro
Copy link
Contributor Author

Really cool. What language is that?
(those lines you removed) :)

@ferventcoder
Copy link
Contributor

C#. Did I mention I'm also testing this on OSX?

On Friday, April 18, 2014, Sander notifications@github.com wrote:

Really cool. What language is that?
(those lines you removed) :)


Reply to this email directly or view it on GitHubhttps://github.com//pull/376#issuecomment-40830631
.

Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

@Redsandro
Copy link
Contributor Author

That's probably cool but not something that will get me excited.
Now we're going to get all these hipster packages polluting the feed.
Besides, OSX is totally different in every way, how would that work?

@ferventcoder
Copy link
Contributor

It's more for system admins who want to build and push pkgs and not have to
fire up a windows box. Push to their private pkg repos that is

On Friday, April 18, 2014, Sander notifications@github.com wrote:

That's probably cool but not something that will get me excited.
Now we're going to get all these hipster packages polluting the feed.
Besides, OSX is totally different in every way, how would that work?


Reply to this email directly or view it on GitHubhttps://github.com//pull/376#issuecomment-40851808
.

Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

@Redsandro
Copy link
Contributor Author

Oh I would love that for Linux!

I find myself every now and then making a (requested) update, only having to wait a week before I have access to a Windows machine for cpack and cpush.

@ferventcoder
Copy link
Contributor

Well how about this summer sometime? .......Things always take longer than you hope.

@ferventcoder ferventcoder merged commit 0addb6b into chocolatey-archive:master Jun 17, 2014
@Redsandro
Copy link
Contributor Author

The current output and new colors are looking nice! 👍

The limegreen package titles are very distinctive, the output is friendly to look at.

If stuff goes wrong, the -debug optionally makes output very verbose.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants