Skip to content

show current action while publishing artifact to repository#29

Open
vitaliis wants to merge 1 commit into
sbt:2.3.x-sbtfrom
vitaliis:patch-1
Open

show current action while publishing artifact to repository#29
vitaliis wants to merge 1 commit into
sbt:2.3.x-sbtfrom
vitaliis:patch-1

Conversation

@vitaliis

@vitaliis vitaliis commented Apr 8, 2018

Copy link
Copy Markdown

The problem is that "published ..." message is there only when upload is done.
Uploading big artifact to repository can take significant amount of time. It can take minutes.
Or even dozens of minutes for big uploads over slow Internet uplink.

It is not obvious what happens when upload is started. The console just hangs.
More user friendly would be to show for a user what is about to happen. In this case upload of an artifact will take place.

The problem is that "published ..." message is there only when upload is done.
Uploading big artifact to repository can take significant amount of time. It can take minutes.
Or even dozens of minutes for big uploads over slow Internet uplink.

It is not obvious what happens when upload is started. The console just hangs.
More user friendly would be to show for a user what is about to happen. In this case upload of an artifact will take place.
@lightbend-cla-validator

Copy link
Copy Markdown

Hi @vitaliis,

Thank you for your contribution! We really value the time you've taken to put this together.

Before we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement:

http://www.lightbend.com/contribute/cla

@dwijnand

dwijnand commented Apr 9, 2018

Copy link
Copy Markdown
Member

I understand (and sympathise) with what you're saying, but I'd like to also point out that the downside of this is that now everything is logged twice.

maybe a good compromise is to log the start at debug level and the completion at info level? what do you think?

@vitaliis

vitaliis commented Apr 9, 2018

Copy link
Copy Markdown
Author

@dwijnand thanks for your reply.
Hm, but then it will not solve the issue I face because sbt doesn't show the debug output by default. Or I can somewhere specify settings for sbt logger for a particular class (e.g. <logger name="org.apache.ivy.plugins.resolver.RepositoryResolver" level="DEBUG" />)? Which also seems like a workaround.

@vitaliis

vitaliis commented Apr 9, 2018

Copy link
Copy Markdown
Author

I was thinking of a better and nicer solution.
First you do the print (without line break): Message.info("\tpublishing " + artifact.getName() + " to " + hidePassword(repository.standardize(dest)) + "... ");
And then on the same line add println with the word "done".

But I think it is impossible to implement.

@dwijnand

dwijnand commented Apr 9, 2018

Copy link
Copy Markdown
Member

yeah, we would need to make sure that for people in situations like yourself had an easy way to bump the logging to debug level. I'm not that familiar with sbt's interaction with ivy's logging to know. (@eed3si9n?)

if you can find a way to do the non-line break logging, I think that could go with that.

@vitaliis

vitaliis commented Apr 9, 2018

Copy link
Copy Markdown
Author

One more reason to add the logging before publishing is the fact that in packaging it is done in the way that is proposed for publishing.

Here is an excerpt of my console output:

[info] Packaging /path/to/artifact.jar ...
[info] Done packaging.
[info] Packaging /path/to/artifact-sans-externalized.jar ...
[info] Done packaging.
... and here it hangs for 5 minutes ...
[info] 	published projectName to https://nexus.example.com/repository/snapshots/...-SNAPSHOT.zip
...
[success] Total time: 295 s, completed Apr 9, 2018 9:00:10 PM

And this is not the biggest sbt sub-project we publish.

@eed3si9n

Copy link
Copy Markdown
Member

There's ivyLoggingLevel key which is set to UpdateLogging.Default.

https://github.com/sbt/librarymanagement/blob/1.x/ivy/src/main/scala/sbt/internal/librarymanagement/IvyActions.scala#L476-L484

There's a similar issue sbt/sbt#3122 that's actually trying to hide "Updating.." maybe the common thread here is that we need a timeout log for a long running tasks. So if the operation finishes within 30s it doesn't print anything, but if it takes longer it prints out a message or a progress bar?

@eed3si9n eed3si9n added uncategorized Used for Waffle integration and removed review labels Nov 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

uncategorized Used for Waffle integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants