-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Go] ♻️ Replace quicktype
by go-codegen
#38
Conversation
WalkthroughThe recent changes streamline the GitHub Actions workflows by removing the installation of the Changes
Sequence Diagram(s)sequenceDiagram
participant A as Developer
participant B as GitHub Actions
participant C as Code Generation Tool
A->>B: Push changes
B->>B: Run lint job
B->>B: Run build job
B->>C: Generate code using go-codegen
C-->>B: Code generation successful
B->>B: Create release if tagged
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
quciktype
by go-codegen
quicktype
by go-codegen
quicktype
by go-codegen
quicktype
by go-codegen
1d4165a
to
5a792ee
Compare
b2842ab
to
a1f86c8
Compare
da93745
to
468e1a8
Compare
fd896eb
to
bb6767e
Compare
quicktype
by go-codegen
quicktype
by go-codegen
@coderabbitai
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.
Actionable comments posted: 1
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (6)
- .github/workflows/build.yml (1 hunks)
- .github/workflows/publish.yml (1 hunks)
- .github/workflows/update-schema.yml (1 hunks)
- magefiles/build.go (1 hunks)
- magefiles/magefile.go (1 hunks)
- magefiles/utils.go (1 hunks)
Files skipped from review due to trivial changes (2)
- .github/workflows/build.yml
- .github/workflows/update-schema.yml
Additional comments not posted (6)
magefiles/magefile.go (1)
9-9
: LGTM!The addition of
GO_CODEGEN_VERSION
is correctly defined and follows the existing pattern..github/workflows/publish.yml (1)
75-81
: New release job integration looks good!The
create_release
job is correctly defined with dependencies onlint
andbuild
. Ensure that the conditionstartsWith(github.ref, 'refs/tags/')
is appropriate for your release process.magefiles/build.go (4)
51-54
: Conditional check foraxone-cognitarium
schema looks good!The conditional statement correctly skips the generation process for the
axone-cognitarium
schema, ensuring the function returns early.
65-69
: Go type generation command updated correctly!The command for generating Go types using
go-codegen
is correctly defined and replaces the previousquicktype
command.
74-82
: Go client generation command added correctly!The new section for generating a Go client using
go-codegen
is correctly defined and includes appropriate error handling.
58-58
: EnsureensureGoCodegen
is defined.The call to
ensureGoCodegen()
is correct, but verify that this function is defined and correctly replacesensureQuicktype()
.Verification successful
Verification successful:
ensureGoCodegen
is defined andensureQuicktype
has been removed.
- The function
ensureGoCodegen
is defined inmagefiles/utils.go
.- No definition or usage of
ensureQuicktype
was found in the codebase, indicating it has been replaced.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the definition of `ensureGoCodegen`. # Test: Search for the function definition. Expect: The function is defined. rg --type go 'func ensureGoCodegen'Length of output: 81
Script:
#!/bin/bash # Description: Verify the definition and usage of `ensureQuicktype`. # Test 1: Search for the function definition of `ensureQuicktype`. rg --type go 'func ensureQuicktype' # Test 2: Search for any usage of `ensureQuicktype` in the codebase. rg --type go 'ensureQuicktype'Length of output: 68
quicktype
by go-codegen
@coderabbitaiquicktype
by go-codegen
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.
Excellent thanks!
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.
Great! Thx 😌
This PR introduces the use of the go-codegen library to generate Go types from the Cosmwasm JSON Schema. This change was necessitated due to compatibility issues encountered with quicktype when generating the JSON Schema (refer to issue #9).
In addition to the Go type generation, this PR also includes the generation of a gRPC client in Go.
Due to issues with the generation of the
axone-cognitarium
contract, it has been temporarily disabled. This issue needs to be resolved in thecodegen
library or by finding an alternative solution. The exclusion is implemented silently in the build script, allowing the CI matrix to continue functioning for other languages without errors. This temporary measure enables the use of other contracts as libraries and potentially allows for manual generation of thecognitarium
schema code for Go.🔗 Related fixes
additionalProperties
srdtrk/go-codegen#98: Occurs during the generation ofaxone-cognitarium
axone-cognitarium
.Summary by CodeRabbit
New Features
create_release
in the release workflow for streamlined release processes.go-codegen
dependency, enhancing code generation for Go.Bug Fixes
quicktype
package across workflows, streamlining the build process.Documentation
GO_CODEGEN_VERSION
.