Thank you for your interest in contributing to FleetMDM — Flamingo's fork of the open-source Fleet device management platform, extended for the OpenFrame unified MSP ecosystem. This document explains how to set up a development environment, the branch/commit/PR workflow, code style, testing, and where to report a security issue.
The repository ships a Go backend service (cmd/fleet), the fleetctl CLI, the orbit/fleetd agent, a React/TypeScript web console (frontend/), and an Enterprise Chrome-extension agent (ee/fleetd-chrome). Per the organization's code graph, FleetMDM publishes a wide set of Go modules and npm packages (including github.com/fleetdm/fleet/v4, fleetctl, and fleetd-for-chrome); no downstream consumer is currently recorded, but graph coverage is partial, so that is not proof nothing depends on these artifacts.
This repository does not use GitHub Issues or GitHub Discussions. Day-to-day coordination, questions, and discussion happen on the OpenMSP Slack community:
- Join: openmsp.ai
- Direct invite: join.slack.com/t/openmsp/shared_invite/zt-36bl7mx0h-3~U2nFH6nqHqoTPXMaHEHA
Open a pull request directly against flamingo-stack/fleetmdm/pulls rather than filing an issue first.
Full setup instructions live in the development docs rather than being duplicated here:
- Development Overview — the map of the whole Development section, including how the Go backend, React frontend, and Enterprise subprojects fit together.
- Environment Configuration — required tooling (Go, Node/Yarn, Docker), IDE recommendations (VS Code configuration, debug targets), environment variables, and pre-commit hooks.
- Local Development — cloning the repository, bringing up MySQL/Redis/mail-catcher services via Docker Compose, building and running the
fleetserver andfleetctl, running the frontend/Storybook, hot-reload patterns, and debugging with Delve.
Before any of that, review the Getting Started guides for baseline tooling and an initial run-through:
For how the components relate to each other architecturally, see Architecture.
FleetMDM is synced weekly from upstream fleetdm/fleet (a scheduled workflow merges upstream/main into a sync/upstream-main branch and opens a pull request). Because of this, any edit to a file that originated upstream must be wrapped in sentinel comments so the next upstream sync can locate and re-apply Flamingo-specific logic:
// >>> OPENFRAME(<slug>): <why> — openframe/docs/<doc>.md
... your fork-specific change ...
// <<< OPENFRAME(<slug>)This is an enforced, active review rule (FLEETMDM-001) covering **/*.go, **/*.yaml, and **/*.tpl. Real examples of the pattern live in cmd/fleet/cron_registration.go, cmd/fleet/openframe_windows_wstep.go, and client/orbit_client.go. Net-new, fork-only code under paths like server/service/openframe/ is exempt — it never existed upstream, so there is nothing to reconcile.
A pull request that edits a shared upstream file without these sentinels will be rejected by the automated reviewer.
There is no single enforced branch-naming scheme documented in this repository, but existing conventions are worth following for consistency:
- Automated upstream sync uses a
sync/upstream-mainbranch. - The documentation pipeline uses a
code-documentation/branch prefix for its own generated pull requests — do not hand-author branches under this prefix. - Branches whose head repository is a fork (not
flamingo-stack/fleetmdmitself) are excluded from several automated workflows (code graph, code review), so contributions from forks should still targetmainthrough a normal pull request from your fork.
A descriptive, slash-namespaced branch name that states the area and intent (for example, a fix under the MDM stack, or a change to the vulnerability pipeline) is the most useful convention given the size of this codebase (cmd/, server/, ee/, orbit/, frontend/, android/).
- Fork or branch from
mainand make your change. - Keep upstream-originated files wrapped in
OPENFRAME(...)sentinels as described above; net-new OpenFrame-only code does not need them. - Run the relevant local checks before pushing (see Testing below) — Go lint/tests, frontend lint/tests, or Helm lint, depending on what you touched.
- Push and open a pull request against
mainat flamingo-stack/fleetmdm/pulls. - CI runs automatically:
- Fleet Test detects which parts of the tree changed and conditionally runs a client test job (Go tests, cross-compiling
orbitfor macOS/Windows), a server test job (server-side Go tests, a GoReleaser snapshot build, and a Trivy image scan), and a Helm template job. An aggregating job fails the pull request if any of these fail or are cancelled. - Flamingo Code Review provides an AI-assisted review. On open/ready-for-review/reopen it posts an invitation comment rather than reviewing automatically; a maintainer (or you, with write access) starts the first pass by checking its checkbox, commenting
@flamingo-review, or applying theflamingo-reviewlabel. Commenting@flamingo-review fullre-reviews the whole cumulative diff instead of only the incremental delta since the last reviewed commit.
- Fleet Test detects which parts of the tree changed and conditionally runs a client test job (Go tests, cross-compiling
- Address review feedback by pushing additional commits to the same branch; required reviewers (see CODEOWNERS below) are requested automatically.
- Once the aggregated CI check is green and required reviewers have approved, the PR can be merged. A push to
mainbuilds and publishes thefleetbinary image and thecharts/fleetHelm chart automatically — so changes toserver/,cmd/,ee/,tools/, the rootDockerfile, or.goreleaser.ymlship on merge.
The root CODEOWNERS file and .github/CODEOWNERS define required reviewers by path, on a last-match-wins basis — for example, Go sources and /server///cmd///orbit/ require the Go team, /frontend/ requires the frontend team, and /infrastructure/, /charts/, /terraform/ require the infra reviewers. If your change touches one of these paths, expect GitHub to request the matching reviewer(s) automatically — do not bypass this by routing the change through an unrelated path.
No commit-template or commit-lint tooling is enforced in this repository's CI. Write commits that:
- Use a short, present-tense summary line describing the change.
- Reference the relevant subsystem when it helps reviewers scope the diff (
server/mdm/apple,orbit,frontend,ee/maintained-apps, etc.). - Explain why in the body for anything non-obvious — particularly for
OPENFRAME(...)-wrapped changes, where the sentinel's own<why>clause should be echoed or expanded on in the commit body so a future upstream-sync author understands the deviation from upstream Fleet. - Are scoped to one logical change; prefer several focused commits over one sprawling commit when a change spans both a fork-only file and an upstream-originated file.
- Avoid committing secrets —
gitleaksruns as a pre-commit hook and will also be caught by CI if bypassed locally.
Squashing is a repository/maintainer decision at merge time; keep individual commits reviewable regardless of the final merge strategy.
- Formatting and linting are enforced by
.golangci.yml(golangci-lint v2 config) at the repository root, coveringgofmt,govet,errcheck,staticcheck,revive,gosec,gocritic,ineffassign,unconvert,unused,rowserrcheck,sqlclosecheck,nilnesserr, anddepguard. depguardforbids importinggithub.com/pkg/errors(usectxerrwhere acontext.Contextis available, or stdliberrors.New/fmt.Errorfwith%w) and forbidsgithub.com/valyala/fastjson/fasttemplate.forbidigoforbids bareprint/println, and forbids context-lessslog.Debug/Info/Warn/Errorpackage-level calls — use a specific*slog.Loggerinstance with the*Contextvariants instead.- Several active, enforced rules govern server-layer Go code specifically:
- FLEETMDM-002: inside
cmd/,server/, andee/server/, create errors withctxerr.New(ctx, ...)/ctxerr.Wrap(...)rather thanfmt.Errorforerrors.New; plain stdlib errors are acceptable only in leaf utility packages with no context available. - FLEETMDM-002-2: every error returned from a called function must be wrapped at the call boundary, e.g.
fmt.Errorf("<short lowercase context>: %w", err)— never a barereturn err. - FLEETMDM-004: server-side logging must use
log/slogviaInfoContext/ErrorContext/DebugContextwith structured key-value pairs (never interpolated into the message string), with the logger threaded through function signatures, not accessed globally. - FLEETMDM-006-2: in cron/schedule code (
cmd/fleet/cron.goand sibling files), non-fatal errors go through the localerrHandler(ctx, logger, msg, err)helper; fatal errors are returned directly withfmt.Errorfwrapping. Neverlog.Fatal,panic, or barefmt.Printlnfor error reporting in a cron job. - FLEETMDM-007-2: each distinct phase of a long-running cron function should open its own OpenTelemetry span (
tracer.Start(ctx, "<subsystem>.<phase>"),defer span.End()), record errors on the span withspan.RecordError(err), and log phase timing.
- FLEETMDM-002: inside
- Generated code is excluded from formatting checks (
server/fleet/agent_options_generated.go). errcheckhas an explicit allow-list of close/flush/logging calls whose errors may be ignored; anything not on that list must have its error checked.
- The root
.eslintrc.jsextendsairbnb,plugin:jest/recommended,plugin:react-hooks/recommended,plugin:@typescript-eslint/recommended,plugin:prettier/recommended, andplugin:storybook/recommended, parsed with@typescript-eslint/parser. - Formatting is delegated to Prettier (
.prettierrc.jsonat the root) viaeslint-plugin-prettier. - Notable overrides:
@typescript-eslint/no-shadowreplaces the baseno-shadow;@typescript-eslint/no-use-before-definereplaces the base rule;camelcaseis off;react/jsx-filename-extensionis a warning limited to.jsx/.tsx;import/no-unresolvedis case-insensitive via the webpack resolver. - Run
npm run lint(eslint frontend --ext .js,.jsx,.ts,.tsx) andnpm run prettier:checkbefore opening a pull request that touchesfrontend/. - TypeScript compiles against
tsconfig.json, targeting ES2019 with"jsx": "react"and anode-sql-parserpath alias pointed at the vendored@sgress454/node-sql-parserfork.
These Sails apps each carry their own .eslintrc (and assets/.eslintrc / views/.eslintrc overrides inside website/) with a stricter, non-airbnb rule set: 2-space indentation, single quotes, mandatory semicolons, eqeqeq, and no-undef against an explicit globals list of Sails models. If you touch one of these apps, lint with its own config, not the root one — globals and quote/semicolon rules differ intentionally between backend Sails code and browser-facing assets/ code.
Kotlin code is formatted with Spotless + ktlint and linted with Detekt (run via ./gradlew check in CI, not in local builds by default). android/.editorconfig sets 4-space indentation, a 140-character line length, Android Studio's ktlint_code_style, and disables the function-naming/property-naming ktlint rules that would otherwise flag @Composable function names and uppercase TAG constants.
.editorconfigfiles set LF line endings, UTF-8, and trailing-newline/trailing-whitespace trimming — configure your editor to respect them..pre-commit-config.yamlwiresgitleaks(secret scanning),golangci-lint,shellcheck,cpplint,eslint,pylint, RuboCop, andphp-lint-all, plus end-of-file/trailing-whitespace fixers. Installingpre-commitlocally catches most style and secret issues before they reach CI.
See the full Testing Guide for details on how each surface is tested and what CI runs. In short:
| Surface | Location | Test Runner |
|---|---|---|
| Go server, CLI, agents | cmd/, server/, ee/, client/, orbit/ |
Go's built-in testing package |
| React/TypeScript web console | frontend/ |
Jest, via frontend/test/jest.config.js |
| Chrome extension agent | ee/fleetd-chrome/ |
Jest (ESM, its own config) |
| Android agent | android/ |
JUnit + Robolectric (Gradle/Jacoco) |
Typical local commands:
# Run the full Go test suite
go test ./...
# Run tests for a single package, verbose, with coverage
go test -v -race -coverprofile=coverage.out ./client/...
# The orbit agent client, matching the CI client job
go test -race -coverprofile=coverage.out ./orbit/...
# Frontend Jest suite
yarn test
# CI-equivalent frontend run (no watch, with coverage)
yarn test:ci
# Chrome extension (run from inside ee/fleetd-chrome/)
cd ee/fleetd-chrome && yarn install && yarn testAndroid tests run from the android/ directory with ./gradlew test (unit, Robolectric), ./gradlew jacocoTestReport (coverage), and ./gradlew connectedAndroidTest (instrumented, requires a device/emulator).
Some integration-style Go suites require a reachable MySQL instance and, for Enterprise suites, Redis — bring these up via docker-compose.yml / docker-compose-redis-cluster.yml as described in Local Development.
- Go: co-locate
_test.gofiles with the code under test, in the same package. Use table-driven tests witht.Run(tt.name, ...)subtests where existing code does, and prefertestify'srequire/assertpackages. Wrap every error returned from a called function withfmt.Errorf("<context>: %w", err)at the call boundary (FLEETMDM-002-2) — this applies to test helper code as much as production code. If you are modifying a test file that originates upstream, wrap your changes in theOPENFRAME(...)sentinel pair, exactly as done in existing files likeclient/arch_test.go. - Frontend: name test files so they match the Jest
testMatchpattern — the filename must end intests.ts,tests.tsx,tests.js, ortests.jsx(not the more common*.test.tsx), or Jest will silently skip the file. Use@testing-library/reactand@testing-library/user-event, and prefermswrequest handlers over ad hocfetch/axiosmocking. - Chrome extension: new table/source modules under
ee/fleetd-chrome/src/tables/that read OS- or Chrome-API state should have a corresponding Jest test using the stubbedchromeglobal in that package'sjest.config.js. - Android: unit tests go under the standard Gradle
src/test/tree with Robolectric; instrumented tests go undersrc/androidTest/with Espresso/Compose. Tests that depend on a live SCEP server must be gated behind therunIntegrationTestsGradle project property, following the existing fail-fast validation pattern forscep.url/scep.challenge.
Coverage is tracked per-surface (go test -coverprofile, Jest V8 coverage, Jacoco for Android) but no workflow in this repository enforces a numeric coverage floor — treat the configured coverage collection as a reporting and local-feedback mechanism, and run the relevant suite locally before opening a pull request.
See the full Security Guide for the security model, authentication/authorization patterns, and review guidelines that apply to this codebase. Key points for contributors:
- Every new service method that reads or mutates state should open with an authorization check (
svc.authz.Authorize(ctx, &fleet.X{}, fleet.ActionY)) before any datastore access. - Secret fields (API tokens, client secrets, SCEP passwords) must be checked against
fleet.MaskedPasswordon update paths so a round-tripped masked value from the UI is rejected rather than persisted as a literal mask string. - New string fields that end up in a query, shell command, or template should be validated with an explicit allow-list regex, not a deny-list.
- Error strings should name the operation that failed, never echo a secret value.
server/servicemust never importee/server/servicedirectly, nor type-assertServiceto an EE type — enterprise-only behavior is injected viaEnterpriseOverrides.
To report a vulnerability, do not open a public pull request, issue, or Slack post. Follow the disclosure process in SECURITY.md, which covers scope, response timelines, and coordinated disclosure.
The full documentation set — getting started guides, architecture reference, and how-to guides — is indexed at Documentation Home.