-
Notifications
You must be signed in to change notification settings - Fork 4
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
add merged at for git pullrequest struct #565
base: main
Are you sure you want to change the base?
Conversation
46a735e
to
9df87c3
Compare
@@ -155,4 +155,7 @@ type BuildGitPullRequestStatus struct { | |||
HasConflicts bool `json:"hasConflicts" variable:"example=false"` | |||
// MergedBy indicates pr was merged by user use email | |||
MergedBy GitUserBaseInfo `json:"mergedBy,omitempty" variable:"[email protected]"` | |||
// +optional | |||
// MergedAt indicates when the pr was merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional挪到第二行?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加了这个字短那些生产变量函数也需要改?
4559721
to
3af42ad
Compare
3af42ad
to
d02551b
Compare
@@ -154,5 +154,7 @@ type BuildGitPullRequestStatus struct { | |||
// +optional | |||
HasConflicts bool `json:"hasConflicts" variable:"example=false"` | |||
// MergedBy indicates pr was merged by user use email | |||
MergedBy GitUserBaseInfo `json:"mergedBy,omitempty" variable:"[email protected]"` | |||
MergedBy GitUserBaseInfoWithoutVariable `json:"mergedBy,omitempty" variable:"-"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge 相关的数据 mergedBy mergedAt 目前不适合作为参数存在
PR 触发的时候,不会有 PR merge 的信息
PR 合并的时候 此时也不会触发 PR 的构建
因此产品中即使提供了这几个参数,也永远用不到
目前 merge 的信息只有在 lastCommit 相关的 PR 中会用到,但是他们不会被转成变量
所以这里把 merge 相关的两个参数 mergedBy mergedAt 的 variable 都去掉了
另外之前添加的 mergedBy 参数,没有增加对应的变量函数,算是一个 bug,这里也正好处理掉了
} | ||
|
||
// GitUserBaseInfoWithoutVariable user base info without variable | ||
type GitUserBaseInfoWithoutVariable struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
目前只有当 variable 为 “-” 时不会作为变量展示,所以新增了一个结构体 GitUserBaseInfoWithoutVariable,和 GitUserBaseInfo 结构一样,只不过 variable 都为 "-"
我还考虑过修改参数的处理逻辑,当 root 节点 variable 为 ”-“ 时,不处理 root 节点下子节点的参数,但是看起来不太通用,覆盖的场景更少,因此选择当前的办法
Changes
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
spec
PR link includedfunctionality, content, code)
Release Notes