Skip to content

feat(company-os): company-scoped team routes for owners and admins (#14106) - #20565

Merged
mrveiss merged 27 commits into
mainfrom
issue-14106-company-team-routes
Nov 4, 2026
Merged

mrveiss merged 27 commits into
mainfrom
issue-14106-company-team-routes

Conversation

@mrveiss

@mrveiss mrveiss commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Thinking Path

A maintainer decision says a company's owner or admin manages its own teams. Team writes only existed on routes for platform admins with the organisation taken from ambient context, so company-scoped routes are needed, with the scope from the path.

What Changed

  • New llc/api/company_teams.py: create and delete a team, add and remove a member, under /api/llc/companies/{company_id}/teams. They call the existing TeamService and response builders, with no second implementation.
  • Authorization is assert_company_access, then require_company_admin_unless_platform. An added user must belong to the company. Another company's team is a 404. TeamService writes the audit rows. Delete is the same soft delete, with no automatic cleanup.

Verification

  • test_company_teams_14106.py with test_membership_policy_19654.py: 55 passed, covering owner and admin, refusals with no commit or audit row, cross-company and outside-user cases. Database lookups are patched, so real rows are untested.
  • OpenAPI types are not regenerated here because the tool is not installed; verify-generated-types covers that.

Notes

  • TeamService.create_team makes the caller team owner, so a platform admin who is not a company member would own the team.
  • Builds on feat(frontend): Company OS Teams screen, read-only until the company routes land (#18245) #20558, which lands first. The Teams screen now creates and deletes teams and adds and removes members through these routes: useCompanyTeams.ts and TeamsView.vue, with a confirmed delete. No response says whether the caller may manage, so controls show to anyone who can read, and a member sees the refusal text.
  • TeamsView.writes.test.ts: 12 passed with reka-ui stubbed. Not seen rendered; the real select is untested.

Model Used

Claude Sonnet for the implementation, Claude Opus for coordination.

Closes #14106

@mrveiss mrveiss added this to the M3 - Refined GUI complete milestone Nov 1, 2026
@mrveiss mrveiss added the phase:M3.7 Company OS, Automation and BI screens label Nov 1, 2026
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 14 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 9fba9f3 and 46a61aa.

Files ignored due to path filters: 1
  • autobot-frontend/src/types/generated/api.ts is excluded by !**/generated/**
Files selected for processing: 8
  • autobot-backend/llc/api/__init__.py
  • autobot-backend/llc/api/company_teams.py
  • autobot-backend/llc/tests/test_company_teams_14106.py
  • autobot-frontend/src/composables/llc/useCompanyTeams.ts
  • autobot-frontend/src/i18n/locales/en.json
  • autobot-frontend/src/views/llc/TeamsView.vue
  • autobot-frontend/src/views/llc/__tests__/TeamsView.states.test.ts
  • autobot-frontend/src/views/llc/__tests__/TeamsView.writes.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Notice: 29 open PRs — past the runaway threshold (25)

This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.

This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.

Currently open:

If the queue is draining normally, ignore this. Otherwise:

  1. Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
  2. Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
  3. Look for a loop opening near-identical PRs

Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No new hardcoded values of either class — ssot and other both block.

Known backlog in pipeline-scripts/hardcoded_values_baseline.txt is suppressed and tracked in #14371.

@mrveiss

mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Code review on PR #20565 (head 1272119): approve of the routes; the screen's writes get a fresh look when they join this PR.

Read only; nothing was run, and the generated types weren't checked. All four routes check tenant then owner-or-admin before writing; another company's team is a 404; add refuses a user outside the company; delete is a soft delete, audited. Low: TeamService.remove_member reads the membership before the tenant-filtered get_team, so an admin of company A can tell whether a user is on a team in company B from 404 versus 400; call get_team first. No test drives the real query through the route.

This was referenced Nov 1, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Auto-sync: merging main into issue-14106-company-team-routes conflicts

The sync aborted the merge and pushed nothing. Conflicts are information, so it never resolves one itself. Below, for each conflicted file, are the commits that touched it on each side since the merge base 09e1c808fa. Merge main in yourself and push; the label clears on the first run that finds this branch 0 behind.

repo_tests/undefined_css_var_ratchet_17552_test.py

side commit subject issue refs
main d80ec1c8b fix(train): reach floors return to mid-window on the merged tree (#20251) #20251
this branch 088811b8e fix(frontend): re-pin the reach floors this branch moved (#18245) #18245

repo_tests/vnc_password_not_in_frontend_source_16299_test.py

side commit subject issue refs
main d80ec1c8b fix(train): reach floors return to mid-window on the merged tree (#20251) #20251
this branch 088811b8e fix(frontend): re-pin the reach floors this branch moved (#18245) #18245

…14106)

# Conflicts:
#	repo_tests/i18n_untranslated_ratchet_test.py
#	repo_tests/undefined_css_var_ratchet_17552_test.py
#	repo_tests/vnc_password_not_in_frontend_source_16299_test.py
@mrveiss

mrveiss commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

Code review on PR #20565 (head 05b98a4): approve. Read only. The main merge has no conflict hunks. 05b98a4 adds generated types for the four routes in llc/api/company_teams.py, and useCompanyTeams.ts calls those same paths. autofix-types on this head is the check that main's API hasn't moved since.

@github-actions github-actions Bot removed the sync-conflict Set by the branch sync (#19548) label Nov 3, 2026
@mrveiss

mrveiss commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Code review on PR #20565 (head b524614): APPROVE

Delta since the reviewed head 05b98a4: git log --no-merges --first-parent lists no own commits. The new commits are only automatic main merges (b524614, 76e2986 and the main merges they pull in), which are out of scope. Nothing to review, no findings.

Severity file:line issue fix
none - - -

@mrveiss
mrveiss merged commit f415969 into main Nov 4, 2026
3 of 4 checks passed
mrveiss added a commit that referenced this pull request Nov 4, 2026
@mrveiss
mrveiss deleted the issue-14106-company-team-routes branch November 4, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

phase:M3.7 Company OS, Automation and BI screens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(company-os): a company's teams can be read but not managed — no company-scoped team assignment path

1 participant