-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Improve the SubmitRecord structure #168
base: master
Are you sure you want to change the base?
Conversation
Just add the SubmitRecords field in ChangeInfo, I hope to join as soon as possible |
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.
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
Status string `json:"status"` | ||
AppliedBy *Account `json:"applied_by,omitempty"` | ||
} | ||
|
||
// SubmitRecord entity describes results from a submit_rule. | ||
type SubmitRecord 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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please extend the ,omitempty
tags
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed, as we need an AccountInfo
type
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.
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: