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

Publisher: Enhance KnownPublishError visualisation #373

Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client/ayon_core/hosts/houdini/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ def self_publish():

Firstly, it gets the node and its dependencies.
Then, it deactivates all other ROPs
And finaly, it triggers the publishing action.
And finally, it triggers the publishing action.
"""

result, comment = hou.ui.readInput(
Expand Down Expand Up @@ -1076,4 +1076,4 @@ def prompt_reset_context():
if options["instances"]:
update_content_on_context_change()

dialog.deleteLater()
dialog.deleteLater()
4 changes: 3 additions & 1 deletion client/ayon_core/pipeline/publish/publish_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ class KnownPublishError(Exception):
Message will be shown in UI for artist.
"""

pass
def __init__(self, message, label=None):
self.message = message
self.label = label


class AYONPyblishPluginMixin:
Expand Down
36 changes: 33 additions & 3 deletions client/ayon_core/tools/publisher/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ class PublishPluginActionItem:
action_id (str): Action id.
plugin_id (str): Plugin id.
active (bool): Action is active.
on_filter (str): Actions have 'on' attribte which define when can be
on_filter (str): Actions have 'on' attribute which define when can be
action triggered (e.g. 'all', 'failed', ...).
label (str): Action's label.
icon (Union[str, None]) Action's icon.
Expand Down Expand Up @@ -1063,7 +1063,7 @@ def create(
):
"""Trigger creation by creator identifier.

Should also trigger refresh of instanes.
Should also trigger refresh of instances.

Args:
creator_identifier (str): Identifier of Creator plugin.
Expand Down Expand Up @@ -1194,6 +1194,18 @@ def publish_error_msg(self):

pass

@property
@abstractmethod
def publish_error_label(self):
"""Current error label which cause fail of publishing.

Returns:
Union[str, None]: Error Label which will be showed to artist or
MustafaJafar marked this conversation as resolved.
Show resolved Hide resolved
None.
"""

pass

@abstractmethod
def get_publish_report(self):
pass
Expand Down Expand Up @@ -1317,6 +1329,7 @@ def __init__(self):

# Any other exception that happened during publishing
self._publish_error_msg = None
self._publish_error_label = None
# Publishing is in progress
self._publish_is_running = False
# Publishing is over validation order
Expand Down Expand Up @@ -1369,6 +1382,7 @@ def event_system(self):
"publish.is_running.changed" - Attr 'publish_is_running' changed.
"publish.has_crashed.changed" - Attr 'publish_has_crashed' changed.
"publish.publish_error.changed" - Attr 'publish_error'
publish.publish_error_label.changed - Attr 'publish_error_label'
MustafaJafar marked this conversation as resolved.
Show resolved Hide resolved
"publish.has_validation_errors.changed" - Attr
'has_validation_errors' changed.
"publish.max_progress.changed" - Attr 'publish_max_progress'
Expand Down Expand Up @@ -1485,6 +1499,14 @@ def _set_publish_error_msg(self, value):
self._publish_error_msg = value
self._emit_event("publish.publish_error.changed", {"value": value})

def _get_publish_error_label(self):
return self._publish_error_label

def _set_publish_error_label(self, value):
if self._publish_error_label != value:
self._publish_error_label = value
self._emit_event("publish.publish_error_label.changed", {"value": value})

host_is_valid = property(
_get_host_is_valid, _set_host_is_valid
)
Expand Down Expand Up @@ -1515,6 +1537,9 @@ def _set_publish_error_msg(self, value):
publish_error_msg = property(
_get_publish_error_msg, _set_publish_error_msg
)
publish_error_label = property(
_get_publish_error_label, _set_publish_error_label
)

def _reset_attributes(self):
"""Reset most of attributes that can be reset."""
Expand All @@ -1527,6 +1552,7 @@ def _reset_attributes(self):
self.publish_has_finished = False

self.publish_error_msg = None
self.publish_error_label = None
self.publish_progress = 0

@property
Expand Down Expand Up @@ -2496,14 +2522,18 @@ def _process_and_continue(self, plugin, instance):
self._add_validation_error(result)

else:
label = "Error happened"
if isinstance(exception, KnownPublishError):
msg = str(exception)
msg = exception.message
if exception.label:
label = exception.label
else:
msg = (
"Something went wrong. Send report"
" to your supervisor or Ynput team."
)
self.publish_error_msg = msg
self.publish_error_label = label
self.publish_has_crashed = True

result["is_validation_error"] = has_validation_error
Expand Down
2 changes: 1 addition & 1 deletion client/ayon_core/tools/publisher/widgets/publish_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def _set_stopped(self):
def _set_error_msg(self):
"""Show error message to artist on publish crash."""

self._set_main_label("Error happened")
self._set_main_label(self._controller.publish_error_label)

self._message_label_top.setText(self._controller.publish_error_msg)

Expand Down
9 changes: 5 additions & 4 deletions client/ayon_core/tools/publisher/widgets/report_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class ValidationErrorTitleWidget(QtWidgets.QWidget):
changing style on selection/deselection.

Has toggle button to show/hide instances on which validation error happened
if there is a list (Valdation error may happen on context).
if there is a list (Validation error may happen on context).
"""

selected = QtCore.Signal(str)
Expand Down Expand Up @@ -870,7 +870,7 @@ def _mouse_release_callback(self):


class PublishInstancesViewWidget(QtWidgets.QWidget):
# Sane minimum width of instance cards - size calulated using font metrics
# Sane minimum width of instance cards - size calculated using font metrics
_min_width_measure_string = 24 * "O"
selection_changed = QtCore.Signal()

Expand Down Expand Up @@ -1459,13 +1459,14 @@ class CrashWidget(QtWidgets.QWidget):
def __init__(self, controller, parent):
super(CrashWidget, self).__init__(parent)

main_label = QtWidgets.QLabel("This is not your fault", self)
main_label = QtWidgets.QLabel("Error Occurred!", self)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if Error Occurred! is too unfriendly/scary? I recall that being a huge design decision as to why once it was chosen to report with This is not your fault. So may be one for @mkolar to comment on?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tbh, I don't know what should be the message.
I only changed it to open a discussion about it.

main_label.setAlignment(QtCore.Qt.AlignCenter)
main_label.setObjectName("PublishCrashMainLabel")

report_label = QtWidgets.QLabel(
(
"Please report the error to your pipeline support"
"Expand the orange error message below to find more info.\n"
"You can report the error to your pipeline support"
MustafaJafar marked this conversation as resolved.
Show resolved Hide resolved
" using one of the options below."
),
self
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ line-ending = "auto"

[tool.codespell]
# Ignore words that are not in the dictionary.
ignore-words-list = "ayon,ynput"
ignore-words-list = "ayon,ynput,hda,parms,parm,convertors,convertor"
skip = "./.*,./package/*,*/vendor/*,*/unreal/integration/*,*/aftereffects/api/extension/js/libs/*"
count = true
quiet-level = 3
Expand Down
Loading