Skip to content

Wipe host cancels all upcoming activities - #44323

Merged
MagnusHJensen merged 15 commits into
mainfrom
mna-40459-wipe-host-cancels-upcoming-activities
May 1, 2026
Merged

Wipe host cancels all upcoming activities#44323
MagnusHJensen merged 15 commits into
mainfrom
mna-40459-wipe-host-cancels-upcoming-activities

Conversation

@mna

@mna mna commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Related issue: Resolves #40459

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

Recording: https://drive.google.com/file/d/1_XqLyy-oY-WnIa97R4t9HihiBq3Fui6n/view?usp=drive_link

Summary by CodeRabbit

  • New Features

    • Wiping a host now cancels all upcoming and queued activities for that host in a single, atomic operation to avoid intermediate activations.
  • Bug Fixes

    • Wipe response handling now distinguishes success vs failure and reliably cancels queued activities; datastore errors during host lookup or cancellation are surfaced.
    • Device lock/erase flows consistently update and propagate datastore errors.
  • Tests

    • Added integration and datastore tests validating wipe clears upcoming activities across macOS, Windows, Linux, and mixed-host scenarios.

@codecov

codecov Bot commented Apr 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 59.72222% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.75%. Comparing base (51dca83) to head (cf84b7a).
⚠️ Report is 123 commits behind head on main.

Files with missing lines Patch % Lines
server/datastore/mysql/activities.go 65.21% 5 Missing and 3 partials ⚠️
server/service/apple_mdm.go 45.45% 3 Missing and 3 partials ⚠️
server/service/microsoft_mdm.go 33.33% 2 Missing and 2 partials ⚠️
server/datastore/mysql/software_installers.go 0.00% 2 Missing and 1 partial ⚠️
pkg/mdm/mdmtest/apple.go 84.61% 1 Missing and 1 partial ⚠️
server/datastore/mysql/microsoft_mdm.go 80.00% 1 Missing and 1 partial ⚠️
server/datastore/mysql/scripts.go 0.00% 0 Missing and 2 partials ⚠️
server/service/orbit.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #44323      +/-   ##
==========================================
- Coverage   66.79%   66.75%   -0.04%     
==========================================
  Files        2630     2635       +5     
  Lines      211355   212423    +1068     
  Branches     9547     9547              
==========================================
+ Hits       141170   141813     +643     
- Misses      57359    57728     +369     
- Partials    12826    12882      +56     
Flag Coverage Δ
backend 68.53% <59.72%> (-0.05%) ⬇️

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.

Comment thread server/service/apple_mdm.go
Comment thread server/service/microsoft_mdm.go
Comment thread server/service/orbit.go
@mna
mna marked this pull request as ready for review April 29, 2026 14:37
@mna
mna requested a review from a team as a code owner April 29, 2026 14:37
Copilot AI review requested due to automatic review settings April 29, 2026 14:37
@qodo-code-review

Copy link
Copy Markdown
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one.

@coderabbitai

coderabbitai Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b10bbf15-6df3-42d0-bcd8-5d4f5faa19fd

📥 Commits

Reviewing files that changed from the base of the PR and between 8e43e57 and cf84b7a.

📒 Files selected for processing (2)
  • pkg/mdm/mdmtest/apple.go
  • server/service/integration_mdm_commands_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • server/service/integration_mdm_commands_test.go

Walkthrough

