Skip to content

feat(kong)!: multiple data store API update - #399

Merged
brucetony merged 7 commits into
developfrom
kong-update
Jul 29, 2026
Merged

feat(kong)!: multiple data store API update#399
brucetony merged 7 commits into
developfrom
kong-update

Conversation

@brucetony

@brucetony brucetony commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Data store names are now editable, validated, and can be auto-suggested with random rerolls.
    • Data store setup supports S3 configuration.
    • Projects and data stores can be explicitly linked/unlinked.
    • Connection checks and datastore health handling were improved for clearer status/loading behavior.
  • Bug Fixes

    • Data store and project operations now reliably use correct identifiers derived from route metadata/tags.
    • Deleting a data store now targets the intended store (including linked resources) and handles cases with no linked projects.
    • Cleanup dialog no longer includes a dedicated data-store option, aligning cleanup results reporting.

# Conflicts:
#	app/components/data-stores/create/DataStoreProjectInitializer.vue
#	test/components/data-stores/create/DataStoreProjectInitializer.spec.ts
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@brucetony, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 39 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 24606862-d388-42a3-871a-a206accec70f

📥 Commits

Reviewing files that changed from the base of the PR and between 3cd472c and 4345538.

📒 Files selected for processing (2)
  • app/assets/css/table.css
  • app/components/analysis/AnalysesTable.vue
📝 Walkthrough

Walkthrough

Datastore 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.

Changes

Datastore API and contracts

Layer / File(s) Summary
Kong API contracts and client wrappers
app/services/Api.ts, app/services/hub_adapter_swagger.json, app/composables/useAPIFetch.ts
Kong endpoints and models now support S3 settings, datastore id/name operations, explicit link/unlink calls, datastore health probes, structured health responses, revised analysis filters, and cleanup settings.
Datastore name generation and S3 form flow
app/utils/data-store-name.ts, app/components/data-stores/create/DataStoreProjectInitializer.vue, test/utils/data-store-name.test.ts, test/components/data-stores/create/DataStoreProjectInitializer.spec.ts
Datastore names are sanitized, validated, randomly suggested, and submitted with S3 configuration.
Route-aware datastore rows and actions
app/components/data-stores/DetailedDataStoreTable.vue, app/components/data-stores/DataStoreList.vue, app/components/analysis/AnalysesTable.vue, app/utils/parse-kong-tags.ts, app/composables/useDataStoreList.ts, test/components/data-stores/*, test/mockapi/handlers.ts
Route tags provide project identifiers, datastore rows support linked and unlinked stores, and deletion and health checks use datastore and row identifiers.
Cleanup behavior and supporting fixtures
app/components/header/CleanupDialog.vue, test/components/header/CleanupDialog.spec.ts, test/components/data-stores/DataStoreList.spec.ts
Datastore-specific cleanup handling and obsolete API mocks are removed, and related expectations and fixtures are updated.

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
Loading

Possibly related PRs

  • PrivateAIM/node-ui#316: Both update datastore initialization payload construction around S3 and MinIO configuration.
  • PrivateAIM/node-ui#352: Both modify datastore workflow and project-ID derivation in the datastore composable.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main theme of the PR: multiple Kong data store API updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kong-update

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@brucetony brucetony changed the title Multiple data store API update feat(kong)!: multiple data store API update Jul 29, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Stale dataStoreSettingsMap keys break the S3 error toast labels.

dataStoreSettingsMap still keys on minio_access_key/minio_secret_key, so verifyValuesFilled(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 win

Missing path-based fallback when resolving project id from Kong routes.

getKongRoutes() only derives projUuid from parseKongTags(route.tags).project, with no fallback to extractProjectIdFromPath(route.paths). app/composables/useDataStoreList.ts resolves the same relationship with a fallback (parseKongTags(route.tags).project ?? extractProjectIdFromPath(route.paths)). Any route lacking a project: tag will be silently dropped from kongRoutes here, causing analysisEntry.datastore to incorrectly report false (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 value

Regex built from the raw fixture name couples the test to sanitization.

generateDataStoreName rewrites 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

📥 Commits

Reviewing files that changed from the base of the PR and between 5872fb6 and 871729e.

📒 Files selected for processing (19)
  • app/components/analysis/AnalysesTable.vue
  • app/components/data-stores/DataStoreList.vue
  • app/components/data-stores/DetailedDataStoreTable.vue
  • app/components/data-stores/create/DataStoreProjectInitializer.vue
  • app/components/header/CleanupDialog.vue
  • app/composables/useAPIFetch.ts
  • app/composables/useDataStoreList.ts
  • app/services/Api.ts
  • app/services/hub_adapter_swagger.json
  • app/utils/data-store-name.ts
  • app/utils/extract-uuid-from-kong-username.ts
  • app/utils/parse-kong-tags.ts
  • test/components/data-stores/DataStoreList.spec.ts
  • test/components/data-stores/constants.ts
  • test/components/data-stores/create/DataStoreProjectInitializer.spec.ts
  • test/mockapi/handlers.ts
  • test/utils/data-store-name.test.ts
  • test/utils/extract-uuid.test.ts
  • test/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

Comment thread app/components/header/CleanupDialog.vue

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 871729e and 3cd472c.

📒 Files selected for processing (4)
  • app/components/header/CleanupDialog.vue
  • app/services/Api.ts
  • app/services/hub_adapter_swagger.json
  • test/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

Comment thread app/components/header/CleanupDialog.vue
@brucetony
brucetony merged commit 64370af into develop Jul 29, 2026
8 checks passed
@brucetony
brucetony deleted the kong-update branch July 29, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant