GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [MPIR-478] Allow to save avatars images for team report during project build by slawekjaranowski · Pull Request #97 · apache/maven-project-info-reports-plugin Conversation
slawekjaranowski
requested review from
Bukama,
elharo,
hboutemy and
michael-o
elharo
requested changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should just throw IOException
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is used in
so when exception should be catch and what we can do with it ...?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't handle the exception, just pretends it's not going to happen. Checked or unchecked it needs to be handled. I don't think it can be handled here, so throw the IOException and handle a failure where it's called from.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, what should happen on such exception, how do you want to handle it in report? Now it be handled by Maven itself and build will be break.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If breaking the build is the right answer — though I'm not sure it is — then that should happen higher up, likely with a MavenReportException or something like that. It shouldn't be a runtime exception from deep inside the code, whihc would indicate a bug in the code. An avatar service being unreachable is not a bug in the code, so just use a regular IOException here.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. from team report perspective fetching images can be interpreted as one of report feature - so it can be important
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That doesn't sound right. This is a private method so something in this class should be calling it.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is use, line 279:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so handle the IOException there, not here. Also, if renderBody cannot throw any exception, then don't throw an exception in renderBody. Make sure that whatever code you call inside renderBody does not throw any exception, runtime exceptions included. Instead call all the code that might throw exceptions before you ever call renderBody, load up all the URLs or pics or whatever in memory at the beginning of executeReport, and only start rendering once all the resources are loaded and will not throw any exceptions during rendering. Though in this case I really think it's simpler and easier to just use the default spacer image.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. URL.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've rewritten a little here ...
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
slawekjaranowski
force-pushed
the
MPIR-478
branch
2 times, most recently
from
498a69e to
925a45f
Compare
elharo
requested changes
Uh oh!
There was an error while loading. Please reload this page.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't handle the exception, just pretends it's not going to happen. Checked or unchecked it needs to be handled. I don't think it can be handled here, so throw the IOException and handle a failure where it's called from.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you want to do here when getExternalAvatarUrl( fails and throws an exception? Probably just don't call sink.figureGraphics below.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want break a build, because images in report can be missing.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if a user doesn't have an avatar? I don't think I do, for instance.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when user doesn't have an avatar default one will be returned by gravatar
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like you can handle the IOException in this method. It doesn't need tonescape this class. Just wrap lines 277 through 285 in a try-catch block. The catch block can be empty or it can fill in a default image.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know that I can catch and skip exception, and use default images - but I don't want. As you know one step of release new component is publishing new documentation ... I don't want to add next manual task to verify team page during release. Maybe you have another experience with releasing new components ... Some context of change - look at our team pages: https://maven.apache.org/team.html the same are on many other ASF projects.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
elharo
requested changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to instead simply not show avatars in the report?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. user want to show avatars, and probably misconfigured plugin - so we should not hide such case
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest message then, and not breaking the report. You could also add a default image used when the server can't be reached.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is two different case wrong configuration - not existing provider and not available image server. In both case we should break a build to prevent of unwanted result
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page.
slawekjaranowski
force-pushed
the
MPIR-478
branch
from
925a45f to
766300c
Compare
elharo
requested changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest message then, and not breaking the report. You could also add a default image used when the server can't be reached.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if a user doesn't have an avatar? I don't think I do, for instance.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If breaking the build is the right answer — though I'm not sure it is — then that should happen higher up, likely with a MavenReportException or something like that. It shouldn't be a runtime exception from deep inside the code, whihc would indicate a bug in the code. An avatar service being unreachable is not a bug in the code, so just use a regular IOException here.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
elharo
requested changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not fetching an artifact is far more serious than not fetching a user pic. It's reasonable that one breaks the build and the other doesn't. If you can't throw MavenReportException from renderBody then pass the IOException up the stack to something that can. Or change the method signature so it can throw, though here I really think the exception can simply be handled by dropping the image. Perhaps this exception can be handled by using the default image.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
elharo
requested changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That doesn't sound right. This is a private method so something in this class should be calling it.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
elharo
requested changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like you can handle the IOException in this method. It doesn't need tonescape this class. Just wrap lines 277 through 285 in a try-catch block. The catch block can be empty or it can fill in a default image.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
elharo
requested changes
Uh oh!
There was an error while loading. Please reload this page.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can probably make this non-private and use this in cases where the provider fails.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so handle the IOException there, not here. Also, if renderBody cannot throw any exception, then don't throw an exception in renderBody. Make sure that whatever code you call inside renderBody does not throw any exception, runtime exceptions included. Instead call all the code that might throw exceptions before you ever call renderBody, load up all the URLs or pics or whatever in memory at the beginning of executeReport, and only start rendering once all the resources are loaded and will not throw any exceptions during rendering. Though in this case I really think it's simpler and easier to just use the default spacer image.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
slawekjaranowski
force-pushed
the
MPIR-478
branch
2 times, most recently
from
bdf357c to
db8f78f
Compare
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
elharo
approved these changes
slawekjaranowski
force-pushed
the
MPIR-478
branch
from
db8f78f to
7cc46ad
Compare
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Bukama
approved these changes
Uh oh!
There was an error while loading. Please reload this page.
slachiewicz
approved these changes
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
|
Resolve #327 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.