Skip to content

Update datastore.go - #55072

Merged
lucasmrod merged 5 commits into
fleetdm:mainfrom
patrickrgr:patch-2
Oct 23, 2026
Merged

lucasmrod merged 5 commits into
fleetdm:mainfrom
patrickrgr:patch-2

Conversation

@patrickrgr

@patrickrgr patrickrgr commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Resolves: #56414.

If I understand correctly, "fleets" used to be called "teams".
Changed 3 error messages that said "team" to use "fleet" instead.

Also changed "No team" to "Unassigned" in these messages, and updated the tests that asserted the old wording.

Checklist for submitter

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 for more information.

  • Input data is properly validated, SELECT * is avoided, SQL injection is prevented (using placeholders for values in statements), JS inline code is prevented especially for url redirects, and untrusted data interpolated into shell scripts/commands is validated against shell metacharacters.

Testing

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

AI

AI: Claude Code (claude-opus-5-5)

Frontend

  • Attached a screenshot or screen recording of each user-visible change. For changes to existing UI, show the before and after.
Screenshot 2026-10-23 at 8 44 00 AM Screenshot 2026-10-23 at 8 43 12 AM Screenshot 2026-10-23 at 8 42 21 AM Screenshot 2026-10-23 at 8 40 47 AM

Changed 3 error messages that said "team" to use "fleet" instead.
@patrickrgr
patrickrgr requested a review from a team as a code owner October 8, 2026 01:26
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: fleetdm/fleet
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: dc2161d
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: aec77c66-b808-44fa-ba5e-c26d77b556ba
📥 Commits

Reviewing files that changed from the base of the PR and between 4abc12a and a2ba00f.

📒 Files selected for processing: 5
  • changes/secret-variable-in-use-error-fleet-wording
  • server/datastore/mysql/secret_variables.go
  • server/datastore/mysql/secret_variables_test.go
  • server/fleet/datastore.go
  • server/service/integration_core_secret_variables_test.go
🚧 Files skipped from review as they are similar to previous changes: 1
  • server/fleet/datastore.go

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

Walkthrough

Secret-use deletion errors now refer to the owning scope as a fleet instead of a team. The errors cover scripts, host-name templates, and configuration profiles. For unassigned scripts, Apple configuration profiles, Apple declarations, and Windows configuration profiles, the reported name changes from “No team” to “Unassigned.”

Possibly related issues

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to a2ba0

No actionable merge-blocking risk is established by the reviewed changes.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 4 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title refers to a modified file and is related to the pull request, but it does not describe the wording changes. It is still sufficiently related to pass.
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 The description gives a clear reason for the change: "fleets" were formerly called "teams", so three error messages now say "fleet" and "No team" now says "Unassigned". It states that tests asserting …
Full details: Description check

Explanation

The description gives a clear reason for the change: "fleets" were formerly called "teams", so three error messages now say "fleet" and "No team" now says "Unassigned". It states that tests asserting the old wording were updated. The changes file, input validation, automated tests, and manual QA items are checked, and a screenshot section is present. The AI section follows the template format. Gaps: the 'Related issue' line still shows the placeholder 'Resolves #' with no issue number. The description also does not name the specific error messages or the files changed. Several template sections (load testing, GitOps, Apple MDM, database migrations, fleetd) were left unaddressed, but these do not apply to a wording change, and the template allows non-applicable items to be deleted. The description is mostly complete.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 4 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@patrickrgr

Copy link
Copy Markdown
Contributor Author

I will get screenshots and attach later if needed.

@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 77.55%. Comparing base (dc2161d) to head (a2ba00f).

Files with missing lines Patch % Lines
server/fleet/datastore.go 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55072      +/-   ##
==========================================
+ Coverage   77.54%   77.55%   +0.01%     
==========================================
  Files        4347     4347              
  Lines      271675   271675              
  Branches    15961    16000      +39     
==========================================
+ Hits       210678   210707      +29     
+ Misses      60811    60783      -28     
+ Partials      186      185       -1     
Flag Coverage Δ
backend 78.76% <85.71%> (+0.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.

@lucasmrod

Copy link
Copy Markdown
Member

Thanks @patrickrgr! If possible please fix the failing test (now failing because of string comparison in the error)

@lucasmrod lucasmrod self-assigned this Oct 8, 2026
@sharon-fdm

Copy link
Copy Markdown
Collaborator

Thanks for the contribution, @patrickrgr!
We are converting this to draft while we review it through our community contribution process. We will follow up here once the review is complete.

@sharon-fdm
sharon-fdm marked this pull request as draft October 13, 2026 14:56
@lucasmrod
lucasmrod marked this pull request as ready for review October 23, 2026 11:24
Copilot AI balanced review requested due to automatic review settings October 23, 2026 11:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The terminology-only changes are consistent with the updated test assertions and introduce no identified correctness issues; tests were not executed.

No open issues 🎉

What changed in this PR

Updates secret-variable deletion errors to use Fleet’s current terminology without changing deletion logic.

Changes:

  • Replaces “team” with “fleet” in errors for scripts, host name templates, and configuration profiles.
  • Changes the unassigned-group label from “No team” to “Unassigned.”
  • Updates datastore and integration test expectations to match.
File Description
server/​service/​integration_core_secret_variables_test.go Updates expected user-facing deletion errors.
server/​fleet/​datastore.go Uses “fleet” in three secret-use error messages.
server/​datastore/​mysql/​secret_variables.go Uses “Unassigned” for missing team names.
server/​datastore/​mysql/​secret_variables_test.go Updates expected unassigned-group labels.

Review effort: Balanced

@lucasmrod
lucasmrod merged commit 5bbe205 into fleetdm:main Oct 23, 2026
49 of 50 checks passed
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.

Custom variable in-use error message says "team" and "No team" instead of "fleet" and "Unassigned"

4 participants