How we ship code faster and safer with feature flags
GitHub puts risky changes and in-progress features behind feature flags so it can deploy continuously and disable problems in seconds instead of rolling back a deployment over several minutes. Flags can target individual actors (users, orgs, repos, GitHub Apps or custom actor types), all staff, beta groups, a sticky percentage of actors, or a per-request percentage ("dark shipping") for invisible changes such as query optimizations. CI runs two builds, one with all flags on and one with all flags off, to cover both code paths. The costs are runtime lookups (metadata in MySQL cached in memcached, with per-actor MySQL queries for large flags) and dead-code debt, which GitHub is automating away with a git grep and rubocop-ast script that rewrites conditionals and tests and opens a pull request routed to CODEOWNERS.
Related posts
- Roll it out, roll it back, never redeploy
Railway mediumAdeptRailway now offers feature flags across its dashboard, CLI, TypeScript SDK and MCP server, so code can ship dark behind a default-off flag and be rolled out to a team, a percentage of users, or targeted segments without redeploying. Percentage rollouts use a stable bucket(key) hash, so raising a threshold never flips users back. Reads evaluate in memory against rulesets fetched at init and refreshed in the background, which makes them cheap enough for hot paths. Instead of rule priorities, conflicting or unmatched rules resolve to the flag's default, and an evaluate API returns a reason and per-rule trace for debugging.
- Now you see me, now you don't: feature-flagging with LaunchDarkly at incident.io
incident.io mediumAdeptincident.io ships to production many times a day and uses feature flags to merge large features like Announcement Rules incrementally while hiding them from customers until launch. The team chose LaunchDarkly over building its own system because feature flagging isn't a differentiator, and integrated it across backend and frontend in a day. On the backend, the Go SDK is wrapped in a featureflags package that centralizes flag names as constants, initializes a singleton client, returns clients scoped to user and organization IDs, and supports injecting mocks so tests cover both flag states. On the frontend, the React SDK hook gates UI, and flags are mostly targeted per organization to run beta tests.
- How GitHub uses CodeQL to secure GitHub
GitHub Engineering mediumAdeptGitHub's Product Security Engineering team runs CodeQL across more than 10,000 repositories, mostly with default setup and the security-extended suites. Its Ruby monolith gets advanced setup with a custom query pack published to GitHub Container Registry. Publishing the pack separately avoided production deploys for every query change, gave precompiled queries, and kept CodeQL CLI upgrades from breaking monolith CI. A bad query could be rolled back by republishing the pack in under 15 minutes. The post shows how they pin the ruby-all dependency via codeql-pack.lock.yml, unit-test queries, share the pack through a linked repository, and use recommendation-severity custom queries (e.g. missing control_access on REST endpoints, ActiveRecord decrypt) alongside multi-repository variant analysis for bug bounty follow-up.
- How we use Dependabot to secure GitHub
GitHub Engineering mediumAdeptGitHub's Product Security Engineering team rolled Dependabot out across several thousand internal repositories in three stages: measuring alerts org-wide through the GraphQL API, a staged enablement (200 repos, then 1,000 at 30 days, then the whole org at 45 days), and remediation. Remediation was driven through the internal Service Catalog, which receives Dependabot metrics through the REST API, attaches SLOs with grace periods, and limits the effort to production services. Folding these metrics into the monthly Engineering Fundamentals review raised the share of services with zero alerts from 68% to 81% in a quarter, covering about 50 services. The same approach was later extended to CodeQL.
- Building GitHub with Ruby and Rails
GitHub Engineering mediumAdeptGitHub's ~2M-line Rails monolith upgrades to the latest Rails main-branch commit every week via a scheduled GitHub Actions workflow that opens an automated PR, runs all builds, and ships the next day. CI also runs a parallel build against the latest Ruby commit, which let GitHub test Ruby 3.2 release candidates on production traffic, catch regressions such as a keyword-argument allocation increase before release, and adopt Ruby 3.2.1 on release day. Benefits include dropping nearly all Rails patches, avoiding big-bang migrations, and better security posture. The approach depends on a thorough test suite and progressive rollout deploys.