Conversation
…ctions Agent-Logs-Url: https://github.com/Kong/kongctl/sessions/5b2dbdd5-b3ec-4f24-9d86-5fca607443d6 Co-authored-by: rspurgeon <10521262+rspurgeon@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Simplify fetch functions by using ResolveRequestPageSize helper
simplify: use ResolveRequestPageSize helper in eventgateway fetch functions
Apr 24, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors Konnect Event Gateway listing/fetching code to use the shared common.ResolveRequestPageSize(cfg) helper, reducing duplicated pagination page-size resolution and ensuring the Event Gateway list call won’t send pageSize=0 when unset/invalid.
Changes:
- Replace repeated inline page-size fallback logic with
common.ResolveRequestPageSize(cfg)across Event Gateway fetch functions. - Update Event Gateway adopt flow to use the shared page-size helper (and remove redundant int/int64 conversions).
- Apply small gofmt/goimports formatting adjustments in a handful of related files.
Reviewed changes
Copilot reviewed 11 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/theme/theme.go | Minor formatting alignment in var block. |
| internal/declarative/resources/portal_team.go | Minor struct field alignment formatting. |
| internal/declarative/resources/explain.go | Minor struct field alignment formatting. |
| internal/declarative/planner/event_gateway_tls_trust_bundle_planner_test.go | Multi-line function signature formatting. |
| internal/declarative/planner/env_placeholders_test.go | Minor map literal alignment formatting. |
| internal/cmd/root/verbs/scaffold/scaffold.go | Constant alignment formatting. |
| internal/cmd/root/products/konnect/eventgateway/backend_clusters.go | Use ResolveRequestPageSize in backend cluster pagination setup. |
| internal/cmd/root/products/konnect/eventgateway/virtual_clusters.go | Use ResolveRequestPageSize in virtual cluster pagination setup. |
| internal/cmd/root/products/konnect/eventgateway/listeners.go | Use ResolveRequestPageSize in listeners pagination setup. |
| internal/cmd/root/products/konnect/eventgateway/data_plane_certificates.go | Use ResolveRequestPageSize in data plane certs pagination setup. |
| internal/cmd/root/products/konnect/eventgateway/schema_registries.go | Use ResolveRequestPageSize in schema registries pagination setup. |
| internal/cmd/root/products/konnect/eventgateway/static_keys.go | Use ResolveRequestPageSize in static keys pagination setup. |
| internal/cmd/root/products/konnect/eventgateway/tls_trust_bundles.go | Use ResolveRequestPageSize in TLS trust bundles pagination setup. |
| internal/cmd/root/products/konnect/eventgateway/getEventGateway.go | Use ResolveRequestPageSize to ensure page size fallback guard is applied. |
| internal/cmd/root/products/konnect/eventgateway/cluster-policies.go | Import ordering adjustment (goimports). |
| internal/cmd/root/products/konnect/adopt/event_gateway.go | Use ResolveRequestPageSize for adopt flow pagination. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #865 introduced
common.ResolveRequestPageSize(cfg)to encapsulate the repeated page-size resolution pattern but left 8 eventgateway/adopt files using the duplicated 3-line inline block, andgetEventGateway.gomissing the< 1fallback guard entirely (riskingpageSize=0sent to the API).Changes
backend_clusters,virtual_clusters,listeners,data_plane_certificates,schema_registries,static_keys,tls_trust_bundles): replace duplicated inline block with helperadopt/event_gateway.go: replaceint-typed block +int64()cast with helper (already returnsint64)getEventGateway.go: fix missing< 1guard — bareint64(cfg.GetInt(...))could passpageSize=0to the APINo functional changes — the helper is a direct extraction of the inline logic.