Skip to content

Result model: Enhance storing keyword name #4884

Closed

Description

@pekkaklarck

Currently the Keyword object in the result model has these attributes for specifying its name:

  • kwname that contains the actual keyword name like Log. This attribute doesn't follow Python naming conventions. In output.xml the attribute is saved as name.
  • libname that contains the library or resource file name like BuiltIn. Doesn't follow naming conventions either and because it can contain also a resource file name the attribute is badly named in general. In output.xml the attribute is saved as library.
  • name that contains the full name like BuitlIn.Log. This attribute is a read-only property that gets its value from the aforementioned attributes. This is inconsistent with the execution side Keyword object that has name as a normal settable attribute. This information isn't stored to output.xml because it can be constructed based on the above two attributes.
  • sourcename that contains the original source name when using embedded arguments (Improve embedded keyword logging in output.xml #3750). Doesn't fully follow naming conventions.

As explained above, all these attributes have some issues. We are currently cleaning up the result model and the above issues need to be resolved as part of that. One motivation for this cleanup is making sure that the model doesn't contain anything stupid before we add JSON support to it (#4847). Another reason is to make it more consistent with output.xml. After thinking about alternatives, we have decided to do the following:

  • Old kwname is renamed to name This is consistent with the execution side Keyword and also matches the attribute name in output.xml.
  • Old libname is renamed to owner. It will be stored as owner also in output.xml.
  • New full_name is introduced to replace the old name.
  • sourcename is renamed to source_name in the model and in output.xml.
  • kwname, libname and sourcename will be preserved as propertys. They are considered deprecated, but accessing them won't cause a deprecation warning yet in this release.

Activity

  1. added this to the v7.0 milestone on Oct 5, 2023
  2. pekkaklarck commented on Oct 5, 2023

    @pekkaklarck
    MemberAuthor

    Backwards incompatible changes caused by this issue:

    • Keyword.name returns only the keyword name like Log, not the full name like BuiltIn.Log.
    • library attribute in output.xml is changed to owner.
    • sourcename attribute in output.xml is changed to source_name.

    Additionally kwname, libname and sourcename attributes are deprecated, but accessing them doesn't cause deprecation warnings yet.

  3. self-assigned this
    on Oct 5, 2023
  4. pekkaklarck commented on Oct 5, 2023

    @pekkaklarck
    MemberAuthor

    The mess with keyword names is even worse than explained in the original description. The executable keywords, called "handlers" internally, have longname that contains the full name i.e. owner.name. Now that we use full_name with result model keywords, it is a good idea to rename longname to full_name. These handlers aren't par of any public API so this change shouldn't cause additional backwards compatibility concerns.

    These handlers as well as KeywordDoc objects used by Libdoc also have shortdoc. For overall API consistency I'll rename that to short_doc as well. I don't think it's a good idea to change Libdoc spec files, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions