Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

[CI] Improve GitHub Actions Log info #246

Merged
merged 15 commits into from
Jul 20, 2023
Merged

Conversation

zrr1999
Copy link
Member

@zrr1999 zrr1999 commented Jul 5, 2023

fixes #243

@paddle-bot
Copy link

paddle-bot bot commented Jul 5, 2023

Thanks for your contribution!

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Jul 5, 2023
@SigureMo SigureMo changed the title Improve GitHub Actions Log info [CI] Improve GitHub Actions Log info Jul 6, 2023
@SigureMo SigureMo added the HappyOpenSource 快乐开源活动issue与PR label Jul 6, 2023
@zrr1999 zrr1999 requested a review from SigureMo July 8, 2023 06:53
@zrr1999
Copy link
Member Author

zrr1999 commented Jul 8, 2023

@SigureMo 我尝试了一些方法获取到报错的关键信息,但是发现好像都不是很通用,现在这样是把所有错误信息的换行符替换成了\n显示在一行里。我想问下有没有什么好办法可以直接获取到单独的报错信息,因为err.args[0]已经被替换成了特殊的报错格式,很难在单独一行里面显示出来。

@SigureMo SigureMo added 🐾 meow 快乐喵喵开源活动专属认证 and removed 🐾 meow 快乐喵喵开源活动专属认证 labels Jul 11, 2023
@zrr1999 zrr1999 force-pushed the log branch 2 times, most recently from 1778fbe to 11bba14 Compare July 13, 2023 16:30
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SigureMo 我尝试了一些方法获取到报错的关键信息,但是发现好像都不是很通用,现在这样是把所有错误信息的换行符替换成了\n显示在一行里。我想问下有没有什么好办法可以直接获取到单独的报错信息,因为err.args[0]已经被替换成了特殊的报错格式,很难在单独一行里面显示出来。

这个我没有具体调研也不太清楚呀,不过这个任务比较自由,只要效果有提升就好了~

class IterVariable(VariableBase):
"""
This Variable (include subclasses) should be generated only when simulate GET_ITER opcode
"""

def __init__(
self, obj: VariableBase, graph: FunctionGraph, tracker: Tracker
self, obj: SizedVariable, graph: FunctionGraph, tracker: Tracker
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

唔,这个就先不要改了,这个应该是 Sided 和 VariableBase 的「组合」,我们目前的整个 Variable 关系是有一定的缺陷的1,因为我们使用的是「继承」,这里使用「继承」来完成一件「组合」的事情是不太合适的,这个我们以后可能会设计一下如何重构,但不是一件高优的事情

Footnotes

  1. Python 本身魔法函数的机制就是一种「组合」,比如实现 __len__ 天然就「实现/继承」了 Sized 这个 Protocol,而我们使用的是继承,就是会有一些 diff 的

@zrr1999 zrr1999 requested a review from SigureMo July 19, 2023 16:10
@zrr1999
Copy link
Member Author

zrr1999 commented Jul 19, 2023

@SigureMo 可以看下现在的方案,如果是正常的 self.assertIs 已经可以支持在源码中显示具体的错误信息,但是像这种 1/0 的语法错误,由于还没有更合适的捕捉错误方法,暂时用的是正则匹配,错误信息很难捕捉到,使用了Error代替

@zrr1999 zrr1999 marked this pull request as ready for review July 19, 2023 16:17
SigureMo
SigureMo previously approved these changes Jul 19, 2023
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM~我觉得效果已经挺不错了~

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM~

@SigureMo SigureMo merged commit 6668085 into PaddlePaddle:develop Jul 20, 2023
7 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR status: proposed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

优化 GitHub Actions Log 信息
3 participants