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

Restore task element name / element name distinction in UI #1428

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Commits on Oct 1, 2020

  1. Adding _DisplayKey type

    Instead of passing around untyped tuples for cache keys, lets have
    a clearly typed object for this.
    
    This makes for more readable code, and additionally corrects the
    data model statement of intent that some cache keys should be displayed
    as "dim", instead informing the frontend about whether the cache key
    is "strict" or not, allowing the frontend to decide how to display
    a strict or non-strict key.
    
    This patch does the following:
    
      * types.py: Add _DisplayKey
    
      * element.py: Return a _DisplayKey from Element._get_display_key()
    
      * Other sources: Updated to use the display key object
    Tristan van Berkom committed Oct 1, 2020
    Configuration menu
    Copy the full SHA
    2c5fbf8 View commit details
    Browse the repository at this point in the history
  2. _elementsources.py: Fix copy/paste error in API doc comment

    Tristan van Berkom committed Oct 1, 2020
    Configuration menu
    Copy the full SHA
    955e050 View commit details
    Browse the repository at this point in the history
  3. _artifactcache.py: Use Element._get_display_key()

    Instead of using Element._get_brief_display_key(), no need for that
    second accessor.
    Tristan van Berkom committed Oct 1, 2020
    Configuration menu
    Copy the full SHA
    0236a28 View commit details
    Browse the repository at this point in the history
  4. element.py: Remove Element._get_brief_display_key()

    Now that we have _DisplayKey(), no need for this extra accessor, it's
    not helping anything to have it anymore.
    Tristan van Berkom committed Oct 1, 2020
    Configuration menu
    Copy the full SHA
    bf3a2b7 View commit details
    Browse the repository at this point in the history
  5. _messenger.py: Use kwargs in timed_activity() and simple_task()

    This allows more flexible usage of the APIs, to allow passing all of the
    Message() constructor arguments through kwargs.
    Tristan van Berkom committed Oct 1, 2020
    Configuration menu
    Copy the full SHA
    e09b7c0 View commit details
    Browse the repository at this point in the history
  6. Restore task element name / element name distinction in UI

    This behavior has regressed a while back when introducing the messenger
    object in 0026e37 from merge request !1500.
    
    Main behavior change:
    
      - Messages in the master log always appear with the task element's
        element name and cache key, even if the element or plugin issuing
        the log line is not the primary task element.
    
      - Messages logged in the task specific log, retain the context of the
        element names and cache keys which are issuing the log lines.
    
    Changes include:
    
      * _message.py: Added the task element name & key members
    
      * _messenger.py: Log the element key as well if it is provided
    
      * _widget.py: Prefer the task name & key when logging, we fallback
        to the element name & key in case messages are being logged outside
        of any ongoing task (main process/context)
    
      * job.py: Unconditionally stamp messages with the task name & key
    
        Also removed some unused parameters here, clearing up an XXX comment
    
      * plugin.py: Add new _get_message_kwargs() method to collect the kwargs
                   appropriate to construct Messages() issued by the plugin.
    
        Use this method to construct messages in Plugin.__message() and to
        pass kwargs along to Messenger.timed_activity().
    
      * element.py: Override _get_message_kwargs() so as to provide the
                    cache key in messages issued by this element.
    
      * tests/frontend/logging.py: Fix test to expect the cache key in the logline
    
      * tests/frontend/artifact_log.py: Fix test to expect the cache key in the logline
    
    Fixes #1393
    Tristan van Berkom committed Oct 1, 2020
    Configuration menu
    Copy the full SHA
    4d6a9f7 View commit details
    Browse the repository at this point in the history