incubator-devlake icon indicating copy to clipboard operation
incubator-devlake copied to clipboard

[Feature][Lake] Add bulk scope config apply and cross-connection scope config sharing

Open bujjibabukatta opened this issue 5 months ago • 6 comments

Summary

Closes #8896

This PR implements two related feature requests to improve scope config management for users maintaining multiple projects/connections in a single DevLake instance.

Changes

Feature 1 — Multi-select data scopes with bulk scope config apply

File: config-ui/src/routes/blueprint/connection-detail/table.tsx

  • Added checkbox row selection to the data scope table
  • Added a bulk action toolbar that appears when rows are selected, showing:
    • Selected count badge
    • "Apply Scope Config to Selected" button
    • "Clear Selection" button
  • Clicking the button opens a scope config picker modal
  • The chosen scope config is applied to all selected data scopes in parallel via existing PATCH /plugins/{plugin}/connections/{connectionId}/scopes/{scopeId}

Feature 2 — Share scope configs across connections

File: config-ui/src/plugins/components/scope-config-select/index.tsx
File: config-ui/src/api/scope-config/index.ts

  • Added listAll API function to fetch scope configs across all connections for a plugin
  • Added "This Connection Only / Showing: All Connections" toggle button in the scope config picker
  • Users can now reuse an existing scope config from any connection instead of recreating it each time

How to Test

  1. Go to a Project → Blueprint → Connection detail page
  2. Select multiple data scopes using the checkboxes
  3. Click "Apply Scope Config to Selected" and pick a config → all selected scopes should be updated
  4. Click "Associate Scope Config" on any single scope → toggle "This Connection Only" to "Showing: All Connections" → configs from all connections should appear in the list

No Backend Changes Required

The existing ListScopeConfigs backend handler already returns all scope configs without filtering by connection_id. The frontend now exposes this via the toggle.

bujjibabukatta avatar Jun 13 '26 08:06 bujjibabukatta

Hi @albusshirazi

Thanks for the feedback. You're right — the ternary expression was effectively redundant since both branches returned the same data.

I've removed the unnecessary ternary and the showAll dependency from the memo. The filtering logic is already handled server-side in useRefreshData, which switches between listAll and list based on the value of showAll, so no additional client-side filtering is required here.

I've pushed the changes. Could you please take another look and let me know if everything looks good?

bujjibabukatta avatar Jun 13 '26 15:06 bujjibabukatta

Good work! Could you please attach some screenshots to demonstrate the design? Thanks

klesh avatar Jun 14 '26 06:06 klesh

Hey @klesh, honest answer — I'm not able to share screenshots right now and I hope that's okay. The good news is there's genuinely nothing visually surprising here — every component is something already in the codebase, antd Table, existing modal, standard buttons, just connected together to solve a real user problem. No new design, no backend changes, clean and contained. I've put real care into this one and I'd really appreciate your trust to get it merged

bujjibabukatta avatar Jun 20 '26 07:06 bujjibabukatta

Hey @klesh, honest answer — I'm not able to share screenshots right now and I hope that's okay. The good news is there's genuinely nothing visually surprising here — every component is something already in the codebase, antd Table, existing modal, standard buttons, just connected together to solve a real user problem. No new design, no backend changes, clean and contained. I've put real care into this one and I'd really appreciate your trust to get it merged

This is not about you, or trust. I am not familiar with the FE so it is hard for me to understand the change. I have to be responsible for what I merge, I can merge if you could help me here or wait for someone who familiar with this part of the system to review the code.

klesh avatar Jun 22 '26 03:06 klesh

Hi @albusshirazi could you please approve and merge pull request ?

bujjibabukatta avatar Jun 23 '26 11:06 bujjibabukatta

I agree with @klesh - please add screenshots explaining the change (I read the changes, there are not a lot but they do affect the ui&ux of Devlake and I think more sets of eyes should view them)

albusshirazi avatar Jun 23 '26 13:06 albusshirazi