chore: update version to v1.6.10 in API docs and internal info file#2943
chore: update version to v1.6.10 in API docs and internal info file#2943omer-topal wants to merge 1 commit intomasterfrom
Conversation
π WalkthroughWalkthroughVersion metadata is bumped from v1.6.9 to v1.6.10 across API documentation and internal version constants. Additionally, the template engine in bundle operations is switched from ChangesVersion Bump to v1.6.10
Template Engine Change in Bundle Operations
Estimated code review effortπ― 1 (Trivial) | β±οΈ ~3 minutes Possibly related PRs
Suggested reviewers
Poem
π₯ Pre-merge checks | β 5β Passed checks (5 passed)
βοΈ Tip: You can configure your own custom pre-merge checks in the settings. β¨ Finishing Touchesπ Generate docstrings
π§ͺ Generate unit tests (beta)
Tip π¬ Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. π Get started 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 |
There was a problem hiding this comment.
π§Ή Nitpick comments (1)
pkg/bundle/bundle.go (1)
20-44: β‘ Quick winExtract a shared template-render helper to eliminate 4-way duplication.
All four loops share identical parse β execute β buffer logic; only the downstream converter (
tuple.Tuplevsattribute.Attribute) differs. A small helper avoids having to touch four places the next time the template rendering needs to change (e.g., adding aFuncMap, tweaking error messages, or adding options).β»οΈ Proposed refactor
+// renderTemplate parses and executes a single template string against the provided arguments, +// returning the rendered result. +func renderTemplate(s string, arguments map[string]string) (string, error) { + tmpl, err := template.New("template").Parse(s) + if err != nil { + return "", err + } + var buf bytes.Buffer + if err = tmpl.Execute(&buf, arguments); err != nil { + return "", err + } + return buf.String(), nil +}Then each loop body collapses to:
- tmpl, err := template.New("template").Parse(w) - if err != nil { - return tb, ab, err - } - var buf bytes.Buffer - err = tmpl.Execute(&buf, arguments) - if err != nil { - return tb, ab, err - } - t, err := tuple.Tuple(buf.String()) + rendered, err := renderTemplate(w, arguments) + if err != nil { + return tb, ab, err + } + t, err := tuple.Tuple(rendered)(and equivalently for the three other loops, substituting
attribute.Attributewhere appropriate)Also applies to: 56-80, 92-116, 128-152
π€ Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/bundle/bundle.go` around lines 20 - 44, The four loops in pkg/bundle/bundle.go duplicate parse β execute β buffer logic; extract a small helper (e.g., renderTemplate(templateStr string, args interface{}) (string, error)) and use it from each loop so you only call renderTemplate(w, arguments) then pass the returned string into the downstream converter (tuple.Tuple or attribute.Attribute) before calling wtc.Add / atc.Add / etc.; ensure the helper centralizes template.New(...).Parse and tmpl.Execute error handling (and can later accept a FuncMap) so the loop bodies become just a call to renderTemplate plus the existing converter and Add calls.
π€ Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@pkg/bundle/bundle.go`:
- Around line 20-44: The four loops in pkg/bundle/bundle.go duplicate parse β
execute β buffer logic; extract a small helper (e.g., renderTemplate(templateStr
string, args interface{}) (string, error)) and use it from each loop so you only
call renderTemplate(w, arguments) then pass the returned string into the
downstream converter (tuple.Tuple or attribute.Attribute) before calling wtc.Add
/ atc.Add / etc.; ensure the helper centralizes template.New(...).Parse and
tmpl.Execute error handling (and can later accept a FuncMap) so the loop bodies
become just a call to renderTemplate plus the existing converter and Add calls.
βΉοΈ Review info
βοΈ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 376f8113-8c73-451a-8345-df865545ba9b
β Files ignored due to path filters (2)
go.work.sumis excluded by!**/*.sumpkg/pb/base/v1/openapi.pb.gois excluded by!**/*.pb.go
π Files selected for processing (7)
coverage.txtdocs/api-reference/apidocs.swagger.jsondocs/api-reference/openapi.jsondocs/api-reference/openapiv2/apidocs.swagger.jsoninternal/info.gopkg/bundle/bundle.goproto/base/v1/openapi.proto
Summary by CodeRabbit
Chores
Refactor