Repository navigation
Closed
Description
Currently the Keyword object in the result model has these attributes for specifying its name:
kwnamethat contains the actual keyword name likeLog. This attribute doesn't follow Python naming conventions. In output.xml the attribute is saved asname.libnamethat contains the library or resource file name likeBuiltIn. 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 aslibrary.namethat contains the full name likeBuitlIn.Log. This attribute is a read-only property that gets its value from the aforementioned attributes. This is inconsistent with the execution sideKeywordobject that hasnameas a normal settable attribute. This information isn't stored to output.xml because it can be constructed based on the above two attributes.sourcenamethat 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
kwnameis renamed tonameThis is consistent with the execution sideKeywordand also matches the attribute name in output.xml. - Old
libnameis renamed toowner. It will be stored asowneralso in output.xml. - New
full_nameis introduced to replace the oldname. sourcenameis renamed tosource_namein the model and in output.xml.kwname,libnameandsourcenamewill be preserved as propertys. They are considered deprecated, but accessing them won't cause a deprecation warning yet in this release.
Activity
pekkaklarck commentedon Oct 5, 2023
Backwards incompatible changes caused by this issue:
Keyword.namereturns only the keyword name likeLog, not the full name likeBuiltIn.Log.libraryattribute in output.xml is changed toowner.sourcenameattribute in output.xml is changed tosource_name.Additionally
kwname,libnameandsourcenameattributes are deprecated, but accessing them doesn't cause deprecation warnings yet.pekkaklarck commentedon Oct 5, 2023
The mess with keyword names is even worse than explained in the original description. The executable keywords, called "handlers" internally, have
longnamethat contains the full name i.e.owner.name. Now that we usefull_namewith result model keywords, it is a good idea to renamelongnametofull_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
KeywordDocobjects used by Libdoc also haveshortdoc. For overall API consistency I'll rename that toshort_docas well. I don't think it's a good idea to change Libdoc spec files, though.Handlers: `longname`, 'shortdoc' -> `full_name`, `short_doc`