Skip to content

Extend host name template enforcement to "No team" - #49119

Merged
juan-fdz-hawa merged 3 commits into
38806-macos-iosipados-rename-hostsfrom
49109-rename-hosts-extend-enforcement-to-no-team-global-config
Jul 10, 2026
Merged

Extend host name template enforcement to "No team"#49119
juan-fdz-hawa merged 3 commits into
38806-macos-iosipados-rename-hostsfrom
49109-rename-hosts-extend-enforcement-to-no-team-global-config

Conversation

@juan-fdz-hawa

@juan-fdz-hawa juan-fdz-hawa commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Relates to #49109

Extends the host name template feature to hosts in "No team", mirroring disk encryption's dual scope.

Related issue: Resolves #

Checklist for submitter

If some of the following don't apply, delete the relevant line.

Testing

  • Added/updated automated tests
  • QA'd all new/changed functionality manually

Summary by CodeRabbit

  • New Features

    • Added support for configuring host name templates for hosts not assigned to a fleet.
    • GitOps can now apply, update, clear, and validate organization-level host name templates.
    • Host name enforcement and resend actions now work for unassigned hosts.
  • Bug Fixes

    • Improved enforcement reconciliation when hosts move between fleets and the unassigned scope.
    • Clearing templates now correctly removes pending enforcement actions.
    • Added consistent validation and authorization for unassigned-host settings.

@juan-fdz-hawa

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The change adds a global MDM host name template for hosts without a team. App configuration, APIs, GitOps controls, datastore queries, enforcement reconciliation, activities, resend behavior, and enterprise overrides now support the No-team scope. Team identifiers are nullable for enforcement operations, and template resolution uses global AppConfig for No-team hosts. Tests cover GitOps, persistence, authorization, transfers, filtering, reconciliation, and end-to-end MDM behavior.

Possibly related issues

Possibly related PRs

  • fleetdm/fleet#48693 — Introduced the enforcement persistence layer extended here for nullable No-team scoping.
  • fleetdm/fleet#48774 — Shares the enterprise host name template reconciliation and override paths.
  • fleetdm/fleet#48892 — Shares the GitOps controls.name_template pipeline extended here to organization and No-team scopes.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 39.13% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: extending host name template enforcement to No Team hosts.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 49109-rename-hosts-extend-enforcement-to-no-team-global-config

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.01942% with 35 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (38806-macos-iosipados-rename-hosts@7fb78dc). Learn more about missing BASE report.

Files with missing lines Patch % Lines
server/datastore/mysql/apple_device_names.go 67.39% 6 Missing and 9 partials ⚠️
server/service/appconfig.go 50.00% 2 Missing and 3 partials ⚠️
server/service/apple_device_names.go 66.66% 4 Missing and 1 partial ⚠️
server/service/apple_mdm.go 60.00% 2 Missing and 2 partials ⚠️
ee/server/service/teams.go 72.72% 0 Missing and 3 partials ⚠️
server/service/mdm.go 66.66% 1 Missing and 1 partial ⚠️
server/datastore/mysql/hosts.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                          Coverage Diff                          @@
##             38806-macos-iosipados-rename-hosts   #49119   +/-   ##
=====================================================================
  Coverage                                      ?   68.04%           
=====================================================================
  Files                                         ?     3684           
  Lines                                         ?   234582           
  Branches                                      ?    12410           
=====================================================================
  Hits                                          ?   159629           
  Misses                                        ?    60569           
  Partials                                      ?    14384           
Flag Coverage Δ
backend 69.69% <66.01%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@juan-fdz-hawa
juan-fdz-hawa force-pushed the 49109-rename-hosts-extend-enforcement-to-no-team-global-config branch from d7892fa to ea8a26b Compare July 10, 2026 13:28
@juan-fdz-hawa
juan-fdz-hawa force-pushed the 49109-rename-hosts-extend-enforcement-to-no-team-global-config branch from ea8a26b to 2eeab6a Compare July 10, 2026 14:33
@juan-fdz-hawa
juan-fdz-hawa marked this pull request as ready for review July 10, 2026 14:34
@juan-fdz-hawa
juan-fdz-hawa requested a review from a team as a code owner July 10, 2026 14:34
@juan-fdz-hawa
juan-fdz-hawa force-pushed the 49109-rename-hosts-extend-enforcement-to-no-team-global-config branch from 2eeab6a to cd7ade9 Compare July 10, 2026 15:52
Relates to #49109

Extends the host name template feature to hosts in "No team",
mirroring disk encryption's dual scope.
@juan-fdz-hawa
juan-fdz-hawa force-pushed the 49109-rename-hosts-extend-enforcement-to-no-team-global-config branch from 363ce00 to 8cea205 Compare July 10, 2026 17:50
@juan-fdz-hawa
juan-fdz-hawa merged commit 6503726 into 38806-macos-iosipados-rename-hosts Jul 10, 2026
26 checks passed
@juan-fdz-hawa
juan-fdz-hawa deleted the 49109-rename-hosts-extend-enforcement-to-no-team-global-config branch July 10, 2026 17:50
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.

Rename hosts: extend enforcement to "No team" (global config)

2 participants