feat(kong)!: multiple data store API update - #399
Conversation
# Conflicts: # app/components/data-stores/create/DataStoreProjectInitializer.vue # test/components/data-stores/create/DataStoreProjectInitializer.spec.ts
|
Warning Review limit reached
Next review available in: 39 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughDatastore management now uses S3 configuration, generated and validated names, explicit project–datastore links, id-based deletion, datastore-specific health checks, and route tags for project resolution. Kong API models, cleanup handling, fixtures, and tests were updated. ChangesDatastore API and contracts
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant DataStoreProjectInitializer
participant useAPIFetch
participant HubAdapter
User->>DataStoreProjectInitializer: edit or reroll datastore name
DataStoreProjectInitializer->>DataStoreProjectInitializer: validate name and build s3_config
DataStoreProjectInitializer->>useAPIFetch: submit datastore/project initialization
useAPIFetch->>HubAdapter: call Kong initialization and link APIs
HubAdapter-->>useAPIFetch: return datastore/project response
useAPIFetch-->>DataStoreProjectInitializer: return API result
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
app/components/data-stores/create/DataStoreProjectInitializer.vue (1)
186-198: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winStale
dataStoreSettingsMapkeys break the S3 error toast labels.
dataStoreSettingsMapstill keys onminio_access_key/minio_secret_key, soverifyValuesFilled(s3Settings)falls through to the raw key and users see "s3_access_key is not defined!".🔤 Proposed fix (lines 77-78)
- ["minio_access_key", "S3 access key"], - ["minio_secret_key", "S3 secret key"], + ["s3_access_key", "S3 access key"], + ["s3_secret_key", "S3 secret key"],🤖 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 `@app/components/data-stores/create/DataStoreProjectInitializer.vue` around lines 186 - 198, Update dataStoreSettingsMap to use the s3_access_key and s3_secret_key keys passed by s3Settings, replacing the stale minio_access_key and minio_secret_key entries so verifyValuesFilled displays the correct S3 field labels.app/components/analysis/AnalysesTable.vue (1)
158-174: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winMissing path-based fallback when resolving project id from Kong routes.
getKongRoutes()only derivesprojUuidfromparseKongTags(route.tags).project, with no fallback toextractProjectIdFromPath(route.paths).app/composables/useDataStoreList.tsresolves the same relationship with a fallback (parseKongTags(route.tags).project ?? extractProjectIdFromPath(route.paths)). Any route lacking aproject:tag will be silently dropped fromkongRouteshere, causinganalysisEntry.datastoreto incorrectly reportfalse(missing data store) for a project that actually has a route/datastore link, inconsistent with how the data-stores page resolves the same data.🐛 Proposed fix
kongRoutesResp.data.forEach((route: Route) => { - const projUuid = parseKongTags(route.tags).project; + const projUuid = + parseKongTags(route.tags).project ?? + extractProjectIdFromPath(route.paths); if (projUuid) { projIds.push(projUuid); } });🤖 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 `@app/components/analysis/AnalysesTable.vue` around lines 158 - 174, Update getKongRoutes so project ID resolution uses extractProjectIdFromPath(route.paths) when parseKongTags(route.tags).project is absent, matching the fallback behavior in useDataStoreList.ts. Continue adding only resolved IDs to projIds before assigning kongRoutes.
🧹 Nitpick comments (1)
test/components/data-stores/create/DataStoreProjectInitializer.spec.ts (1)
293-297: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRegex built from the raw fixture name couples the test to sanitization.
generateDataStoreNamerewrites any char outside[a-zA-Z0-9._~-]to-, so these patterns break if a project fixture name ever contains a space or regex metacharacter. Deriving the expected prefix through the same helper (or escaping it) keeps the assertions honest. The ast-grep ReDoS hints on these lines are false positives — the input is a local test fixture.Also applies to: 399-399
🤖 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 `@test/components/data-stores/create/DataStoreProjectInitializer.spec.ts` around lines 293 - 297, Update the data-store name assertions near the existing generated-name checks to derive the expected project-name prefix through the same sanitization behavior as generateDataStoreName, or safely escape the fixture name before constructing the regular expression. Apply the same change to the additional assertion around the second matching location, while preserving validation of the adjective-noun suffix.Source: Linters/SAST tools
🤖 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.
Inline comments:
In `@app/components/header/CleanupDialog.vue`:
- Around line 81-99: Update cleanUpResource to select the modified-resource
count from cleanupResponse using the current endpoint value, rather than always
reading cleanupResponse.zombies. Map each supported endpoint (all, analyzes,
services, mb, rs, and zombies) to its matching CleanupPodResponse field while
preserving the existing default of zero when no count is returned.
---
Outside diff comments:
In `@app/components/analysis/AnalysesTable.vue`:
- Around line 158-174: Update getKongRoutes so project ID resolution uses
extractProjectIdFromPath(route.paths) when parseKongTags(route.tags).project is
absent, matching the fallback behavior in useDataStoreList.ts. Continue adding
only resolved IDs to projIds before assigning kongRoutes.
In `@app/components/data-stores/create/DataStoreProjectInitializer.vue`:
- Around line 186-198: Update dataStoreSettingsMap to use the s3_access_key and
s3_secret_key keys passed by s3Settings, replacing the stale minio_access_key
and minio_secret_key entries so verifyValuesFilled displays the correct S3 field
labels.
---
Nitpick comments:
In `@test/components/data-stores/create/DataStoreProjectInitializer.spec.ts`:
- Around line 293-297: Update the data-store name assertions near the existing
generated-name checks to derive the expected project-name prefix through the
same sanitization behavior as generateDataStoreName, or safely escape the
fixture name before constructing the regular expression. Apply the same change
to the additional assertion around the second matching location, while
preserving validation of the adjective-noun suffix.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f8a379c7-57c1-4248-8d4a-b7be72e88ab8
📒 Files selected for processing (19)
app/components/analysis/AnalysesTable.vueapp/components/data-stores/DataStoreList.vueapp/components/data-stores/DetailedDataStoreTable.vueapp/components/data-stores/create/DataStoreProjectInitializer.vueapp/components/header/CleanupDialog.vueapp/composables/useAPIFetch.tsapp/composables/useDataStoreList.tsapp/services/Api.tsapp/services/hub_adapter_swagger.jsonapp/utils/data-store-name.tsapp/utils/extract-uuid-from-kong-username.tsapp/utils/parse-kong-tags.tstest/components/data-stores/DataStoreList.spec.tstest/components/data-stores/constants.tstest/components/data-stores/create/DataStoreProjectInitializer.spec.tstest/mockapi/handlers.tstest/utils/data-store-name.test.tstest/utils/extract-uuid.test.tstest/utils/parse-kong-tags.test.ts
💤 Files with no reviewable changes (3)
- app/utils/extract-uuid-from-kong-username.ts
- test/utils/extract-uuid.test.ts
- test/components/data-stores/DataStoreList.spec.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@app/components/header/CleanupDialog.vue`:
- Around line 97-99: Update the cleanup response handling around the
cleanupResponse lookup to explicitly support the keycloak endpoint and other
cleanup endpoints that return no count; either add keycloak to the generated
CleanupPodResponse model or branch these endpoints through the no-count success
behavior, while preserving counted-resource handling for existing response
fields.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 13aec84a-30f5-47b6-a8f2-687d97b74375
📒 Files selected for processing (4)
app/components/header/CleanupDialog.vueapp/services/Api.tsapp/services/hub_adapter_swagger.jsontest/components/header/CleanupDialog.spec.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- app/services/hub_adapter_swagger.json
- app/services/Api.ts
Summary by CodeRabbit
New Features
Bug Fixes