/Explore

madison / open-git

public
CodeIssues16Pull requests2InsightsCampfireDocs

feat: orgs and rbac

merged
#20 opened by madisonorgs→main
Conversation9Commits9Files changed116
Gitty
madisonopened this pull requestAuthor· last month

Summary

This PR adds namespace-backed organizations and repository RBAC across the web app, Git gateway, Campfire gateway, CI, and repository settings flows.

It replaces owner-profile-only assumptions with namespace-aware repository ownership, syncs org membership from Stack Auth without requiring admin keys, and centralizes sensitive authorization decisions so Git, Campfire, CI, PRs, issues, settings, forks, and repository pages all use the same capability model.

What Changed

  • Added namespace, organization membership, repository permission, and owner audit schema/migrations.
  • Added Stack-backed org membership sync and fresh repository authorization helpers.
  • Added an internal repository authorization endpoint used by Git and Campfire gateways.
  • Updated repository pages, APIs, CI routes, Campfire routes, PR flows, issue flows, and settings actions to enforce repository capabilities.
  • Added organization settings pages and expanded repository settings sections for general, access, runners, and danger settings.
  • Hardened fork visibility so private forks cannot be made public.
  • Rejected invalid or missing repository visibility instead of silently defaulting to public.
  • Fixed PR source visibility filtering, CI step/job binding, exact grant-target lookup, and Campfire cross-repo mention side effects.
  • Implemented repository insights data loading so web typecheck passes again.
  • Added focused tests for RBAC helpers, fork visibility, visibility validation, grant target normalization, migration preflight diagnostics, and stale helper guards.

Deployment Notes

This adds required internal authorization configuration for gateway-to-web authorization checks:

  • OPEN_GIT_INTERNAL_AUTH_SECRET
  • OPEN_GIT_INTERNAL_AUTH_URL

The deploy examples, README, Docker Compose files, and Turbo env configuration were updated accordingly.

Test Plan

  • pnpm --filter web typecheck
  • pnpm --filter web lint -- ...
  • pnpm --filter web test -- db/repository-permissions.test.ts lib/pre-org-helper-guards.test.ts lib/repository-permissions.test.ts lib/migration-preflight.test.ts
  • pnpm --filter web db:check
  • Focused gateway typechecks for Git and Campfire gateway changes

Madison added 9 commits · last month

View commits
  • feat: add namespace-backed organization permissions02d4315
  • feat: add org and repo settings workflows. Adds org settings, redo on repo settings, namespace aware dashboard/profile flows, and org-aware repo creation7c0e2a9
  • fix: centralize gateway repo authorization. Route Git and Campfire checks through the web authorization service with shared internal auth config and deployment docs193c981
  • fix: enforce repo authorization invariants. Apply repo capability checks across repository pages and APIs while hardening fork visibility, grant target lookup, PR filtering, CI step binding, and Campfire mention side effects6f765a0
  • fix: restore web typecheck for repo insights. Implement the repo insights data loader and add guard coverage so stale pre-org repo helpers do not return1f06195
  • rough docsf059138
  • Merge branch 'main' into orgsa5eda11
  • fix: add missing drizzle snapshot for org migrationsb86472a
  • fix updateWorkflowStepStatus to include jobIddef2936
All checks passed· last month· 7 checks
  • Apply migrations to a fresh Postgressuccess
  • Build websuccess
  • Lintsuccess
  • Schema drift (db:generate is up to date)success
  • Testssuccess
  • Typechecksuccess
  • drizzle-kit check (snapshot/journal consistency)success

Sign in to comment.

Merge readiness

Ahead0
Behind0
Fast-forwardReady

This pull request can be merged without creating a merge commit.

Checks

Apply migrations to a fresh Postgressuccess
Build websuccess
Lintsuccess
Schema drift (db:generate is up to date)success
Testssuccess
Typechecksuccess
drizzle-kit check (snapshot/journal consistency)success

Autopilot

Debug

Reviews

Approved0
ReviewersNone yet

Running Autopilot requires review access on this PR and push access to the source branch.