diff options
author | Tom Pollard <tom.pollard@codethink.co.uk> | 2019-07-31 16:31:47 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-08-08 13:52:36 +0000 |
commit | 0026e37918998addb61d7cefcbb9b5f7f6f7b4f4 (patch) | |
tree | a756eaf5ba545882f8ec69204759ac22b8112d23 /src/buildstream/_state.py | |
parent | 1701aa1239f472317edfc6f675378dc91b1fcd61 (diff) | |
download | buildstream-0026e37918998addb61d7cefcbb9b5f7f6f7b4f4.tar.gz |
_message.py: Use element_name & element_key instead of unique_idtpollard/messageobject
Adding the element full name and display key into all element related
messages removes the need to look up the plugintable via a plugin
unique_id just to retrieve the same values for logging and widget
frontend display. Relying on plugintable state is also incompatible
if the frontend will be running in a different process, as it will
exist in multiple states.
The element full name is now displayed instead of the unique_id,
such as in the debugging widget. It is also displayed in place of
'name' (i.e including any junction prepend) to be more informative.
Diffstat (limited to 'src/buildstream/_state.py')
-rw-r--r-- | src/buildstream/_state.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/buildstream/_state.py b/src/buildstream/_state.py index 388ed8151..a4f767de8 100644 --- a/src/buildstream/_state.py +++ b/src/buildstream/_state.py @@ -208,8 +208,7 @@ class State(): # full_name (str): The full name of the task, distinguishing # it from other tasks with the same action name # e.g. an element's name. - # unique_id (int): (optionally) the element's unique ID, if the failure - # came from an element + # element_job (bool): (optionally) If an element job failed. # def register_task_failed_callback(self, callback): self._task_failed_cbs.append(callback) @@ -324,11 +323,11 @@ class State(): # full_name (str): The full name of the task, distinguishing # it from other tasks with the same action name # e.g. an element's name. - # unique_id (int): (optionally) the element's unique ID, if the failure came from an element + # element (Element): (optionally) The element instance if an element job # - def fail_task(self, action_name, full_name, unique_id=None): + def fail_task(self, action_name, full_name, element=None): for cb in self._task_failed_cbs: - cb(action_name, full_name, unique_id) + cb(action_name, full_name, element) # _Task |