FleetMDM (flamingo-stack/fleetmdm) is Flamingo's fork of the open-source Fleet device management platform, extended for the OpenFrame unified MSP ecosystem. It 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). This document explains how to propose and land a change: code style, branching, commit messages, the pull request process, and what the review checklist expects.
This repository does not use GitHub Issues or GitHub Discussions. Day-to-day coordination happens on the OpenMSP Slack community (https://www.openmsp.ai/, invite: https://join.slack.com/t/openmsp/shared_invite/zt-36bl7mx0h-3~U2nFH6nqHqoTPXMaHEHA). Open a pull request directly against
https://github.com/flamingo-stack/fleetmdm/pullsrather than filing an issue first.
Read the broader development context first:
../../getting-started/introduction.mdand../../getting-started/prerequisites.mdfor what you need installed.../../getting-started/quick-start.mdand../../getting-started/first-steps.mdto get a working environment.../setup/environment.mdand../setup/local-development.mdfor the day-to-day dev loop.../architecture/README.mdand../../reference/architecture/overview.mdfor how the server, agents, MDM stacks, and OpenFrame integration fit together.../testing/README.mdbefore you write tests for a change.../security/README.mdif your change touches authentication, certificates, MDM enrollment, or secrets handling.
FleetMDM is synced weekly from upstream fleetdm/fleet (see the scheduled Sync from upstream fleet workflow, which 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.
- 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 the 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), and the logger should be 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
.golangci.ymlcarries a long list of path-scopedgosecexclusions for legacy files (for examplecmd/osquery-perf/agent.go,orbit/pkg/update/update.go,server/mail/mail.go) — new code should not rely on these exclusions; they exist for pre-existing files only.- 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 (see theexclude-functionsblock in.golangci.yml); 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, currently using Prettier's defaults) viaeslint-plugin-prettier. - Notable project-specific rule overrides in
.eslintrc.js:@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 configured inwebpack.config.js. - 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 an assets/.eslintrc / views/.eslintrc override 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 — the globals and quote/semicolon rules differ intentionally between backend Sails code and browser-facing assets/ code.
Kotlin code is formatted with Spotless + ktlint (see the spotless block in android/app/build.gradle.kts) and linted with Detekt (android/app/detekt.yml, 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 (root-level ones live underwebsite/,ee/fleet-agent-downloader/,ee/vulnerability-dashboard/, andandroid/) 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, plusend-of-file-fixer/trailing-whitespacefrompre-commit-hooks. Installingpre-commitlocally catches most style and secret issues before they reach CI.
There is no single enforced branch-naming scheme documented in this repository, but the workflows reveal the conventions already in use — follow them for consistency:
- Automated upstream sync uses
sync/upstream-main(see.github/workflows/sync-upstream.yml). - 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 Review Checklist below) — Go lint/tests, frontend lint/tests, or Helm lint, depending on what you touched.
- Push and open a pull request against
mainathttps://github.com/flamingo-stack/fleetmdm/pulls. - CI runs automatically:
.github/workflows/test.yml(Fleet Test) detects which parts of the tree changed via.github/workflows/changes.yamland conditionally runstest_client(Go tests + cross-compilesorbitfor macOS/Windows),test(server-side Go tests, a GoReleaser snapshot build, and a Trivy image scan), andtest_helm(helm template fleet charts/fleet). Theall-checksjob aggregates these and fails the pull request if any of them fail or are cancelled..github/workflows/flamingo-code-review.yml(Flamingo Code Review) provides an AI-assisted review. Onopened/ready_for_review/reopenedit posts an invitation comment rather than reviewing automatically; a maintainer (or you, if you have 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.
- Address review feedback by pushing additional commits to the same branch; CODEOWNERS-required reviewers (see below) are requested automatically.
- Once
all-checksis green and required reviewers have approved, the PR can be merged. A push tomaintriggers.github/workflows/release.yml, which builds and publishes thefleetbinary image and thecharts/fleetHelm chart — so changes toserver/,cmd/,ee/,tools/, the rootDockerfile, or.goreleaser.ymlship automatically on merge.
The root CODEOWNERS file and .github/CODEOWNERS define required reviewers by path, on a last-match-wins basis. Notable entries:
| Path | Required reviewer(s) |
|---|---|
*.go, go.mod, go.sum, /cmd/, /server/, /ee/server/, /orbit/ |
@fleetdm/go |
/frontend/ |
@fleetdm/frontend |
/infrastructure/, /charts/, /terraform/ |
@rfairburn @ksatter @georgekarrv @BCTBB @ddribeiro |
/.github/workflows/ |
@georgekarrv @sharon-fdm @lukeheath @lucasmrod @getvictor |
/.github/CODEOWNERS |
@flamingo-stack/devops-engineers |
/docs/Contributing/architecture/mdm, /docs/Contributing/product-groups/mdm |
@georgekarrv @JordanMontgomery |
/docs/Contributing/architecture/orchestration |
@sharon-fdm @sgress454 |
/docs/Contributing/architecture/software |
@georgekarrv @cdcme |
/docs/Contributing/architecture/security-compliance |
@sharon-fdm @getvictor @mostlikelee |
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 (for example, "fix MDM profile reconciliation retry loop", not "fixed bug").
- 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 (.pre-commit-config.yaml) 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.
Before requesting review, verify the following. These map directly to what CI and the active review rules check:
- Every edit to an upstream-originated file is wrapped in
// >>> OPENFRAME(<slug>): <why>/// <<< OPENFRAME(<slug>)sentinels (FLEETMDM-001). Net-new fork-only files underserver/service/openframe/or similar are exempt. - No secrets, tokens, or credentials are committed (checked by
gitleaksin.pre-commit-config.yamland again in CI). - The change is scoped to the area it claims to touch; unrelated formatting churn is avoided so CODEOWNERS routing and diff review stay meaningful.
-
golangci-lintpasses locally against.golangci.yml(gofmt, govet, errcheck, staticcheck, revive, gosec, gocritic, unused, ineffassign, unconvert, rowserrcheck, sqlclosecheck, nilnesserr, depguard). - No new import of
github.com/pkg/errors,github.com/valyala/fastjson, orgithub.com/valyala/fasttemplate(depguard). - No bare
print/println, and no package-levelslog.Debug/Info/Warn/Errorcalls (forbidigo) — use a*slog.Loggerinstance with*Contextmethods. - Inside
cmd/,server/,ee/server/: new errors usectxerr.New/ctxerr.Wrap, notfmt.Errorf/errors.New(FLEETMDM-002), except in context-less leaf utility packages. - Every error returned across a call boundary is wrapped with a short lowercase context string via
%w(FLEETMDM-002-2) — no barereturn err. - Server-side logging uses
log/slogwithInfoContext/ErrorContext/DebugContextand structured key-value pairs, not string interpolation (FLEETMDM-004). - New cron/schedule jobs route non-fatal errors through
errHandler(ctx, logger, msg, err)and fatal errors through wrappedfmt.Errorfreturns — nolog.Fatal,panic, or barefmt.Println(FLEETMDM-006-2). - Multi-phase cron jobs wrap each phase in its own OpenTelemetry span and record phase timing and errors (
FLEETMDM-007-2). -
go test -race ./orbit/...(client) and the server-focused Go tests referenced by.github/workflows/test.yml(for examplego test -race ./server/config ./server/service ./cmd/fleet -run 'Test(OpenframeConfig|OpenframeOsquerySchemaRoute)') pass locally for the packages you touched. - A
goreleaser release --snapshot --clean --skip=publishbuild succeeds if you changed anything undercmd/,server/,ee/,pkg/,tools/, the rootDockerfile, or.goreleaser.yml— this mirrors thetestjob in.github/workflows/test.yml.
-
npm run lint(eslint frontend --ext .js,.jsx,.ts,.tsx) passes. -
npm run prettier:checkpasses. -
npm run test/npm run test:ci(Jest, configured via./frontend/test/jest.config.js) passes for affected components. - TypeScript compiles cleanly against
tsconfig.json. - New Storybook stories, if applicable, build via
npm run build-storybook.
- Linted against that app's own
.eslintrc(andassets/.eslintrc/views/.eslintrcwhere applicable), not the root config — quote style, semicolons, and the Sails modelglobalslist differ per app.
-
helm template fleet charts/fleetsucceeds (the same checktest_helmruns in.github/workflows/test.yml). - Chart dependency and image pins in
charts/fleet/Chart.yaml/charts/fleet/values.yamlare deliberate version bumps, not accidental — these feed the published OCI chart (oci://ghcr.io/flamingo-stack/fleetmdm/helm-charts/fleet) and image (ghcr.io/flamingo-stack/fleetmdm/fleet) on every merge tomain.
- Spotless/ktlint formatting is applied (
spotlessblock inandroid/app/build.gradle.kts). - Detekt findings are addressed per
android/app/detekt.ymlif running./gradlew check.
-
all-checksin.github/workflows/test.ymlis green. - Required CODEOWNERS reviewers for every path you touched have approved.
- If the change affects published artifacts (the
fleetGo module,fleetctl,fleetd-for-chrome, the Helm chart, or the container image), confirm the change is intentional for that artifact's consumers — this repository currently shows no downstream consumers recorded in the code graph, but the graph's coverage is partial, so an empty consumer list does not prove nothing depends on it.