Skip to content

Cherry-pick #40414: Allow "unassigned.yml" in GitOps#40617

Merged
sgress454 merged 1 commit intorc-minor-fleet-v4.82.0from
cherry-pick-40414
Feb 26, 2026
Merged

Cherry-pick #40414: Allow "unassigned.yml" in GitOps#40617
sgress454 merged 1 commit intorc-minor-fleet-v4.82.0from
cherry-pick-40414

Conversation

@sgress454
Copy link
Copy Markdown
Contributor

Cherry-pick of #40414 into rc-minor-fleet-v4.82.0.

<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** For #40433

# Details

This PR updates `fleetctl gitops` and `fleetctl generate_gitops` to use
`unassigned.yml` in place of `no-team.yml`. The two files are utilized
identically, except that `unassigned.yml` expects the `name:` to be
`Unassigned` rather than `No team`.

Internally, we still map some things to the string "no team" before
sending to the back end so that we don't have to update back-end code
and make more spaghetti to clean up when we 🔪 No Team as a concept in
Fleet 5.

We do pass the filename into the main `DoGitOps` method, but both I and
Claude did our best to determine that it's not used in any way that
would break with this change.

# Checklist for submitter

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

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [X] Added/updated automated tests
- [X] QA'd all new/changed functionality manually
From test plan:
- [X] With a pre-existing GitOps folder w/ `no-team.yml`, run `fleetctl
gitops -f /path/to/no-team.yml --dry-run
--enable-log-topics=deprecated-field-names` and verify that everything
works as expected and you get the deprecation warning.
- [X] Do the above without `--dry-run` and verify via the UI and/or
`fleetctl generate-gitops` that the Fleet config is as expected.
- [X] Change `no-team.yml` to `unassigned.yml`, try a gitops run with
`fleetctl gitops -f /path/to/unassigned.yml --dry-run
--enable-log-topics=deprecated-field-names` and verify that you get an
error because the `name:` is still `No team`
- [X] Change the `name:` to `Unassigned`, repeat the run above and
verify that the output is the same as with `no-team.yml`, and that no
deprecation warning is listed.
- [X] Do the same as the above without `--dry-run` and verify that the
Fleet config is as expected.
- [X] Run `fleetctl generate-gitops` and verify that `unassigned.yml` is
output rather than `no-team.yml`, and any related files are under the
`lib/unassigned` folder rather than `lib/no-team`, and any paths inside
`unassigned.yml` (e.g. for scripts) are pointed at `lib/unassigned`.

## New Fleet configuration settings

- [X] Verified that the setting is exported via `fleetctl
generate-gitops`
- [ ] Verified the setting is documented in a separate PR to [the GitOps
documentation](https://github.com/fleetdm/fleet/blob/main/docs/Configuration/yaml-files.md#L485)
  @noahtalerman will work on this

---------

Co-authored-by: Ian Littman <iansltx@gmail.com>
@sgress454 sgress454 requested a review from a team as a code owner February 26, 2026 17:21
Copy link
Copy Markdown
Contributor

@iansltx iansltx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is slightly different than the related main PR, but #40364 seems to cover the missing change in software_installers.go so this is fine.

@sgress454 sgress454 merged commit 115390f into rc-minor-fleet-v4.82.0 Feb 26, 2026
37 of 39 checks passed
@sgress454 sgress454 deleted the cherry-pick-40414 branch February 26, 2026 18:06
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 86.88525% with 8 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (rc-minor-fleet-v4.82.0@b67ac38). Learn more about missing BASE report.

Files with missing lines Patch % Lines
cmd/fleetctl/fleetctl/generate_gitops.go 54.54% 5 Missing ⚠️
cmd/fleetctl/fleetctl/gitops.go 90.00% 1 Missing and 1 partial ⚠️
pkg/spec/gitops.go 96.66% 1 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##             rc-minor-fleet-v4.82.0   #40617   +/-   ##
=========================================================
  Coverage                          ?   66.40%           
=========================================================
  Files                             ?     2456           
  Lines                             ?   197007           
  Branches                          ?     8556           
=========================================================
  Hits                              ?   130818           
  Misses                            ?    54352           
  Partials                          ?    11837           
Flag Coverage Δ
backend 68.16% <86.88%> (?)

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

☔ View full report in Codecov by Sentry.
📢 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.

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