Adds a datastore batch operation to cancel all upcoming activities for a host and refactors the internal cancellation flow to suppress intermediate activations during multi-cancel operations. Introduces BatchCancelAllHostUpcomingActivities, an activateNext boolean parameter on the internal cancelHostUpcomingActivity helper, updates call sites to pass the flag, invokes batch cancellation when a host wipe is confirmed (Apple MDM, Windows MDM, Orbit), and adds tests and mock support for the batch-cancel behavior.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'Wipe host cancels all upcoming activities' clearly and concisely summarizes the main change—that wiping a host will now cancel pending activities—which is directly reflected throughout the changeset.
Description check ✅ Passed The PR description includes the related issue (#40459), completes the relevant checklist items (changes file, input validation, automated tests with host isolation, and manual QA), and provides a QA recording link.
Linked Issues check ✅ Passed The changes implement the core requirement from issue #40459: cancellation of all upcoming activities for a host when wiped via Fleet. The implementation covers all three platforms (macOS, Windows, Linux) and handles multiple activity types (scripts, software installs, VPP apps).
Out of Scope Changes check ✅ Passed All substantial code changes directly support the wipe-activity-cancellation objective: internal refactoring of cancelHostUpcomingActivity to support batch operations, new batch cancellation methods, platform-specific wipe handlers, and comprehensive test coverage align with the stated requirements.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 mna-40459-wipe-host-cancels-upcoming-activities

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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

♻️ Duplicate comments (1)
server/service/apple_mdm.go (1)

4111-4118: ⚠️ Potential issue | 🟠 Major

Don’t fail CommandAndReportResults on post-wipe activity cleanup.

BatchCancelAllHostUpcomingActivities aborts the whole transaction on the first cancel error, so a transient datastore failure here bubbles out after the device has already acknowledged EraseDevice. That leaves the wipe completed but the pre-wipe queue still intact—the exact state this PR is trying to eliminate. This cleanup should be decoupled from the MDM response path (best-effort with retry/logging, or an async follow-up) instead of returning the error directly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@server/service/apple_mdm.go` around lines 4111 - 4118, The post-wipe cleanup
currently runs inside CommandAndReportResults and returns any error from
svc.ds.BatchCancelAllHostUpcomingActivities (called after HostByIdentifier and
using cmdResult.Identifier()), which can fail and cause the whole MDM response
to be treated as failed; change this to best‑effort: after successfully finding
host with svc.ds.HostByIdentifier and calling
svc.ds.BatchCancelAllHostUpcomingActivities, do not return the error to the
caller—log the error with context (including host.ID and cmdResult.Identifier())
and schedule/trigger an async retry or background task for cancellation instead
of bubbling the error up; ensure CommandAndReportResults always returns success
for the EraseDevice acknowledgement path even if the cancellation step fails.
🧹 Nitpick comments (2)
server/datastore/mysql/software_installers.go (1)

840-842: Avoid intermediate activations while canceling multiple retries.

At Line 842, always passing activateNext=true can activate queue items mid-loop that are about to be canceled next. Prefer activating only on the last cancellation.

♻️ Proposed refactor
-		for _, execID := range executionIDs {
+		for i, execID := range executionIDs {
 			// TODO: pass activateNext: false until the last iteration to avoid
 			// activating activities that are about to be canceled.
-			if _, err := ds.cancelHostUpcomingActivity(ctx, tx, hostID, execID, true); err != nil {
+			activateNext := i == len(executionIDs)-1
+			if _, err := ds.cancelHostUpcomingActivity(ctx, tx, hostID, execID, activateNext); err != nil {
 				return ctxerr.Wrap(ctx, err, "cancel pending non-policy install retry")
 			}
 		}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@server/datastore/mysql/software_installers.go` around lines 840 - 842, The
call to cancelHostUpcomingActivity is always passing activateNext=true which can
prematurely activate queue items that will be canceled later; update the loop
that calls ds.cancelHostUpcomingActivity(ctx, tx, hostID, execID, true) so it
passes activateNext=false for all iterations except the final one (pass true
only for the last execID), i.e., detect the last iteration (by index or by
checking remaining items) and call ds.cancelHostUpcomingActivity(ctx, tx,
hostID, execID, false) for intermediate cancellations and
ds.cancelHostUpcomingActivity(ctx, tx, hostID, execID, true) for the final
cancellation.
server/service/integration_mdm_commands_test.go (1)

205-414: Consider extracting shared helpers for queue setup and post-wipe assertions.

These three tests repeat nearly identical enqueue/list/assert and post-wipe verification blocks; a helper would reduce drift and future maintenance.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@server/service/integration_mdm_commands_test.go` around lines 205 - 414,
Tests TestWipeMacOSCancelsUpcomingActivities,
TestWipeWindowsCancelsUpcomingActivities and
TestWipeLinuxCancelsUpcomingActivities duplicate the same enqueue/list/assert
and post-wipe verification logic; extract shared helpers to reduce duplication.
Add a helper like enqueueTwoScriptsAndAssertUpcoming(t, hostID) that performs
the two DoJSON POST /scripts/run calls and the GET
/hosts/{id}/activities/upcoming assertions (uses
listHostUpcomingActivitiesResponse and fleet.ActivityTypeRanScript), and another
helper assertHostWipedAndNoUpcoming(t, hostID) that performs the GET /hosts/{id}
MDM DeviceStatus/PendingAction checks and the final GET
/hosts/{id}/activities/upcoming empty assertion; for the Linux test keep a small
variant helper (enqueueScriptsBehindInFlightWipe) or call
enqueueTwoScriptsAndAssertUpcoming after you trigger the wipe so the order is
preserved. Replace the repeated blocks in
TestWipeMacOSCancelsUpcomingActivities, TestWipeWindowsCancelsUpcomingActivities
and TestWipeLinuxCancelsUpcomingActivities with these helpers and keep
test-specific MDM simulation code (mdmClient.Idle/Acknowledge, winMDMClient
responses, orbit script result) in each test.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@server/datastore/mysql/activities.go`:
- Around line 409-423: The bulk cancel must serialize the host's
upcoming_activities and must not activate the next activity from this path: wrap
the SELECT+loop in a host-level lock (e.g., acquire a row-level advisory lock or
SELECT ... FOR UPDATE on the host's queue) inside withRetryTxx so the snapshot
cannot change while iterating, and change the call to cancelHostUpcomingActivity
so activateNext is always false when invoked from this bulk-cancel path
(remove/ignore the i == len(execIDs)-1 logic); ensure cancelHostUpcomingActivity
still supports activation in its normal single-cancel callers but not when
invoked from this batch routine.

---

Duplicate comments:
In `@server/service/apple_mdm.go`:
- Around line 4111-4118: The post-wipe cleanup currently runs inside
CommandAndReportResults and returns any error from
svc.ds.BatchCancelAllHostUpcomingActivities (called after HostByIdentifier and
using cmdResult.Identifier()), which can fail and cause the whole MDM response
to be treated as failed; change this to best‑effort: after successfully finding
host with svc.ds.HostByIdentifier and calling
svc.ds.BatchCancelAllHostUpcomingActivities, do not return the error to the
caller—log the error with context (including host.ID and cmdResult.Identifier())
and schedule/trigger an async retry or background task for cancellation instead
of bubbling the error up; ensure CommandAndReportResults always returns success
for the EraseDevice acknowledgement path even if the cancellation step fails.

---

Nitpick comments:
In `@server/datastore/mysql/software_installers.go`:
- Around line 840-842: The call to cancelHostUpcomingActivity is always passing
activateNext=true which can prematurely activate queue items that will be
canceled later; update the loop that calls ds.cancelHostUpcomingActivity(ctx,
tx, hostID, execID, true) so it passes activateNext=false for all iterations
except the final one (pass true only for the last execID), i.e., detect the last
iteration (by index or by checking remaining items) and call
ds.cancelHostUpcomingActivity(ctx, tx, hostID, execID, false) for intermediate
cancellations and ds.cancelHostUpcomingActivity(ctx, tx, hostID, execID, true)
for the final cancellation.

In `@server/service/integration_mdm_commands_test.go`:
- Around line 205-414: Tests TestWipeMacOSCancelsUpcomingActivities,
TestWipeWindowsCancelsUpcomingActivities and
TestWipeLinuxCancelsUpcomingActivities duplicate the same enqueue/list/assert
and post-wipe verification logic; extract shared helpers to reduce duplication.
Add a helper like enqueueTwoScriptsAndAssertUpcoming(t, hostID) that performs
the two DoJSON POST /scripts/run calls and the GET
/hosts/{id}/activities/upcoming assertions (uses
listHostUpcomingActivitiesResponse and fleet.ActivityTypeRanScript), and another
helper assertHostWipedAndNoUpcoming(t, hostID) that performs the GET /hosts/{id}
MDM DeviceStatus/PendingAction checks and the final GET
/hosts/{id}/activities/upcoming empty assertion; for the Linux test keep a small
variant helper (enqueueScriptsBehindInFlightWipe) or call
enqueueTwoScriptsAndAssertUpcoming after you trigger the wipe so the order is
preserved. Replace the repeated blocks in
TestWipeMacOSCancelsUpcomingActivities, TestWipeWindowsCancelsUpcomingActivities
and TestWipeLinuxCancelsUpcomingActivities with these helpers and keep
test-specific MDM simulation code (mdmClient.Idle/Acknowledge, winMDMClient
responses, orbit script result) in each test.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 02c3feef-c3a7-48e0-b6b6-7a289f5fb5be

📥 Commits

Reviewing files that changed from the base of the PR and between 7aea2e3 and f645688.

⛔ Files ignored due to path filters (1)
  • articles/lock-wipe-hosts.md is excluded by !**/*.md
📒 Files selected for processing (14)
  • changes/40459-wipe-host-cancels-upcoming-activities
  • server/datastore/mysql/activities.go
  • server/datastore/mysql/activities_test.go
  • server/datastore/mysql/microsoft_mdm.go
  • server/datastore/mysql/scripts.go
  • server/datastore/mysql/software_installers.go
  • server/datastore/mysql/vpp_test.go
  • server/fleet/datastore.go
  • server/fleet/microsoft_mdm.go
  • server/mock/datastore_mock.go
  • server/service/apple_mdm.go
  • server/service/integration_mdm_commands_test.go
  • server/service/microsoft_mdm.go
  • server/service/orbit.go

Comment thread server/datastore/mysql/activities.go

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.

Pull request overview

Implements the “wipe host cancels all upcoming activities” behavior so that once a Fleet-initiated wipe succeeds, any queued/activated upcoming activities (scripts, software installs/uninstalls, etc.) for that host are silently canceled to prevent them from executing after re-enrollment.

Changes:

  • Add datastore support to cancel all upcoming activities for a host in one transaction (BatchCancelAllHostUpcomingActivities), including already-activated activities.
  • Trigger upcoming-activity cancellation when wipes succeed across macOS (Apple MDM), Windows (Windows MDM), and Linux (Orbit wipe script result).
  • Add integration + datastore tests to validate upcoming activities are cleared after wipe completion.

Reviewed changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
server/service/orbit.go Cancels upcoming activities after a successful Orbit-reported wipe script result.
server/service/microsoft_mdm.go Cancels upcoming activities after Windows MDM wipe success is detected.
server/service/apple_mdm.go Cancels upcoming activities after Apple MDM EraseDevice acknowledgement.
server/service/integration_mdm_commands_test.go Adds integration coverage for macOS/Windows/Linux wipe canceling upcoming activities.
server/datastore/mysql/activities.go Adds BatchCancelAllHostUpcomingActivities and activateNext flag to internal cancellation helper.
server/datastore/mysql/activities_test.go Adds unit test verifying batch cancellation for multiple activity types and hosts.
server/fleet/datastore.go Extends fleet.Datastore interface with BatchCancelAllHostUpcomingActivities.
server/mock/datastore_mock.go Updates datastore mock to implement the new interface method.
server/fleet/microsoft_mdm.go Extends Windows MDM save-response result struct with WipeSucceeded.
server/datastore/mysql/microsoft_mdm.go Emits WipeSucceeded result when a wipe response is successfully processed.
server/datastore/mysql/scripts.go Updates internal cancellation call sites for new activateNext signature.
server/datastore/mysql/software_installers.go Updates internal cancellation call site for new activateNext signature.
server/datastore/mysql/vpp_test.go Updates direct calls to cancelHostUpcomingActivity with new activateNext argument.
changes/40459-wipe-host-cancels-upcoming-activities Release note for user-visible wipe behavior change.
articles/lock-wipe-hosts.md Documents that wipe silently cancels upcoming activities without adding canceled-history entries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread server/service/orbit.go
Comment thread server/service/microsoft_mdm.go
Comment thread server/service/apple_mdm.go Outdated

@coderabbitai coderabbitai Bot 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.

♻️ Duplicate comments (1)
server/datastore/mysql/activities.go (1)

417-423: ⚠️ Potential issue | 🟠 Major

Avoid re-activating work from wipe batch-cancel path.

Line 422/Line 423 can still activate a “late” queued activity in a wipe flow. For wipe semantics, batch cancel should not activate next activity at all.

Suggested change
-			activateNext := i == len(execIDs)-1
+			activateNext := false
 			details, err := ds.cancelHostUpcomingActivity(ctx, tx, hostID, execID, activateNext)
#!/bin/bash
# Verify whether any enqueue paths can still add upcoming activities after wipe states,
# and confirm current call sites of BatchCancelAllHostUpcomingActivities.

set -euo pipefail

echo "== Call sites of BatchCancelAllHostUpcomingActivities =="
rg -nP --type=go '\bBatchCancelAllHostUpcomingActivities\s*\(' -C2

echo
echo "== Insert paths into upcoming_activities =="
rg -nP --type=go 'INSERT\s+INTO\s+upcoming_activities' -C6

echo
echo "== Wipe-state guards near enqueue-related code =="
rg -nP --type=go '\b(PendingActionWipe|DeviceStatusWiped|WellKnownActionWipe)\b' -C3
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@server/datastore/mysql/activities.go` around lines 417 - 423, The loop in
BatchCancelAllHostUpcomingActivities currently computes activateNext := i ==
len(execIDs)-1 and passes it into ds.cancelHostUpcomingActivity, which can
re-activate a late queued activity during a wipe; change the logic to never
activate the next activity in this wipe batch-cancel path by always passing
false (e.g., set activateNext := false or inline false) when calling
ds.cancelHostUpcomingActivity in the execIDs loop so
BatchCancelAllHostUpcomingActivities never re-activates work.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@server/datastore/mysql/activities.go`:
- Around line 417-423: The loop in BatchCancelAllHostUpcomingActivities
currently computes activateNext := i == len(execIDs)-1 and passes it into
ds.cancelHostUpcomingActivity, which can re-activate a late queued activity
during a wipe; change the logic to never activate the next activity in this wipe
batch-cancel path by always passing false (e.g., set activateNext := false or
inline false) when calling ds.cancelHostUpcomingActivity in the execIDs loop so
BatchCancelAllHostUpcomingActivities never re-activates work.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f6b7f49b-33b9-46db-ae13-4aa90074f993

📥 Commits

Reviewing files that changed from the base of the PR and between f645688 and 8b99497.

📒 Files selected for processing (1)
  • server/datastore/mysql/activities.go

Comment thread articles/lock-wipe-hosts.md Outdated
Comment thread server/datastore/mysql/software_installers.go Outdated
Comment thread server/service/apple_mdm.go
@MagnusHJensen

Copy link
Copy Markdown
Member

@JordanMontgomery Let me know if you want me to pick up any changes here

@JordanMontgomery

Copy link
Copy Markdown
Member

@JordanMontgomery Let me know if you want me to pick up any changes here

@MagnusHJensen yeah if you don't mind. I assigned it to me just to make suer it keeps moving. If you wanna grab it and help move it the rest of the way that'd be great and I can review

@MagnusHJensen

Copy link
Copy Markdown
Member

@JordanMontgomery I'll do that, maybe if you have time to just comment back on my one question regarding Apple wipe, and also triggering this behaviour on error, since we know it will always wipe, obliterate or not.

I'll pick this up, and do some final changes, but it's looking pretty good.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@server/service/apple_mdm.go`:
- Around line 4112-4119: The EraseDevice branch currently cancels upcoming
activities whenever the command result is succeeded or errored, which
incorrectly cancels work for user-enrolled devices where EraseDevice always
fails; change the logic around svc.ds.BatchCancelAllHostUpcomingActivities so
you only cancel when a wipe truly occurred or was attempted: fetch the host via
svc.ds.HostByIdentifier(r.Context, cmdResult.Identifier()) and then either (A)
skip cancellation if the host is user-enrolled (inspect Host.EnrollmentType or a
boolean like Host.IsUserEnrolled) or (B) only cancel when
UpdateHostLockWipeStatusFromAppleMDMResult (or error chain inspection using
errors.Is/As) signals a concrete wipe attempt/terminal wipe state (introduce or
use a sentinel error or specific status value) before calling
svc.ds.BatchCancelAllHostUpcomingActivities; adjust EraseDevice handling
accordingly so false-positive cancellations are avoided.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d0637269-6874-4181-a736-7c37dd835d84

📥 Commits

Reviewing files that changed from the base of the PR and between 8b99497 and fc27293.

📒 Files selected for processing (2)
  • server/datastore/mysql/software_installers.go
  • server/service/apple_mdm.go

Comment thread server/service/apple_mdm.go Outdated
@MagnusHJensen
MagnusHJensen removed the request for review from mike-j-thomas May 1, 2026 15:55
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

CI Feedback 🧐

A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

Action: test-go (fleetctl, mysql:8.0.44) / test

Failed stage: Run Go Tests [❌]

Failed test name: TestIntegrationsVulnerabilityDataStream

Failure summary:

The action failed because the Go integration test TestIntegrationsVulnerabilityDataStream failed in
cmd/fleetctl/integrationtest/vuln due to network timeouts when downloading Ubuntu OVAL vulnerability
definitions.
- The test repeatedly failed to fetch
https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2 with dial tcp
...:443: i/o timeout and net/http: TLS handshake timeout.
- The error was raised at
cmd/fleetctl/integrationtest/vuln/vulnerability_data_stream_test.go:44 (Error downloading Oval
definitions... i/o timeout), causing make test-go to exit non-zero (Makefile:278 -> Makefile:393,
exit code 2).

Relevant error logs:
1:  ##[group]Runner Image Provisioner
2:  Hosted Compute Agent
...

1828:  �[36;1mattempt=1�[0m
1829:  �[36;1m�[0m
1830:  �[36;1mwhile [ $attempt -le $max_attempts ]; do�[0m
1831:  �[36;1m  echo "Attempt $attempt of $max_attempts"�[0m
1832:  �[36;1m�[0m
1833:  �[36;1m  # Try to connect to MySQL�[0m
1834:  �[36;1m  if wait_for_mysql "mysql_test"; then�[0m
1835:  �[36;1m    # If MySQL is ready, try to connect to MySQL replica�[0m
1836:  �[36;1m    if wait_for_mysql "mysql_replica_test"; then�[0m
1837:  �[36;1m      # Both are ready, we're done�[0m
1838:  �[36;1m      echo "All MySQL connections successful"�[0m
1839:  �[36;1m      exit 0�[0m
1840:  �[36;1m    fi�[0m
1841:  �[36;1m  fi�[0m
1842:  �[36;1m�[0m
1843:  �[36;1m  # If we get here, at least one connection failed�[0m
1844:  �[36;1m  echo "Failed to connect to MySQL on attempt $attempt"�[0m
1845:  �[36;1m�[0m
1846:  �[36;1m  if [ $attempt -lt $max_attempts ]; then�[0m
1847:  �[36;1m    echo "Restarting containers and trying again..."�[0m
1848:  �[36;1m    restart_containers�[0m
1849:  �[36;1m  else�[0m
1850:  �[36;1m    echo "Maximum attempts reached. Failing the job."�[0m
1851:  �[36;1m    exit 1�[0m
...

1918:  gotestsum --format=testdox --jsonfile=/tmp/test-output.json -- -tags full,fts5,netgo -run=  -v -race=false -timeout=20m  -parallel 8 -coverprofile=coverage.txt -covermode=atomic -coverpkg=github.com/fleetdm/fleet/v4/... ././cmd/fleetctl/... 
1919:  go: downloading github.com/stretchr/testify v1.11.1
1920:  go: downloading github.com/urfave/cli/v2 v2.27.7
1921:  go: downloading github.com/go-git/go-git/v5 v5.18.0
1922:  go: downloading github.com/beevik/etree v1.6.0
1923:  go: downloading github.com/briandowns/spinner v1.23.1
1924:  go: downloading github.com/google/go-github/v37 v37.0.0
1925:  go: downloading github.com/gosuri/uilive v0.0.4
1926:  go: downloading github.com/manifoldco/promptui v0.9.0
1927:  go: downloading github.com/mitchellh/go-ps v1.0.0
1928:  go: downloading github.com/olekukonko/tablewriter v0.0.5
1929:  go: downloading github.com/sethvargo/go-password v0.3.0
1930:  go: downloading github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
1931:  go: downloading github.com/AbGuthrie/goquery/v2 v2.0.1
1932:  go: downloading github.com/patrickmn/go-cache v2.1.0+incompatible
1933:  go: downloading github.com/hashicorp/go-multierror v1.1.1
1934:  go: downloading github.com/VividCortex/mysqlerr v0.0.0-20170204212430-6c6b55f8796f
...

2183:  �[32m✓�[0m Apply specs deprecated keys app config windows updates.grace period days not a number (0.42s)
2184:  �[32m✓�[0m Apply specs deprecated keys app config windows updates.grace period days out of range (0.35s)
2185:  �[32m✓�[0m Apply specs deprecated keys config with FIM values for agent options (#869 9) (0.41s)
2186:  �[32m✓�[0m Apply specs deprecated keys config with blank required org name (0.35s)
2187:  �[32m✓�[0m Apply specs deprecated keys config with blank required server url (0.44s)
2188:  �[32m✓�[0m Apply specs deprecated keys config with invalid agent options command-line flags (0.52s)
2189:  �[32m✓�[0m Apply specs deprecated keys config with invalid agent options data type in dry-run (0.74s)
2190:  �[32m✓�[0m Apply specs deprecated keys config with invalid agent options data type with force (0.50s)
2191:  �[32m✓�[0m Apply specs deprecated keys config with invalid agent options in dry-run (0.50s)
2192:  �[32m✓�[0m Apply specs deprecated keys config with invalid key type (0.47s)
2193:  �[32m✓�[0m Apply specs deprecated keys config with invalid value for agent options command-line flags (0.36s)
2194:  �[32m✓�[0m Apply specs deprecated keys config with unknown key (0.42s)
2195:  �[32m✓�[0m Apply specs deprecated keys config with valid agent options command-line flags (0.40s)
2196:  �[32m✓�[0m Apply specs deprecated keys dry-run set with unsupported spec (0.80s)
2197:  �[32m✓�[0m Apply specs deprecated keys dry-run set with various specs, appconfig warning for legacy (0.56s)
2198:  �[32m✓�[0m Apply specs deprecated keys dry-run set with various specs, no errors (0.59s)
2199:  �[32m✓�[0m Apply specs deprecated keys empty config (0.40s)
...

2202:  �[32m✓�[0m Apply specs deprecated keys invalid agent options dry-run (0.46s)
2203:  �[32m✓�[0m Apply specs deprecated keys invalid agent options field type (0.38s)
2204:  �[32m✓�[0m Apply specs deprecated keys invalid agent options field type in overrides (0.60s)
2205:  �[32m✓�[0m Apply specs deprecated keys invalid agent options for existing team (0.49s)
2206:  �[32m✓�[0m Apply specs deprecated keys invalid agent options for new team (0.51s)
2207:  �[32m✓�[0m Apply specs deprecated keys invalid agent options force (0.41s)
2208:  �[32m✓�[0m Apply specs deprecated keys invalid known key's value type for team cannot be forced (0.45s)
2209:  �[32m✓�[0m Apply specs deprecated keys invalid team agent options command-line flag (0.54s)
2210:  �[32m✓�[0m Apply specs deprecated keys invalid top-level key for team (0.75s)
2211:  �[32m✓�[0m Apply specs deprecated keys macos updates deadline set but minimum version empty (0.53s)
2212:  �[32m✓�[0m Apply specs deprecated keys macos updates minimum version set but deadline empty (0.72s)
2213:  �[32m✓�[0m Apply specs deprecated keys macos updates.deadline with incomplete date (0.60s)
2214:  �[32m✓�[0m Apply specs deprecated keys macos updates.deadline with invalid date (0.68s)
2215:  �[32m✓�[0m Apply specs deprecated keys macos updates.deadline with timestamp (0.51s)
2216:  �[32m✓�[0m Apply specs deprecated keys macos updates.minimum version with build version (0.78s)
2217:  �[32m✓�[0m Apply specs deprecated keys missing required failing policies destination url (0.70s)
2218:  �[32m✓�[0m Apply specs deprecated keys missing required host status days count (0.42s)
...

2226:  �[32m✓�[0m Apply specs deprecated keys team config macos settings.enable disk encryption true (0.54s)
2227:  �[32m✓�[0m Apply specs deprecated keys team config macos settings.enable disk encryption with invalid value type (0.46s)
2228:  �[32m✓�[0m Apply specs deprecated keys team config macos settings.enable disk encryption without a value (0.46s)
2229:  �[32m✓�[0m Apply specs deprecated keys unknown key for team can be forced (0.44s)
2230:  �[32m✓�[0m Apply specs deprecated keys valid team agent options command-line flag (0.39s)
2231:  �[32m✓�[0m Apply specs deprecated keys windows updates unset valid (0.40s)
2232:  �[32m✓�[0m Apply specs deprecated keys windows updates valid (0.43s)
2233:  �[32m✓�[0m Apply specs deprecated keys windows updates.deadline days but grace period empty (0.51s)
2234:  �[32m✓�[0m Apply specs deprecated keys windows updates.deadline days not a number (0.46s)
2235:  �[32m✓�[0m Apply specs deprecated keys windows updates.deadline days out of range (0.45s)
2236:  �[32m✓�[0m Apply specs deprecated keys windows updates.grace period days but deadline empty (0.44s)
2237:  �[32m✓�[0m Apply specs deprecated keys windows updates.grace period days not a number (0.37s)
2238:  �[32m✓�[0m Apply specs deprecated keys windows updates.grace period days out of range (0.58s)
2239:  �[32m✓�[0m Apply specs dry-run set with unsupported spec (0.45s)
2240:  �[32m✓�[0m Apply specs dry-run set with various specs, appconfig warning for legacy (0.45s)
2241:  �[32m✓�[0m Apply specs dry-run set with various specs, no errors (0.41s)
2242:  �[32m✓�[0m Apply specs empty config (0.34s)
...

2245:  �[32m✓�[0m Apply specs invalid agent options dry-run (0.41s)
2246:  �[32m✓�[0m Apply specs invalid agent options field type (0.47s)
2247:  �[32m✓�[0m Apply specs invalid agent options field type in overrides (0.57s)
2248:  �[32m✓�[0m Apply specs invalid agent options for existing team (0.38s)
2249:  �[32m✓�[0m Apply specs invalid agent options for new team (0.47s)
2250:  �[32m✓�[0m Apply specs invalid agent options force (0.39s)
2251:  �[32m✓�[0m Apply specs invalid known key's value type for team cannot be forced (0.47s)
2252:  �[32m✓�[0m Apply specs invalid team agent options command-line flag (0.39s)
2253:  �[32m✓�[0m Apply specs invalid top-level key for team (0.41s)
2254:  �[32m✓�[0m Apply specs macos updates deadline set but minimum version empty (0.46s)
2255:  �[32m✓�[0m Apply specs macos updates minimum version set but deadline empty (0.45s)
2256:  �[32m✓�[0m Apply specs macos updates.deadline with incomplete date (0.38s)
2257:  �[32m✓�[0m Apply specs macos updates.deadline with invalid date (0.36s)
2258:  �[32m✓�[0m Apply specs macos updates.deadline with timestamp (0.43s)
2259:  �[32m✓�[0m Apply specs macos updates.minimum version with build version (0.49s)
2260:  �[32m✓�[0m Apply specs missing required failing policies destination url (0.40s)
2261:  �[32m✓�[0m Apply specs missing required host status days count (0.43s)
...

2347:  �[32m✓�[0m Filename functions (0.00s)
2348:  �[32m✓�[0m Filename functions outfile name builds a file name using the name provided + current time (0.00s)
2349:  �[32m✓�[0m Filename functions outfile name with ext builds a file name using the name and extension provided + current time (0.00s)
2350:  �[32m✓�[0m FleetctlUpgradePacks empty packs (0.41s)
2351:  �[32m✓�[0m FleetctlUpgradePacks no pack (0.37s)
2352:  �[32m✓�[0m FleetctlUpgradePacks non empty (0.38s)
2353:  �[32m✓�[0m FleetctlUpgradePacks not admin (0.53s)
2354:  �[32m✓�[0m Format XML (0.00s)
2355:  �[32m✓�[0m Format XML XML with attributes (0.00s)
2356:  �[32m✓�[0m Format XML basic XML (0.00s)
2357:  �[32m✓�[0m Format XML empty XML (0.00s)
2358:  �[32m✓�[0m Format XML invalid XML (0.00s)
2359:  �[32m✓�[0m Format XML nested XML (0.00s)
2360:  �[32m✓�[0m Generate MDM apple (0.79s)
2361:  �[32m✓�[0m Generate MDM apple BM (0.45s)
2362:  �[32m✓�[0m Generate MDM apple CSR API call fails (0.42s)
2363:  �[32m✓�[0m Generate MDM apple successful run (0.37s)
2364:  �[32m✓�[0m Generate MDMVPP tokens (0.00s)
2365:  �[32m✓�[0m Generate MDMVPP tokens get VPP tokens error (0.00s)
2366:  �[32m✓�[0m Generate MDMVPP tokens multiple tokens with different teams (0.00s)
...

2378:  �[32m✓�[0m Generate org settings insecure (0.00s)
2379:  �[32m✓�[0m Generate org settings masked google calendar api key (0.00s)
2380:  �[32m✓�[0m Generate policies (0.00s)
2381:  �[32m✓�[0m Generate queries (0.00s)
2382:  �[32m✓�[0m Generate software (0.00s)
2383:  �[32m✓�[0m Generate software auto update schedule (0.00s)
2384:  �[32m✓�[0m Generate software script packages (0.00s)
2385:  �[32m✓�[0m Generate team settings (0.00s)
2386:  �[32m✓�[0m Generate team settings insecure (0.00s)
2387:  �[32m✓�[0m Generated org settings no SSO (0.00s)
2388:  �[32m✓�[0m Generated org settings okta conditional access not included (0.00s)
2389:  �[32m✓�[0m Get MDM command results (0.44s)
2390:  �[32m✓�[0m Get MDM command results command flag required (0.00s)
2391:  �[32m✓�[0m Get MDM command results command not found (0.01s)
2392:  �[32m✓�[0m Get MDM command results command results empty (0.01s)
2393:  �[32m✓�[0m Get MDM command results command results error (0.01s)
2394:  �[32m✓�[0m Get MDM command results darwin command results (0.00s)
2395:  �[32m✓�[0m Get MDM command results host specific results (0.00s)
2396:  �[32m✓�[0m Get MDM command results windows command results (0.00s)
2397:  �[32m✓�[0m Get MDM commands (0.47s)
2398:  �[32m✓�[0m Get apple BM (1.84s)
2399:  �[32m✓�[0m Get apple BM free license (0.51s)
2400:  �[32m✓�[0m Get apple BM premium license, multiple tokens (0.36s)
2401:  �[32m✓�[0m Get apple BM premium license, no token (0.51s)
2402:  �[32m✓�[0m Get apple BM premium license, single token (0.46s)
2403:  �[32m✓�[0m Get apple MDM (0.47s)
2404:  �[32m✓�[0m Get carve (0.50s)
2405:  �[32m✓�[0m Get carve with error (0.40s)
2406:  �[32m✓�[0m Get carves (0.35s)
...

2432:  �[32m✓�[0m Get queries as observer (0.36s)
2433:  �[32m✓�[0m Get queries as observer global observer (0.01s)
2434:  �[32m✓�[0m Get queries as observer observer of multiple teams (0.01s)
2435:  �[32m✓�[0m Get queries as observer team observer (0.01s)
2436:  �[32m✓�[0m Get query (0.45s)
2437:  �[32m✓�[0m Get software titles (0.39s)
2438:  �[32m✓�[0m Get software versions (0.46s)
2439:  �[32m✓�[0m Get teams (0.84s)
2440:  �[32m✓�[0m Get teams YAML and apply (0.41s)
2441:  �[32m✓�[0m Get teams by name (0.49s)
2442:  �[32m✓�[0m Get teams expired license (0.47s)
2443:  �[32m✓�[0m Get teams not expired license (0.38s)
2444:  �[32m✓�[0m Get user roles (0.33s)
2445:  �[32m✓�[0m Git ops ABM (5.18s)
2446:  �[32m✓�[0m Git ops ABM backwards compat (0.59s)
2447:  �[32m✓�[0m Git ops ABM both keys errors (0.38s)
2448:  �[32m✓�[0m Git ops ABM deprecated config with two tokens in the db fails (0.42s)
2449:  �[32m✓�[0m Git ops ABM new key all valid (0.61s)
2450:  �[32m✓�[0m Git ops ABM new key multiple elements (0.72s)
2451:  �[32m✓�[0m Git ops ABM no team is supported (0.45s)
2452:  �[32m✓�[0m Git ops ABM non existent org name fails (0.52s)
2453:  �[32m✓�[0m Git ops ABM not provided teams defaults to no team (0.47s)
2454:  �[32m✓�[0m Git ops ABM renamed new key all valid (0.56s)
2455:  �[32m✓�[0m Git ops ABM using an undefined team errors (0.47s)
2456:  �[32m✓�[0m Git ops EULA setting (4.39s)
...

2459:  �[32m✓�[0m Git ops EULA setting not a PDF file (0.56s)
2460:  �[32m✓�[0m Git ops EULA setting relative path to working dir to pdf file (no existing EULA uploaded) (0.46s)
2461:  �[32m✓�[0m Git ops EULA setting relative path to yaml file to pdf file (no existing EULA uploaded) (0.68s)
2462:  �[32m✓�[0m Git ops EULA setting uploading the same EULA again (0.51s)
2463:  �[32m✓�[0m Git ops EULA setting valid new pdf file (different EULA already uploaded) (0.52s)
2464:  �[32m✓�[0m Git ops EULA setting valid pdf file (no existing EULA uploaded) (0.49s)
2465:  �[32m✓�[0m Git ops MDM auth settings (0.43s)
2466:  �[32m✓�[0m Git ops SMTP settings (0.41s)
2467:  �[32m✓�[0m Git ops SSO server URL (0.53s)
2468:  �[32m✓�[0m Git ops SSO settings (0.45s)
2469:  �[32m✓�[0m Git ops android certificates add (0.64s)
2470:  �[32m✓�[0m Git ops android certificates change (0.44s)
2471:  �[32m✓�[0m Git ops android certificates delete all (0.52s)
2472:  �[32m✓�[0m Git ops android certificates delete one (0.69s)
2473:  �[32m✓�[0m Git ops app store app auto update (0.53s)
2474:  �[32m✓�[0m Git ops app store app auto update invalid auto-update window triggers error and does not call update software title auto update config (0.02s)
2475:  �[32m✓�[0m Git ops app store app auto update no auto update settings and no existing schedule does not call update software title auto update config (0.02s)
...

2478:  �[32m✓�[0m Git ops apple OS updates (0.70s)
2479:  �[32m✓�[0m Git ops apple OS updates ios updates (0.05s)
2480:  �[32m✓�[0m Git ops apple OS updates ios updates changed deadline triggers bulk set pending MDM host profiles (0.01s)
2481:  �[32m✓�[0m Git ops apple OS updates ios updates changed minimum version triggers bulk set pending MDM host profiles (0.01s)
2482:  �[32m✓�[0m Git ops apple OS updates ios updates same values do not trigger bulk set pending MDM host profiles (0.02s)
2483:  �[32m✓�[0m Git ops apple OS updates ipados updates (0.05s)
2484:  �[32m✓�[0m Git ops apple OS updates ipados updates changed deadline triggers bulk set pending MDM host profiles (0.01s)
2485:  �[32m✓�[0m Git ops apple OS updates ipados updates changed minimum version triggers bulk set pending MDM host profiles (0.01s)
2486:  �[32m✓�[0m Git ops apple OS updates ipados updates same values do not trigger bulk set pending MDM host profiles (0.02s)
2487:  �[32m✓�[0m Git ops apple OS updates macos updates (0.05s)
2488:  �[32m✓�[0m Git ops apple OS updates macos updates changed deadline triggers bulk set pending MDM host profiles (0.01s)
2489:  �[32m✓�[0m Git ops apple OS updates macos updates changed minimum version triggers bulk set pending MDM host profiles (0.01s)
2490:  �[32m✓�[0m Git ops apple OS updates macos updates same values do not trigger bulk set pending MDM host profiles (0.02s)
2491:  �[32m✓�[0m Git ops basic global and no team (0.62s)
2492:  �[32m✓�[0m Git ops basic global and no team basic global and no-team.yml (0.05s)
2493:  �[32m✓�[0m Git ops basic global and no team both global and no-team.yml define controls -- should fail (0.01s)
2494:  �[32m✓�[0m Git ops basic global and no team controls only defined in no-team.yml (0.05s)
2495:  �[32m✓�[0m Git ops basic global and no team global DOES NOT define controls -- should fail (0.01s)
2496:  �[32m✓�[0m Git ops basic global and no team global and no-team.yml DO NOT define controls -- should fail (0.02s)
2497:  �[32m✓�[0m Git ops basic global and no team global defines software -- should fail (0.01s)
2498:  �[32m✓�[0m Git ops basic global and no team no-team provided without global -- should fail (0.01s)
2499:  �[32m✓�[0m Git ops basic global and no team no-team.yml defines policy with calendar events enabled -- should fail (0.01s)
2500:  �[32m✓�[0m Git ops basic global and no team unassigned provided without global -- should fail (0.01s)
2501:  �[32m✓�[0m Git ops basic global and team (0.60s)
...

2506:  �[32m✓�[0m Git ops custom settings global macos custom settings valid deprecated.yml (0.68s)
2507:  �[32m✓�[0m Git ops custom settings global macos windows custom settings valid.yml (0.53s)
2508:  �[32m✓�[0m Git ops custom settings global windows custom settings invalid label mix 2 .yml (0.54s)
2509:  �[32m✓�[0m Git ops custom settings global windows custom settings invalid label mix.yml (0.51s)
2510:  �[32m✓�[0m Git ops custom settings global windows custom settings unknown label.yml (0.52s)
2511:  �[32m✓�[0m Git ops custom settings team macos custom settings valid deprecated.yml (0.47s)
2512:  �[32m✓�[0m Git ops custom settings team macos windows custom settings invalid labels mix 2 .yml (0.69s)
2513:  �[32m✓�[0m Git ops custom settings team macos windows custom settings invalid labels mix.yml (0.38s)
2514:  �[32m✓�[0m Git ops custom settings team macos windows custom settings unknown label.yml (0.49s)
2515:  �[32m✓�[0m Git ops custom settings team macos windows custom settings valid.yml (0.41s)
2516:  �[32m✓�[0m Git ops exception enforcement (0.38s)
2517:  �[32m✓�[0m Git ops exception enforcement free tier (0.43s)
2518:  �[32m✓�[0m Git ops exceptions preserve omitted keys (0.39s)
2519:  �[32m✓�[0m Git ops features (0.56s)
2520:  �[32m✓�[0m Git ops filename validation (0.00s)
2521:  �[32m✓�[0m Git ops fleet failing policies webhook policy IDs (0.52s)
2522:  �[32m✓�[0m Git ops fleet webhooks and tickets enabled (0.50s)
...

2677:  �[32m✓�[0m Run api command get scripts full path missing (0.00s)
2678:  �[32m✓�[0m Run api command get scripts team (0.00s)
2679:  �[32m✓�[0m Run api command get scripts team no cache (0.00s)
2680:  �[32m✓�[0m Run api command get typo (0.00s)
2681:  �[32m✓�[0m Run api command upload script (0.00s)
2682:  �[32m✓�[0m Run script command (0.55s)
2683:  �[32m✓�[0m Run script command disabled scripts globally (0.00s)
2684:  �[32m✓�[0m Run script command host not found (0.00s)
2685:  �[32m✓�[0m Run script command invalid file type (0.00s)
2686:  �[32m✓�[0m Run script command invalid hashbang (0.00s)
2687:  �[32m✓�[0m Run script command invalid utf 8 (0.01s)
2688:  �[32m✓�[0m Run script command missing one of script-path and script-nqme (0.01s)
2689:  �[32m✓�[0m Run script command output truncated (0.01s)
2690:  �[32m✓�[0m Run script command posix shell hashbang (0.01s)
2691:  �[32m✓�[0m Run script command script empty (0.00s)
2692:  �[32m✓�[0m Run script command script failed (0.01s)
2693:  �[32m✓�[0m Run script command script killed (0.01s)
...

2729:  �[32m✓�[0m User create force password reset (0.51s)
2730:  �[32m✓�[0m User delete (0.43s)
2731:  �[32m✓�[0m User is observer (0.00s)
2732:  �[32m✓�[0m User is observer global maintainer (0.00s)
2733:  �[32m✓�[0m User is observer global observer (0.00s)
2734:  �[32m✓�[0m User is observer global observer+ (0.00s)
2735:  �[32m✓�[0m User is observer team maintainer (0.00s)
2736:  �[32m✓�[0m User is observer team observer (0.00s)
2737:  �[32m✓�[0m User is observer team observer and maintainer (0.00s)
2738:  �[32m✓�[0m User is observer team observer+ (0.00s)
2739:  �[32m✓�[0m User is observer user without roles (0.00s)
2740:  github.com/fleetdm/fleet/v4/cmd/fleetctl/integrationtest/vuln:
2741:  �[31m✖�[0m Integrations vulnerability data stream (348.80s)
2742:  github.com/fleetdm/fleet/v4/cmd/fleetctl/integrationtest/preview:
2743:  �[32m✓�[0m Integrations preview (403.12s)
2744:  �[32m✓�[0m Preview fails on invalid license key (0.00s)
2745:  github.com/fleetdm/fleet/v4/cmd/fleetctl/integrationtest/gitops:
2746:  �[32m✓�[0m Git ops VPP (4.44s)
2747:  �[32m✓�[0m Git ops VPP all teams is supported (0.63s)
2748:  �[32m✓�[0m Git ops VPP new key all valid (0.74s)
2749:  �[32m✓�[0m Git ops VPP new key multiple elements (0.64s)
2750:  �[32m✓�[0m Git ops VPP no team is supported (0.58s)
2751:  �[32m✓�[0m Git ops VPP non existent location fails (0.57s)
2752:  �[32m✓�[0m Git ops VPP not provided teams defaults to no team (0.69s)
2753:  �[32m✓�[0m Git ops VPP using an undefined team errors (0.59s)
2754:  �[32m✓�[0m Git ops existing team VPP apps with missing team (0.51s)
...

2834:  �[32m✓�[0m Git ops team software installers team software installer with display name.yml (1.42s)
2835:  �[32m✓�[0m Integrations enterprise gitops (305.20s)
2836:  �[32m✓�[0m Integrations enterprise gitops test CA integrations (4.07s)
2837:  �[32m✓�[0m Integrations enterprise gitops test FMA labels include all (6.78s)
2838:  �[32m✓�[0m Integrations enterprise gitops test IPA software installers (9.60s)
2839:  �[32m✓�[0m Integrations enterprise gitops test JSON configuration profile escaping (1.40s)
2840:  �[32m✓�[0m Integrations enterprise gitops test add manual labels (1.87s)
2841:  �[32m✓�[0m Integrations enterprise gitops test configuration profile escaping (1.58s)
2842:  �[32m✓�[0m Integrations enterprise gitops test delete CA with certificate templates (6.63s)
2843:  �[32m✓�[0m Integrations enterprise gitops test delete mac OS setup (5.91s)
2844:  �[32m✓�[0m Integrations enterprise gitops test deleting no team YAML (2.24s)
2845:  �[32m✓�[0m Integrations enterprise gitops test disallow software setup experience (124.65s)
2846:  �[32m✓�[0m Integrations enterprise gitops test disallow software setup experience all VPP with setup experience (1.45s)
2847:  �[32m✓�[0m Integrations enterprise gitops test disallow software setup experience no team VPP (1.26s)
2848:  �[32m✓�[0m Integrations enterprise gitops test disallow software setup experience no team installers (60.82s)
2849:  �[32m✓�[0m Integrations enterprise gitops test disallow software setup experience packages fail (60.92s)
2850:  �[32m✓�[0m Integrations enterprise gitops test env substitution in profiles (1.49s)
...

2872:  �[32m✓�[0m Integrations enterprise gitops test omitted top level keys global (2.72s)
2873:  �[32m✓�[0m Integrations enterprise gitops test remove custom settings from default YAML (2.91s)
2874:  �[32m✓�[0m Integrations enterprise gitops test special case teams VPP apps (4.30s)
2875:  �[32m✓�[0m Integrations enterprise gitops test special case teams VPP apps all teams (2.70s)
2876:  �[32m✓�[0m Integrations enterprise gitops test special case teams VPP apps no team (1.43s)
2877:  �[32m✓�[0m Integrations enterprise gitops test unset configuration profile labels (5.52s)
2878:  �[32m✓�[0m Integrations enterprise gitops test unset software installer labels (9.29s)
2879:  �[32m✓�[0m Integrations enterprise starter library (5.06s)
2880:  �[32m✓�[0m Integrations enterprise starter library test apply starter library premium (3.72s)
2881:  �[32m✓�[0m Integrations gitops (2.37s)
2882:  �[32m✓�[0m Integrations gitops test fleet gitops (0.52s)
2883:  �[32m✓�[0m Integrations gitops test fleet gitops DDM fleet vars requires premium (0.16s)
2884:  �[32m✓�[0m Integrations gitops test fleet gitops with fleet secrets (0.38s)
2885:  �[32m✓�[0m Integrations starter library (1.57s)
2886:  �[32m✓�[0m Integrations starter library test apply starter library free (0.26s)
2887:  === �[31mFailed�[0m
2888:  === �[31mFAIL�[0m: cmd/fleetctl/integrationtest/vuln TestIntegrationsVulnerabilityDataStream (348.80s)
2889:  nettest.go:33: network test start: TestIntegrationsVulnerabilityDataStream
2890:  Download failed on https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2": dial tcp 185.125.190.29:443: i/o timeout. Retrying in 601.116952ms
2891:  Download failed on https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2": dial tcp 185.125.190.29:443: i/o timeout. Retrying in 682.098595ms
2892:  Download failed on https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2": net/http: TLS handshake timeout. Retrying in 1.04814645s
2893:  Download failed on https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2": dial tcp 185.125.190.20:443: i/o timeout. Retrying in 2.378743906s
2894:  Download failed on https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2": dial tcp 185.125.190.20:443: i/o timeout. Retrying in 2.213658014s
2895:  Download failed on https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2": dial tcp 185.125.190.21:443: i/o timeout. Retrying in 4.026357413s
2896:  Download failed on https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2": dial tcp 185.125.190.21:443: i/o timeout. Retrying in 5.882073889s
2897:  Download failed on https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2": dial tcp 185.125.190.29:443: i/o timeout. Retrying in 11.677129911s
2898:  Download failed on https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2": dial tcp 185.125.190.29:443: i/o timeout. Retrying in 9.011907648s
2899:  vulnerability_data_stream_test.go:44: 
2900:  Error Trace:	/home/runner/work/fleet/fleet/cmd/fleetctl/integrationtest/vuln/vulnerability_data_stream_test.go:44
2901:  Error:      	Received unexpected error:
2902:  Error downloading Oval definitions: downloadDefinitions: download and extract url https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2: download and write file: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.jammy.usn.oval.xml.bz2": dial tcp 185.125.190.20:443: i/o timeout
2903:  Test:       	TestIntegrationsVulnerabilityDataStream
2904:  nettest.go:36: network test done: TestIntegrationsVulnerabilityDataStream
2905:  DONE 807 tests, 1 failure in 627.488s
2906:  make[1]: *** [Makefile:278: .run-go-tests] Error 1
2907:  make[1]: Leaving directory '/home/runner/work/fleet/fleet'
2908:  make: *** [Makefile:393: test-go] Error 2
2909:  ##[error]Process completed with exit code 2.
2910:  ##[group]Run actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
2911:  with:
2912:  name: fleetctl-mysql8.0.44-coverage
2913:  path: ./coverage.txt
2914:  if-no-files-found: error
2915:  compression-level: 6
...

2927:  With the provided path, there will be 1 file uploaded
2928:  Artifact name is valid!
2929:  Root directory input is valid!
2930:  Beginning upload of artifact content to blob storage
2931:  Uploaded bytes 2837144
2932:  Finished uploading artifact content to blob storage!
2933:  SHA256 hash of uploaded artifact zip is 0f78d3b95ebc3163d20651f331f1e9cb6d942f57df6d13eb6509a4f6661f5c33
2934:  Finalizing artifact upload
2935:  Artifact fleetctl-mysql8.0.44-coverage.zip successfully finalized. Artifact ID 6752582199
2936:  Artifact fleetctl-mysql8.0.44-coverage has been successfully uploaded! Final size is 2837144 bytes. Artifact ID is 6752582199
2937:  Artifact download URL: https://github.com/fleetdm/fleet/actions/runs/25221857498/artifacts/6752582199
2938:  ##[group]Run c1grep() { grep "$@" || test $? = 1; }
2939:  �[36;1mc1grep() { grep "$@" || test $? = 1; }�[0m
2940:  �[36;1mc1grep -oP 'FAIL: .*$' /tmp/gotest.log > /tmp/summary.txt�[0m
2941:  �[36;1mc1grep 'test timed out after' /tmp/gotest.log >> /tmp/summary.txt�[0m
2942:  �[36;1mc1grep 'fatal error:' /tmp/gotest.log >> /tmp/summary.txt�[0m
2943:  �[36;1mc1grep -A 10 'panic: runtime error: ' /tmp/gotest.log >> /tmp/summary.txt�[0m
2944:  �[36;1mc1grep ' FAIL\t' /tmp/gotest.log >> /tmp/summary.txt�[0m
2945:  �[36;1mGO_FAIL_SUMMARY=$(head -n 5 /tmp/summary.txt | sed ':a;N;$!ba;s/\n/\\n/g')�[0m
2946:  �[36;1mecho "GO_FAIL_SUMMARY=$GO_FAIL_SUMMARY"�[0m
2947:  �[36;1mif [[ -z "$GO_FAIL_SUMMARY" ]]; then�[0m
2948:  �[36;1m  GO_FAIL_SUMMARY="unknown, please check the build URL"�[0m
2949:  �[36;1mfi�[0m
2950:  �[36;1mGO_FAIL_SUMMARY=$GO_FAIL_SUMMARY envsubst < .github/workflows/config/slack_payload_template.json > ./payload.json�[0m
2951:  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2952:  env:
2953:  RACE_ENABLED: false
2954:  GO_TEST_TIMEOUT: 20m
2955:  DOCKER_COMMAND: docker compose -f docker-compose.yml -f docker-compose-redis-cluster.yml up -d mysql_test mysql_replica_test redis redis-cluster-1 redis-cluster-2 redis-cluster-3 redis-cluster-4 redis-cluster-5 redis-cluster-6 redis-cluster-setup s3 saml_idp mailhog mailpit smtp4dev_test
2956:  RUN_TESTS_ARG: 
2957:  CI_TEST_PKG: fleetctl
2958:  NEED_DOCKER: 1
2959:  ARTIFACT_PREFIX: fleetctl-mysql8.0.44
2960:  GOTOOLCHAIN: local
2961:  ##[endgroup]
2962:  GO_FAIL_SUMMARY=
2963:  ##[group]Run actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
2964:  with:
2965:  name: fleetctl-mysql8.0.44-test-log
2966:  path: /tmp/gotest.log
2967:  if-no-files-found: error
2968:  compression-level: 6

@MagnusHJensen

Copy link
Copy Markdown
Member

@JordanMontgomery If you have time to review this, it could be great, then I'll maybe start the clear on re-enrollment story work Monday.

Just tested on mac, that it cleared, and it works as expected.

@MagnusHJensen
MagnusHJensen merged commit c2dda6a into main May 1, 2026
56 of 59 checks passed
@MagnusHJensen
MagnusHJensen deleted the mna-40459-wipe-host-cancels-upcoming-activities branch May 1, 2026 20:01
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.

Pending activities are cancelled if host is wiped

4 participants