Improve the SubmitRecord structure#168
Conversation
|
Just add the SubmitRecords field in ChangeInfo, I hope to join as soon as possible |
andygrunwald
left a comment
There was a problem hiding this comment.
Thanks for the PR.
I left a few comments on how to adjust the pull request more towards the original Gerrit documentation.
changes.go
Outdated
| } | ||
|
|
||
| // SubmitRecord entity describes results from a submit_rule. | ||
| type SubmitRecord struct { |
There was a problem hiding this comment.
According to the docs, SubmitRecordInfo (https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#submit-record-info) and SubmitRecord (https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#submit-record) are different types. I would prefer if we create two different types as well.
There was a problem hiding this comment.
In a new commit I have modified
changes.go
Outdated
|
|
||
| // SubmitRecord entity describes results from a submit_rule. | ||
| type SubmitRecord struct { | ||
| RuleName string `json:"rule_name"` |
There was a problem hiding this comment.
Please extend the ,omitempty tags
There was a problem hiding this comment.
In a new commit I have modified
changes.go
Outdated
| type Account struct { | ||
| AccountId int `json:"_account_id"` | ||
| Name string `json:"name"` | ||
| Email string `json:"email"` | ||
| Username string `json:"username"` | ||
| Tags []string `json:"tags,omitempty"` | ||
| } |
There was a problem hiding this comment.
This is not needed, as we need an AccountInfo type
There was a problem hiding this comment.
In a new commit I have modified
…dvalue in approvals
|
please review the code |
@Ai-feier Changing the type here would be a breaking change. I do agree, it is not a great Dev Experience on this one, however, it would be a breaking change. On top of this, i suggest we split the use cases and topics here. I suggest:
This way, we can
What do you think? |
|
You also use int for value and oldValue. Many times odlValue will not be able to obtain the value because it contains special characters such as: ", /. It is true that this modification is destructive, but it is necessary for the subsequent complex development of gerrit. Yes, I have used the latest version in our company. |



The SubmitRecords field was added to ChangeInfo. The following is an example I obtained through rest request, gerrit:3.10:




my request: