Skip to content

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Mar 5, 2025

When handling errors on runbot, it can be difficult to know where a message comes from. It can be problematic to identify automatically the source of an error.

This branch give the possibility to add metadata to log_db.

The current only metadata is the canonical tag.

Some other information, like the stack, or the subtest could be added in the future. This is not the case for now to make the review easier.

     def get_log_metadata(self):
+        stack = traceback.format_stack()
+        start = next((index for index, frame in enumerate(stack) if self._testMethodName in frame), 0)
         metadata = {
             'canonical_tag': self.canonical_tag,
+            'stack': '\n'.join(traceback.format_stack()[start:-7]),
+            'subtest': str(self._subtest),
         }
         return metadata

Forward-Port-Of: #199964

When handling errors on runbot, it can be difficult to know where a
message commes from. It can be problematic to identify automatically the
source of an error.

This branch give the possibility to add metadata to log_db.

X-original-commit: ad9b54d
@robodoo
Copy link
Contributor

robodoo commented Mar 5, 2025

Pull request status dashboard

@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 5, 2025

This PR targets saas-18.1 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Mar 5, 2025
@C3POdoo C3POdoo added the RD research & development, internal work label Mar 5, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 5, 2025

@Xavier-Do the next pull request (#200476) is in conflict. You can merge the chain up to here by saying

@robodoo r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@Xavier-Do
Copy link
Contributor

@robodoo r+

robodoo pushed a commit that referenced this pull request Mar 6, 2025
When handling errors on runbot, it can be difficult to know where a
message commes from. It can be problematic to identify automatically the
source of an error.

This branch give the possibility to add metadata to log_db.

closes #200458

X-original-commit: ad9b54d
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
@robodoo robodoo closed this Mar 6, 2025
@xmo-odoo xmo-odoo deleted the saas-18.1-18.0-netsvc-log-metadata-xdo-420707-fw branch March 7, 2025 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwardport This PR was created by @fw-bot RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants