Skip to content

fix: update bucket ingestion messages for clarity and pre-select saved buckets#1943

Open
ricofurtado wants to merge 3 commits into
mainfrom
fix-ingestion-of-buckets-not-working-right-after-connection-is-tested-75506
Open

fix: update bucket ingestion messages for clarity and pre-select saved buckets#1943
ricofurtado wants to merge 3 commits into
mainfrom
fix-ingestion-of-buckets-not-working-right-after-connection-is-tested-75506

Conversation

@ricofurtado

@ricofurtado ricofurtado commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Port of 68cb5be from the CPD branch to main. Fixes two issues with S3 and IBM COS connectors: clarifies that the settings dialog's bucket selection sets a default filter (not an immediate ingest), and pre-populates the Add Knowledge upload page with the buckets already saved in the connector config so users don't have to re-select them.

Summary by CodeRabbit

Release Notes

  • New Features

    • S3 and IBM COS bucket configuration now pre-selects any available default buckets on initial load.
  • UI/UX Improvements

    • Updated bucket selection label to “Restrict to Specific Buckets”.
    • Updated helper text to clarify that leaving all buckets unchecked will include all.
    • Updated success messages to show “Filtered to: …” when restricted, or “All accessible buckets are included.” when unrestricted.

…d buckets

Port of 68cb5be from the CPD branch to main. Fixes two issues with S3 and
IBM COS connectors: clarifies that the settings dialog's bucket selection sets
a default filter (not an immediate ingest), and pre-populates the Add Knowledge
upload page with the buckets already saved in the connector config so users
don't have to re-select them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the frontend 🟨 Issues related to the UI/UX label Jun 22, 2026
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 44eb1c7a-f50b-4dcc-948e-6a6112e56c2d

📥 Commits

Reviewing files that changed from the base of the PR and between a19fb19 and 40ae8b6.

📒 Files selected for processing (1)
  • frontend/components/connectors/shared-bucket-view.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/components/connectors/shared-bucket-view.tsx

Walkthrough

SharedBucketView gains an optional initialSelectedBuckets prop that is applied once after buckets load via a guarded useEffect. Both S3BucketView and IBMCOSBucketView now fetch their respective connector defaults and pass bucket_names as that initial selection. Form labels and toast messages are also updated across both connectors to use "Restrict to Specific Buckets" and "Filtered to: …" / "All accessible buckets are included." wording.

Changes

Bucket Defaults and UI Copy

Layer / File(s) Summary
SharedBucketView initial selection prop and effect
frontend/components/connectors/shared-bucket-view.tsx
SharedBucketViewProps gains optional initialSelectedBuckets?: string[]; React imports extended with useEffect and useRef; a useRef guard and useEffect filter the prop against loaded buckets and call setSelectedBuckets exactly once.
S3 and IBM COS bucket views wire defaults to SharedBucketView
frontend/components/connectors/aws-s3/bucket-view.tsx, frontend/enhancements/connectors/ibm-cos/components/bucket-view.tsx
Each bucket view imports its connector-specific defaults query hook, calls it with enabled true, and passes defaults?.bucket_names as initialSelectedBuckets to SharedBucketView.
Form labels and toast message copy updates
frontend/app/settings/_components/s3-settings-form.tsx, frontend/app/settings/_components/s3-settings-dialog.tsx, frontend/enhancements/connectors/ibm-cos/settings-form.tsx, frontend/enhancements/connectors/ibm-cos/settings-dialog.tsx
Bucket selector label changed to "Restrict to Specific Buckets" with helper "leave all unchecked to include all"; success toast descriptions updated to "Filtered to: …" / "All accessible buckets are included." for both S3 and IBM COS.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: updating bucket ingestion messages for clarity and pre-selecting saved buckets, which directly aligns with the changeset's two primary objectives.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix-ingestion-of-buckets-not-working-right-after-connection-is-tested-75506

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.

@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 22, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@frontend/components/connectors/aws-s3/bucket-view.tsx`:
- Line 29: The useS3DefaultsQuery on line 29 returns defaults that may belong to
a different S3 connection than the current connector. Before using
defaults?.bucket_names on line 42 to set initialSelectedBuckets, add a check to
verify that defaults?.connection_id matches the current connector.connectionId.
Only pass defaults?.bucket_names to initialSelectedBuckets if the connection IDs
match; otherwise, pass undefined or an empty array to avoid preselecting buckets
from a different connection.

In `@frontend/components/connectors/shared-bucket-view.tsx`:
- Around line 58-79: The useEffect hook in SharedBucketView is not properly
preventing re-application of initial defaults. The issue is twofold: first, the
condition checks whether initialSelectedBuckets exist but does not verify that
the user hasn't already made manual selections in selectedBuckets, so defaults
can overwrite user choices. Second, hasAppliedInitial.current is only set to
true when valid.length is greater than zero, allowing the effect to re-run on
subsequent bucket updates and silently change the bucket_filter. Fix this by
adding a check to ensure selectedBuckets is empty before applying defaults, and
move the hasAppliedInitial.current = true assignment outside the valid.length
conditional so it is always set after the first evaluation, preventing the
effect from running multiple times.

In `@frontend/enhancements/connectors/ibm-cos/components/bucket-view.tsx`:
- Line 29: The useIBMCOSDefaultsQuery call does not filter defaults by the
current connector's connection ID, causing bucket_names from wrong connector
profiles to be used when multiple IBM COS connections exist. Modify the
useIBMCOSDefaultsQuery hook call to include the current connector.connectionId
as a parameter or filter, and add a validation check before using
defaults?.bucket_names at the point where it's forwarded (around line 42) to
ensure the returned defaults actually belong to the current
connector.connectionId before applying them to the selection.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8c80f807-2ef1-4655-beb4-bfb2f00c5ef1

📥 Commits

Reviewing files that changed from the base of the PR and between 08fe04e and 91cf02e.

📒 Files selected for processing (7)
  • frontend/app/settings/_components/s3-settings-dialog.tsx
  • frontend/app/settings/_components/s3-settings-form.tsx
  • frontend/components/connectors/aws-s3/bucket-view.tsx
  • frontend/components/connectors/shared-bucket-view.tsx
  • frontend/enhancements/connectors/ibm-cos/components/bucket-view.tsx
  • frontend/enhancements/connectors/ibm-cos/settings-dialog.tsx
  • frontend/enhancements/connectors/ibm-cos/settings-form.tsx

Comment thread frontend/components/connectors/aws-s3/bucket-view.tsx
Comment thread frontend/components/connectors/shared-bucket-view.tsx Outdated
Comment thread frontend/enhancements/connectors/ibm-cos/components/bucket-view.tsx
The defaults query returns the first S3/COS connection regardless of active
status. Only pre-select saved bucket_names when the defaults connection_id
matches the current connector.connectionId to avoid seeding the wrong
buckets if a stale connection exists alongside the active one.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 22, 2026
Two issues in the initial-selection effect:
1. hasAppliedInitial was only set when valid buckets were found, leaving the
   effect live across bucket refreshes and allowing stale defaults to overwrite
   selections made after a refetch.
2. No guard against the async race where buckets loads before initialSelectedBuckets:
   user clicks buckets, defaults arrive later and silently overwrite them.

Fix: mark hasAppliedInitial unconditionally on first evaluation, and only apply
defaults when selectedBuckets is still empty (user hasn't acted yet).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🔴 Something isn't working. frontend 🟨 Issues related to the UI/UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant