-
Notifications
You must be signed in to change notification settings - Fork 284
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
CP-47354, CP-47355: add mustache template for messages and generate GO methods code #5591
Conversation
duobei
commented
Apr 25, 2024
•
edited
Loading
edited
- Add mustache template for xapi data module class messages
- Generate messages functions Golang code for all classes
fa1bc40
to
b3537fc
Compare
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.
Has the OCaml code gone trough ocamlformat
and the Go code through gofmt
?
Both have gone through. |
I would suggest a basic structure like:
|
This PR is too big. Hopefully it could be split into at least 3 smaller PRs.
|
Sorry, I should make the PR reviewed easily. I'll split it to 3 smaller PRs today. |
51e99f1
to
ae6eedd
Compare
ae6eedd
to
49166a1
Compare
A general comment on the template is if we consider a template as a function, then its input (and its output) should be defined exactly. This would be useful to make sure the template variables are not missing and the unnecessary ones can be cleaned up. |
8b2d678
to
c3f9ff4
Compare
c3f9ff4
to
7470964
Compare
For separate method template, raise a new commit here. https://code.citrite.net/users/fezhan/repos/xen-api/browse/ocaml/sdk-gen/go/templates?at=refs%2Fheads%2Fprivate%2FCP-48667-2-1 |
…lass messages Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
…h_enums` Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Checked the generated Go source files' methods based on new commit, looks good to me. Thanks. |
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Ming had done an in-depth review, so I believe this looks OK from a toolstack perspective, it needs a review from the maintainers of the SDK, interfaces |
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.
Checking the generated Go source files with golangci-lint:
root@3eea0d3e0e5d:/app/go/goSDK# golangci-lint run --config=/app/.golangci.yml
WARN The linter 'execinquery' is deprecated (since v1.58.0) due to: The repository of the linter has been archived by the owner.
WARN The linter 'gomnd' is deprecated (since v1.58.0) due to: The linter has been renamed. Replaced by mnd.
0 issues.
Test with current xenserver-samples test. No special issues.
pytype_reporter extracted 50 problem reports from pytype output. You can check the results of the job here |