-
Couldn't load subscription status.
- Fork 28
feat: Go SDK update for version v0.12.0 #38
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
Conversation
Walkthrough
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
CHANGELOG.md
Outdated
|
|
||
|
|
||
| ## 0.11.0 | ||
| ## 0.12.0 |
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.
are we missing changelog here?
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: 7
🧹 Nitpick comments (1)
account/account.go (1)
2096-2144: Consider having the deprecated method delegate to the new one.The deprecated
CreateVerificationmethod has an identical implementation toCreateEmailVerification. To reduce duplication and ensure consistency, consider having the deprecated method simply call the new one:func (srv *Account) CreateVerification(Url string)(*models.Token, error) { - path := "/account/verifications/email" - params := map[string]interface{}{} - params["url"] = Url - headers := map[string]interface{}{ - "content-type": "application/json", - } - - resp, err := srv.client.Call("POST", path, headers, params) - if err != nil { - return nil, err - } - if strings.HasPrefix(resp.Type, "application/json") { - bytes := []byte(resp.Result.(string)) - - parsed := models.Token{}.New(bytes) - - err = json.Unmarshal(bytes, parsed) - if err != nil { - return nil, err - } - - return parsed, nil - } - var parsed models.Token - parsed, ok := resp.Result.(models.Token) - if !ok { - return nil, errors.New("unexpected response type") - } - return &parsed, nil - + return srv.CreateEmailVerification(Url) }This reduces maintenance burden and ensures the deprecated method automatically benefits from any future bug fixes to the new method. The same refactor applies to
UpdateVerificationas well.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (25)
CHANGELOG.md(2 hunks)account/account.go(5 hunks)client/client.go(1 hunks)docs/examples/account/create-email-verification.md(1 hunks)docs/examples/account/update-email-verification.md(1 hunks)docs/examples/databases/create-line-attribute.md(1 hunks)docs/examples/databases/create-point-attribute.md(1 hunks)docs/examples/databases/create-polygon-attribute.md(1 hunks)docs/examples/databases/update-line-attribute.md(1 hunks)docs/examples/databases/update-point-attribute.md(1 hunks)docs/examples/databases/update-polygon-attribute.md(1 hunks)docs/examples/tablesdb/create-line-column.md(1 hunks)docs/examples/tablesdb/create-point-column.md(1 hunks)docs/examples/tablesdb/create-polygon-column.md(1 hunks)docs/examples/tablesdb/update-line-column.md(1 hunks)docs/examples/tablesdb/update-point-column.md(1 hunks)docs/examples/tablesdb/update-polygon-column.md(1 hunks)functions/functions.go(1 hunks)models/deployment.go(1 hunks)models/execution.go(1 hunks)models/health_antivirus.go(1 hunks)models/health_status.go(1 hunks)query/query.go(1 hunks)sites/sites.go(1 hunks)tablesdb/tables_db.go(5 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
account/account.go (1)
client/client.go (1)
New(74-104)
🪛 markdownlint-cli2 (0.18.1)
CHANGELOG.md
48-48: Multiple headings with the same content
(MD024, no-duplicate-heading)
🔇 Additional comments (17)
functions/functions.go (1)
941-941: LGTM! Documentation URL updated to align with new structure.The change updates the reference URL from the server-specific path to the products path, which aligns with the broader documentation restructuring mentioned in the AI summary.
docs/examples/databases/update-point-attribute.md (1)
22-22: LGTM! Corrected example data for point attribute.The default value now correctly represents a single point (1, 2) rather than the previous nested structure. This aligns with the semantic meaning of a "point" attribute.
models/health_antivirus.go (1)
12-12: LGTM! Grammar correction.Fixed grammatical error in the comment from "Possible values can are" to "Possible values are".
client/client.go (1)
77-81: Version headers updated correctly, but verify target version.The SDK version headers have been updated from 0.11.0 to v0.12.0 (with the "v" prefix added). Both
user-agentandx-sdk-versionare updated consistently.However, the PR title indicates this is for version 0.14.0, while the code changes show v0.12.0. Please verify this is intentional or if the version numbers need adjustment.
tablesdb/tables_db.go (1)
385-385: LGTM! Documentation URL updated consistently.The reference URL has been updated from
/docs/server/tablesdb#createTableto/docs/references/cloud/server-dart/tablesDB#createTableto align with the new documentation structure. This same pattern is applied consistently at lines 2936, 2984, and 3024.models/execution.go (1)
32-35: LGTM! Comment corrected to match field semantics.The comment now correctly describes "HTTP request headers" instead of "HTTP response headers", which aligns with the field name
RequestHeaders.docs/examples/databases/create-polygon-attribute.md (1)
22-22: LGTM! Polygon example now shows valid closed polygon.The default value has been updated to a proper closed polygon with four points:
[[1, 2], [3, 4], [5, 6], [1, 2]]. This is more correct than the previous example, as a polygon requires at least three vertices and should be closed (first point equals last point).docs/examples/databases/update-polygon-attribute.md (1)
22-22: LGTM! Polygon example consistent with create example.The default value has been updated to match the pattern in
create-polygon-attribute.md, using a proper closed polygon with four points. This maintains consistency across the polygon attribute examples.docs/examples/tablesdb/create-polygon-column.md (1)
22-22: LGTM! Polygon example improved with proper closure.The updated example now demonstrates a properly closed polygon with the closing coordinate matching the starting point. This is a best practice for polygon geometry.
docs/examples/tablesdb/create-line-column.md (1)
22-22: LGTM! Line example expanded.The additional coordinate pair makes the example more comprehensive by demonstrating a line with multiple segments.
docs/examples/databases/create-line-attribute.md (1)
22-22: LGTM! Consistent with other line examples.The expansion to three coordinate pairs is consistent with the parallel change in
docs/examples/tablesdb/create-line-column.md.query/query.go (1)
274-278: LGTM! OrderRandom() implementation is correct.The new function follows the established pattern for query functions and correctly omits the attribute parameter, which is appropriate for random ordering.
docs/examples/databases/create-point-attribute.md (1)
22-22: LGTM! Simplified point representation.The change from a nested array to a simple coordinate pair
{1, 2}is more intuitive for representing a point attribute.models/health_status.go (1)
14-14: LGTM! Grammar correction.Fixed the typo from "Possible values can are" to "Possible values are".
sites/sites.go (1)
898-899: LGTM! Documentation URL updated.The comment now references the updated documentation path for site templates.
account/account.go (2)
2048-2094: LGTM! Well-structured new email verification method.The implementation follows the established patterns in the codebase with proper error handling and response parsing.
2146-2182: LGTM! New email verification completion method is well-implemented.The
UpdateEmailVerificationmethod properly handles the verification completion flow with consistent error handling and response parsing.
|
|
||
|
|
||
| ## 0.11.0 | ||
| ## v0.12.0 |
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.
Remove the duplicate v0.12.0 heading.
We now have two ## v0.12.0 sections. Drop the second one (or rename it) to satisfy MD024 and keep the changelog clear.
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
48-48: Multiple headings with the same content
(MD024, no-duplicate-heading)
🤖 Prompt for AI Agents
In CHANGELOG.md around line 48, there is a duplicate "## v0.12.0" heading;
remove the second occurrence (or rename it to the correct version if it was
meant to be different) so only one "## v0.12.0" section remains, ensuring
surrounding entries and formatting stay intact.
| "", | ||
| false, | ||
| databases.WithUpdateLineAttributeDefault(interface{}{[1,2], [3, 4]}), | ||
| databases.WithUpdateLineAttributeDefault(interface{}{[1, 2], [3, 4], [5, 6]}), |
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.
Fix invalid Go literal for default coordinates.
interface{}{[1, 2], …} won’t compile in Go because neither interface{} nor [1, 2] form valid composite literals. Use a properly typed slice of coordinate pairs instead.
Apply this diff to make the example compile:
- databases.WithUpdateLineAttributeDefault(interface{}{[1, 2], [3, 4], [5, 6]}),
+ databases.WithUpdateLineAttributeDefault([][]float64{{1, 2}, {3, 4}, {5, 6}}),📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| databases.WithUpdateLineAttributeDefault(interface{}{[1, 2], [3, 4], [5, 6]}), | |
| databases.WithUpdateLineAttributeDefault([][]float64{{1, 2}, {3, 4}, {5, 6}}), |
🤖 Prompt for AI Agents
In docs/examples/databases/update-line-attribute.md around line 22, the default
coordinates use an invalid Go literal `interface{}{[1, 2], [3, 4], [5, 6]}`
which won't compile; replace it with a properly typed slice of coordinate pairs
such as a slice of int slices (e.g. [][]int{{1, 2}, {3, 4}, {5, 6}}) or a slice
of interfaces containing int slices (e.g. []interface{}{[]int{1,2}, []int{3,4},
[]int{5,6}}) so the example compiles.
| "", | ||
| false, | ||
| tablesdb.WithCreatePointColumnDefault(interface{}{[1,2], [3, 4]}), | ||
| tablesdb.WithCreatePointColumnDefault(interface{}{1, 2}), |
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.
Use a typed slice for the point default.
interface{}{1, 2} is not valid Go syntax. A point should be expressed as a slice with an explicit element type.
Replace with:
- tablesdb.WithCreatePointColumnDefault(interface{}{1, 2}),
+ tablesdb.WithCreatePointColumnDefault([]float64{1, 2}),📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| tablesdb.WithCreatePointColumnDefault(interface{}{1, 2}), | |
| tablesdb.WithCreatePointColumnDefault([]float64{1, 2}), |
🤖 Prompt for AI Agents
In docs/examples/tablesdb/create-point-column.md around line 22, the default
point value uses invalid Go syntax `interface{}{1, 2}`; replace it with a slice
literal that includes an explicit element type (for example a slice of floats)
containing the coordinate values so the default is a properly typed slice like a
float32 or float64 slice with the two numbers.
| "", | ||
| false, | ||
| tablesdb.WithUpdateLineColumnDefault(interface{}{[1,2], [3, 4]}), | ||
| tablesdb.WithUpdateLineColumnDefault(interface{}{[1, 2], [3, 4], [5, 6]}), |
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.
Correct the default slice literal.
interface{}{[...], ...} is invalid Go; the snippet won’t build as written. Provide a typed slice of coordinate pairs.
Suggested fix:
- tablesdb.WithUpdateLineColumnDefault(interface{}{[1, 2], [3, 4], [5, 6]}),
+ tablesdb.WithUpdateLineColumnDefault([][]float64{{1, 2}, {3, 4}, {5, 6}}),📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| tablesdb.WithUpdateLineColumnDefault(interface{}{[1, 2], [3, 4], [5, 6]}), | |
| tablesdb.WithUpdateLineColumnDefault([][]float64{{1, 2}, {3, 4}, {5, 6}}), |
🤖 Prompt for AI Agents
In docs/examples/tablesdb/update-line-column.md around line 22, the default
slice literal uses an invalid untyped empty interface form `interface{}{[1,2],
[3,4], [5,6]}`; replace it with a properly typed slice of coordinate pairs (for
example a slice of [2]int or []int pairs, or the concrete type the API expects)
so the literal compiles—construct and pass a typed slice like [][2]int{ {1,2},
{3,4}, {5,6} } or the equivalent concrete type required by
tablesdb.WithUpdateLineColumnDefault.
| "", | ||
| false, | ||
| tablesdb.WithUpdatePointColumnDefault(interface{}{[1,2], [3, 4]}), | ||
| tablesdb.WithUpdatePointColumnDefault(interface{}{1, 2}), |
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.
Fix the point default literal.
interface{}{1, 2} can’t compile; declare the slice with a concrete element type.
Suggested change:
- tablesdb.WithUpdatePointColumnDefault(interface{}{1, 2}),
+ tablesdb.WithUpdatePointColumnDefault([]float64{1, 2}),📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| tablesdb.WithUpdatePointColumnDefault(interface{}{1, 2}), | |
| tablesdb.WithUpdatePointColumnDefault([]float64{1, 2}), |
🤖 Prompt for AI Agents
In docs/examples/tablesdb/update-point-column.md around line 22, the default
uses the invalid literal `interface{}{1, 2}` which won't compile; replace it
with a concrete-typed slice literal (for example `[]int{1, 2}` or the
appropriate numeric type like `[]float64{1, 2}`) so the point default has a
concrete element type.
| "", | ||
| false, | ||
| tablesdb.WithUpdatePolygonColumnDefault(interface{}{[1,2], [3, 4]}), | ||
| tablesdb.WithUpdatePolygonColumnDefault(interface{}{[[1, 2], [3, 4], [5, 6], [1, 2]]}), |
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.
Provide a correctly typed polygon literal.
The current interface{}{[[...]]} form is illegal Go. Supply a properly typed polygon (slice of linear rings).
One fix:
- tablesdb.WithUpdatePolygonColumnDefault(interface{}{[[1, 2], [3, 4], [5, 6], [1, 2]]}),
+ tablesdb.WithUpdatePolygonColumnDefault([][][]float64{{{1, 2}, {3, 4}, {5, 6}, {1, 2}}}),📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| tablesdb.WithUpdatePolygonColumnDefault(interface{}{[[1, 2], [3, 4], [5, 6], [1, 2]]}), | |
| tablesdb.WithUpdatePolygonColumnDefault([][][]float64{{{1, 2}, {3, 4}, {5, 6}, {1, 2}}}), |
🤖 Prompt for AI Agents
In docs/examples/tablesdb/update-polygon-column.md around line 22, the literal
uses the illegal Go form `interface{}{[[...]]}`; replace it with a properly
typed polygon literal: provide an outer slice of linear rings where each ring is
a slice of coordinate pairs (use a type like [][][]float64 or [][][2]float64
depending on the library), and populate it with the coordinate arrays so the
outer slice contains one or more rings and each ring contains ordered [x,y]
pairs.
| // The branch of the vcs repository | ||
| ProviderBranch string `json:"providerBranch"` | ||
| // The branch of the vcs repository | ||
| ProviderBranchUrl string `json:"providerBranchUrl"` |
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.
Fix duplicate comment for ProviderBranchUrl.
Line 63 contains a duplicate comment "The branch of the vcs repository" that should describe ProviderBranchUrl on line 64, not repeat the comment for ProviderBranch from line 61-62.
Apply this diff to correct the comment:
// The branch of the vcs repository
ProviderBranch string `json:"providerBranch"`
-// The branch of the vcs repository
+// The URL of the vcs branch
ProviderBranchUrl string `json:"providerBranchUrl"`🤖 Prompt for AI Agents
In models/deployment.go around lines 61 to 64, the comment for ProviderBranchUrl
incorrectly duplicates the comment for ProviderBranch; update the comment on the
ProviderBranchUrl field to describe that it is the URL for the branch in the VCS
(e.g., "The URL of the branch in the VCS repository") so the two fields have
distinct, accurate comments.
This PR contains updates to the Go SDK for version v0.12.0.
Summary by CodeRabbit
New Features
Chores
Documentation