Skip to content

feat(config-ui): add a Teams page for org data management - #9205

Open
itaispiegel wants to merge 1 commit into
apache:mainfrom
itaispiegel:feat/config-ui-team-management
Open

itaispiegel wants to merge 1 commit into
apache:mainfrom
itaispiegel:feat/config-ui-team-management

Conversation

@itaispiegel

@itaispiegel itaispiegel commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

DevLake ships several team dashboards — DORA (by Team), Engineering Throughput and Cycle Time - Team View, GitHub Copilot Adoption by Team — and they all join through teams, team_users and user_accounts. Until now config-ui had no way to populate those tables: the org plugin's CSV endpoints were reachable only by hand-crafting a multipart upload with curl. On a fresh install the tables stay empty and every team dashboard renders blank, which reads as if the dashboards were built on placeholder data.

This adds a Teams page to config-ui, backed by the org plugin's existing endpoints. No backend change.

Three tabs:

  • Teams — id, name, alias, sorting index, and parent team as a select of the other teams rather than a raw id.
  • Members — id, name, email, and team membership as a multi-select that serialises back to the ;-delimited TeamIds cell.
  • Account Mapping — every collected tool account with its identity columns read-only, and a select to map it to a member. Rows can't be added or removed here, since accounts come from data collection.

Each tab round-trips a whole CSV file, matching the endpoints' existing delete-all-then-save semantics. The page states this in an alert, because a save overwrites rows added elsewhere since the page loaded. Columns the UI doesn't edit (AvatarUrl, CreatedDate, Status) are preserved by keeping the server's header order and writing untouched cells back verbatim.

The CSV helpers cover the subset of RFC 4180 that gocsv emits — quoted delimiters, doubled quotes, embedded newlines, CRLF — and are unit tested for round-trip stability (7 tests).

Does this close any open issues?

Closes #9206

Testing

  • yarn test — 50 tests across 7 files pass, including the new src/utils/csv.test.ts
  • yarn tsc --noEmit and yarn build clean
  • Driven manually against a local DevLake (docker-compose-dev-mysql.yml): seeded teams and members, confirmed the page renders them, confirmed the parent-team and team-membership selects resolve ids to names, and confirmed the account mapping tab lists collected accounts.

Notes for reviewers

  • There's no endpoint that lists accounts independently of the mapping file, so the Account Mapping tab reuses GET /plugins/org/user_account_mapping.csv, which already returns every account with its current UserId.
  • Full-file replace is inherited from the endpoints. Per-row CRUD on the org plugin would be a better end state; that felt like a separate, backend-side PR.

Screenshots

members teams mapping

🤖 Generated with Claude Code

DevLake's team dashboards (DORA by Team, Engineering Throughput - Team
View, Copilot by Team) join through `teams`, `team_users` and
`user_accounts`, but config-ui offered no way to populate them: the org
plugin's four CSV endpoints were reachable only by hand-crafting a
multipart upload. On a fresh install those tables stay empty and every
team dashboard renders blank.

Adds a Teams page with three tabs backed by the existing org endpoints,
so no backend change is required:

- Teams: id, name, alias, sorting index, and parent team as a select of
  the other teams rather than a raw id.
- Members: id, name, email, and team membership as a multi-select that
  serialises back to the `;`-delimited TeamIds cell.
- Account Mapping: every collected tool account, with its identity
  columns read-only and a select to map it to a member. Rows cannot be
  added or removed here because accounts come from data collection.

Each tab round-trips a whole CSV file, matching the endpoints' existing
delete-all-then-save semantics; the page says so in an alert, since a
save overwrites rows added elsewhere since the page loaded. Columns the
UI does not edit (AvatarUrl, CreatedDate, Status) are preserved by
keeping the server's header order and writing back untouched cells.

The CSV helpers cover the subset of RFC 4180 that gocsv emits - quoted
delimiters, doubled quotes, embedded newlines, CRLF - and are unit
tested for round-trip stability.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@itaispiegel
itaispiegel force-pushed the feat/config-ui-team-management branch from 90ee85e to 56c0ed4 Compare October 11, 2026 13:29
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.

[Feature][config-ui] Manage teams, members and account mapping from the UI

1 participant