How we organize and get things done with SERVICEOWNERS
GitHub added a service layer between code and teams in its 4.2M-line Rails monolith: a SERVICEOWNERS file maps glob patterns, directories and files to named services, and a service-mappings.yaml ties each service to teams, managers, chat channels and tier ratings. A serviceowners Ruby gem combines the two to generate CODEOWNERS automatically, so reassigning a service is a one-line YAML change, and it answers ownership queries via a CLI and chat-op. CI enforces rules such as no duplicate patterns, every new file must have a service, and every pattern must match an existing file. ownership.yaml files in other repos feed the same service catalog, letting services span repositories and making on-call contacts, SLOs and dependencies discoverable during incidents.
Related posts
- Organizing ownership: How we assign errors in our monolith
incident.io mediumAdeptincident.io assigns error ownership inside its monolith by dividing the codebase into team-owned units (apps, backend feature packages, integrations), each with a required jsonnet module file declaring owner, criticality and customer-facing features. A CI check enforces that every package has an owner, and a script rolls these up into a CODEOWNERS file. Error-wrapping middleware in Go recursively unwraps errors, maps stack-frame source paths against CODEOWNERS to find the deepest owning team, and tags the error with a team field that monitoring and alerting tools use for routing. A manual override is supported, and errors with no identifiable owner stay untagged and fall back to the on-call team.
- Using Github Actions with Railway
Railway mediumAdeptRailway deployments can be driven from GitHub Actions instead of the built-in branch-push trigger by creating a project token, storing it as a repository secret (RAILWAY_TOKEN), and running `railway up --service=<id>` inside the official Railway CLI container. A sample workflow triggers on pushes to main, checks out the code and uploads it to Railway. The token must stay secret, but the service ID can be passed openly. The same token approach also works for tasks like running database migrations before deploy or managing pull requests.
- Rolling out Roles
incident.io mediumAdeptincident.io added role-based access control by mapping a fixed set of customer-facing roles (owner, admin, etc.) to granular internal scopes. A variadic getIdentity(ctx, requiredScopes...) check in Go puts each API's permission behind a one-line change, and generated type-safe scope enums let the TypeScript frontend gate UI such as a GatedButton. Rollout used a per-organization enforcement timestamp with a March 1st deadline and owner opt-in. Initial owners were the original installers and admins were inferred from past product usage, with owners prompted to review both.
- Under the River
Shopify Engineering mediumAdeptShopify's Slack-native agent River co-authors one in eight merged PRs, and it rests on two 2024 bets: a single monorepo (World) and Nix-built reproducible environments across dev, CI and production. Underneath sits Aquifer, an internal agent platform built so the session outlives any process. A Postgres-backed append-only event log holds the conversation, the agent harness runs outside a disposable sandbox, and ephemeral session cells are recreated on demand. Agents are shipped as Nix-built profile bundles across interactive, automation and job modes. Lessons for agent infrastructure: decouple the brain from the hands, make agents public and multiplayer so transcripts compound into shared skills, and treat each new agent as a profile rather than a new platform.
- Working with NX, Railway and CI/CD
Railway mediumAdeptA GitHub Actions workflow can deploy only the NX monorepo apps affected by a push to Railway, replacing Railway's built-in GitHub trigger. The setup sets NIXPACKS_NX_APP_NAME, creates one Railway environment and project token per branch, and stores the tokens as GitHub secrets named RAILWAY_TOKEN__<project>_<environment>. On each push the workflow works out a base commit that survives force pushes, then lints and builds the affected projects. A bash script uses `nx print-affected` to find the affected apps, looks up each app's token from a dumped secrets JSON file, and runs `railway up --detach`. Dumping the secrets to a file is flagged as risky in public repos, and `--detach` keeps long container builds from using up GitHub Actions minutes.