Skip to content

Cherry-pick #40548: Add aliases to fleetctl commands and flags#40690

Merged
sgress454 merged 2 commits intorc-minor-fleet-v4.82.0from
cherry-pick-40548
Feb 27, 2026
Merged

Cherry-pick #40548: Add aliases to fleetctl commands and flags#40690
sgress454 merged 2 commits intorc-minor-fleet-v4.82.0from
cherry-pick-40548

Conversation

@sgress454
Copy link
Copy Markdown
Contributor

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

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

This PR updates `fleetctl` with new commands and flag names with "team"
and "query" terminology replaced with "fleet" and "report", using
aliases for backwards compatibility and logging deprecation warnings
when the old terminology is used.

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

- [ ] 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.
n/a

- [X] Added/updated automated tests
- [X] QA'd all new/changed functionality manually
- [x] `fleetctl query` -> `fleetctl report`
- [x] using `fleetctl query` logs a deprecation warning
---
- [x] `fleetctl get queries` -> `fleetctl get reports`
- [x] using `fleetctl get queries` logs a deprecation warning
---
- [x] `fleetctl get teams` -> `fleetctl get fleets`
- [x] using `fleetctl get teams` logs a deprecation warning
---
- [ ] `fleetctl apply --policies-teams` -> `fleetctl apply
--policies-fleets`
- [ ] using `fleetctl apply --policies-teams` logs a deprecation warning
---
- [x] `fleetctl get --with-queries` -> `fleetctl get --with-reports`
- [x] using `fleetctl get --with-queries` logs a deprecation warning
---
- [x] `fleetctl gitops --delete-other-teams` -> `fleetctl gitops
--delete-other-fleets`
- [x] using `fleetctl gitops --delete-other-teams` logs a deprecation
warning
---
- [x] `fleetctl report --query-name` -> `fleetctl report --report-name`
- [x] using `fleetctl report --query-name` logs a deprecation warning

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

* **New Features**
* Deprecation warnings for legacy command and flag names to help users
transition to current terminology.

* **Changes**
* "Team" terminology updated to "Fleet" across commands and associated
flags throughout the CLI.
* "Queries" terminology updated to "Reports" in get and related
commands.
* All flag name changes maintain backward compatibility through aliases
for existing automation.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Ian Littman <iansltx@gmail.com>
(cherry picked from commit 8e98a1b)
@sgress454 sgress454 requested a review from a team as a code owner February 27, 2026 14:45
The opts.ActivityMock pattern doesn't exist in the rc branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sgress454
Copy link
Copy Markdown
Contributor Author

@iansltx FYI I had to resolve a merge conflict on the fleetctl/hosts_test.go file on this one.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 27, 2026

Codecov Report

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

Files with missing lines Patch % Lines
cmd/fleetctl/fleetctl/generate_gitops.go 46.66% 6 Missing and 2 partials ⚠️
cmd/fleetctl/fleetctl/get.go 85.18% 3 Missing and 5 partials ⚠️
cmd/fleetctl/fleetctl/flags.go 88.88% 3 Missing and 2 partials ⚠️
cmd/fleetctl/fleetctl/query.go 80.00% 2 Missing and 1 partial ⚠️
cmd/fleetctl/fleetctl/scripts.go 71.42% 2 Missing ⚠️
cmd/fleetctl/fleetctl/apply.go 83.33% 0 Missing and 1 partial ⚠️
cmd/fleetctl/main.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##             rc-minor-fleet-v4.82.0   #40690   +/-   ##
=========================================================
  Coverage                          ?   66.40%           
=========================================================
  Files                             ?     2456           
  Lines                             ?   197029           
  Branches                          ?     8556           
=========================================================
  Hits                              ?   130836           
  Misses                            ?    54354           
  Partials                          ?    11839           
Flag Coverage Δ
backend 68.16% <82.82%> (?)

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.

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.

Thanks for calling out the conflict resolution. Given that tests pass, that conflict was resolved correctly, so g2g.

@sgress454 sgress454 merged commit ca55789 into rc-minor-fleet-v4.82.0 Feb 27, 2026
49 checks passed
@sgress454 sgress454 deleted the cherry-pick-40548 branch February 27, 2026 17:39
@georgekarrv georgekarrv mentioned this pull request Mar 3, 2026
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