Skip to content

factory: teams on the organization server (G1) - #2622

Merged
santoshkumarradha merged 4 commits into
work/teamsfrom
teams/g1-server-teams
Nov 13, 2026
Merged

santoshkumarradha merged 4 commits into
work/teamsfrom
teams/g1-server-teams

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

Lane G1 of the Teams wave. Implements the SPEC's /v1/teams* routes and the teams field on /v1/me.

What it adds

  • GET /v1/teams, POST /v1/teams, PATCH|DELETE /v1/teams/{id}, PUT|DELETE /v1/teams/{id}/members/{handle}.
  • Storage: factory-teams.json in the store root, rewritten under a cross-process lock beside factory-policies.json (how go-aheads persist). Survives a restart.
  • Writes are operator-only (403 otherwise). A duplicate name, ignoring case, gets 409. Only handles on the members list (memberList) can join; any other handle gets 422.
  • DELETE answers 409 while TeamOwnership.TeamOwnsWorkstream(team) is true. With nothing set, a team owns nothing. G2 fills this with h.SetTeamOwnership(...).
  • Removing a person (DELETE /v1/people/{handle}/sessions, or revoking an uncounted access link) takes them out of every team. "Revoke all sessions" does not remove anyone from a team, because it signs people out without removing them.
  • /v1/me gains "teams":[team_id], always a list. handle, name, avatar_url and operator were already there.
  • Every change appends {"kind":"team.changed","id"} to the live event stream. Every member can see it.
  • For G2: TeamMembership (TeamsOf(handle), Members(team)) through h.Membership().

Tests (serve/teams_test.go, using the peopleV2Setup fixture): operator-only writes, duplicate names, membership limited to existing members, /v1/me teams, persistence across a New restart, the 409 from the ownership stub followed by 204 and then 404, removal from every team, and the event payloads.

santoshkumarradha and others added 4 commits November 13, 2026 10:44
GET/POST /v1/teams, PATCH/DELETE /v1/teams/{id} and PUT/DELETE
/v1/teams/{id}/members/{handle}. Teams persist in the store beside the
go-ahead policies; writes are the operator's; only existing members join;
removing a person takes them out of every team; DELETE answers 409 while
TeamOwnership says the team owns a workstream. /v1/me gains teams. Every
change goes out as {"kind":"team.changed","id"} on the event stream.
TeamMembership (TeamsOf, Members) is exported for org workstreams.

Assisted-by: CodeAF
Co-Authored-By: CodeAF <[email protected]>
Assisted-by: CodeAF
Co-Authored-By: CodeAF <[email protected]>
@santoshkumarradha
santoshkumarradha merged commit 39fae67 into work/teams Nov 13, 2026
1 check passed
@santoshkumarradha
santoshkumarradha deleted the teams/g1-server-teams branch November 13, 2026 15:49
ZeroPoint95 pushed a commit that referenced this pull request Nov 24, 2026
Teams routes, storage, operator checks, membership, events and /v1/me teams for the Teams wave (G1).

Assisted-by: CodeAF
Co-Authored-By: CodeAF <[email protected]>
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