Skip to content

fix(mdm): set the tenant's Windows MDM address and turn Windows MDM on with it CU-17tkuw6avb8 - #291

Merged
andrii-flamingo merged 2 commits into
mainfrom
fix/windows-mdm-tenant-config
Dec 1, 2026
Merged

andrii-flamingo merged 2 commits into
mainfrom
fix/windows-mdm-tenant-config

Conversation

@andrii-flamingo

@andrii-flamingo andrii-flamingo commented Dec 1, 2026 •

Copy link
Copy Markdown

What

  • A tenant's config update no longer fails with 422 when its row never had an org name and a server URL (tenant rows are seeded without them). Until now OpenFrame could not write mdm.windows_server_url of such a tenant. Clearing them is still refused, and so is an unpinned update without them.
  • The update that gives a tenant its first mdm.windows_server_url also turns its Windows MDM on, when Windows MDM is on for the instance and the update doesn't set it itself. Later updates never do, so a tenant that turned it off stays off.
  • In shared mode the address can be changed but not cleared: after clearing it, the next address would count as the first again.

Rollout

On the dev cluster this turns Windows MDM on for every dev and QA tenant with a domain, and their eligible Windows PCs are told to enroll. On stage and prod set the instance flag before the addresses are written.

ClickUp task: 17tkuw6avb8

Change-Set: windows-mdm-turn-on

Change set flamingo-stack/windows-mdm-turn-on: this pull request is the only one in it so far. Another pull request joins by naming this one in a Depends-On line, or by carrying the same Change-Set line.

  • flamingo-stack/fleetmdm#291 (this pull request): fix(mdm): set the tenant's Windows MDM address and turn Windows MDM on with it CU-17tkuw6avb8 · landed

Linked work

  • …and 1 linked item not shown here

Linked by the Depends-On / Change-Set lines in these descriptions; this block is maintained by the hub.

@flamingo

flamingo Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

🦩 Flamingo Code Review

✅ Tests and checks passed on this commit (2 lanes).

✅ No findings on the current head.

Advisory: findings do not block the merge.

Files Lines Languages Checks 🔴 Action required 🟠 Recommended 🔵 Informational
4 +229 / -9 Go (1 go test lane) ✅ 1 / 1 passed 0 0 0

✅ What this change does well

  • server/service/openframe_windows_mdm.go keeps the fork logic inside OPENFRAME sentinels in the shared upstream file server/service/appconfig.go and wraps its errors with ctxerr, matching the fork's conventions.
  • openframe_windows_mdm_test.go covers the new first-address auto-enable across pinned/unpinned, shared/non-shared and explicit-flag payloads, including the "bad first address saves nothing" path that proves validation still runs after the mutation.
  • openframe/docs/mysql-multitenancy-feature.md is updated in the same change to describe both the seeded-tenant exemption and the first-address turn-on ordering requirement.
  • server/service/appconfig.go wraps both upstream edits in OPENFRAME sentinel comments with the doc reference, as FLEETMDM-001 requires.
  • server/service/openframe_windows_mdm.go returns errors via ctxerr.Wrap with contextual messages, matching FLEETMDM-002.
  • server/service/openframe_windows_mdm_test.go drives ModifyAppConfig itself, in and out of shared mode, pinned and unpinned, so removing the call or any of its conditions fails a test.
1 possible problem checked and ruled out
  • server/service/openframe_windows_mdm.go:278 Production shared-mode check now reads a context key that only tests ever set: The diff adds a context-key override (openframe_windows_mdm.go:278-286) consulted on the production ModifyAppConfig path; a real test-only seam in production code, but low impact since only tests set the key, a maintainability note.

🧪 Tests and mutation

Tests per lane

Language Project Command Status Counts Time
Go (go test) . go vet ./server/service && go test -cover ./orbit/... ✅ passed 5.3 s

Checks

Check Kind Language Project Status Time
OpenGrep security Go (OpenGrep) . ✅ passed 13.9 s

The test services of flamingo-stack/fleetmdm (server/mdm/nanodep/storage/mysql/docker-compose-test.yml) did not come up: the integration tests may fail for that reason.

The planned Go lane runs go vet ./server/service and the orbit tests, not the tests of server/service; those were run separately with go test -tags fts5 ./server/service/ without MYSQL_TEST: the only failure is TestEmbeddedCleanupScriptMatchesDocs, which reads a docs/ file this fork does not have.

Go is not installed on this machine, so the lane ran in a golang:1.26.6 container as a non-root user.

What the surviving mutations leave unverified

  • openframe_windows_mdm.go:300-326: No committed test runs this against MySQL: the tests mock the datastore. A disposable MySQL run of the first version of the branch covered it (one tenant turned on, the other tenant and the instance row unchanged); it was not repeated after the explicit-flag and no-clear changes.

1 gap (not tested here):

  • Go (go test) .: no mutation testing (no mutation tool for Go is configured: read the coverage of the changed packages instead)

Review again. New commits are not reviewed until you ask:

  • Review the new commits: only what was pushed since this review
  • Review the whole diff again: everything, including what was already reviewed
  • Run a security review: a review that looks for security problems only, with its own check

Or comment @flamingo-review (new commits) or @flamingo-review full (everything). Add the flamingo-review-always label to review every push.

Updated 2026-12-01 19:45 UTC · reviewed from Andrii Koropets's machine

@andrii-flamingo
andrii-flamingo enabled auto-merge (squash) December 1, 2026 21:29
@andrii-flamingo
andrii-flamingo merged commit 399b7a8 into main Dec 1, 2026
12 checks passed
@andrii-flamingo
andrii-flamingo deleted the fix/windows-mdm-tenant-config branch December 1, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants