Skip to content

Fixes from Konstantin's code review - #46701

Merged
getvictor merged 4 commits into
mainfrom
41683-review-fixes
Jun 5, 2026
Merged

Fixes from Konstantin's code review#46701
getvictor merged 4 commits into
mainfrom
41683-review-fixes

Conversation

@getvictor

@getvictor getvictor commented Jun 3, 2026

Copy link
Copy Markdown
Member

Related issue: Resolves #41683

Summary by CodeRabbit

  • Refactoring

    • Replaced ad-hoc string checks with standardized enrollment-status constants across platforms.
    • Centralized Android wipe validation into a single reusable check.
  • Bug Fixes

    • Updated Apple lock and wipe validations to use standardized enrollment-status values.
    • Fixed pending-device handling during Apple device sync to rely on the centralized status representation.

@getvictor
getvictor requested a review from Copilot June 3, 2026 02:55
@getvictor

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@getvictor

Copy link
Copy Markdown
Member Author

/agentic_review

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 3, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0)

Grey Divider


Remediation recommended

1. Pending key inconsistency ✓ Resolved 🐞 Bug ⚙ Maintainability
Description
DeleteHostDEPAssignments compares enrollment_status against fleet.MDMEnrollmentStatusPending but
later still uses the literal "Pending" when checking byStatus, so future changes to the canonical
pending label could silently break pending-host deletion logic. This is currently masked because
fleet.MDMEnrollmentStatusPending is still "Pending".
Code

server/datastore/mysql/apple_mdm.go[R2244-2246]

Evidence
In the same function, the PR introduces the constant comparison for pending hosts, but the function
still later branches based on byStatus["Pending"]. The constant is defined as "Pending" today, so
behavior matches now, but the mixed usage increases the chance of a future refactor changing only
one side and causing the pending-host branch to never run.

server/datastore/mysql/apple_mdm.go[2238-2277]
server/fleet/hosts.go[1398-1441]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`DeleteHostDEPAssignments` was partially refactored to use `fleet.MDMEnrollmentStatusPending`, but the function still uses the literal string `"Pending"` when checking `byStatus`. This creates an inconsistent source-of-truth: if the constant is ever changed (e.g., to match frontend wording changes), the byStatus lookup will stop matching and pending hosts may not be deleted as intended.
### Issue Context
The map `byStatus` is populated with keys from the `enrollment_status` DB column, and the PR updated only one comparison to use the constant.
### Fix Focus Areas
- server/datastore/mysql/apple_mdm.go[2241-2247]
- server/datastore/mysql/apple_mdm.go[2270-2277]
### Suggested fix
- Replace all remaining uses of the literal key `"Pending"` in this function with `fleet.MDMEnrollmentStatusPending` (including the `len(byStatus[...])` guard and any logging that indexes `byStatus["Pending"]`).
- Optionally assign `pendingKey := fleet.MDMEnrollmentStatusPending` once and reuse it to make the intent obvious.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

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

This PR refactors MDM enrollment status handling and Android wipe validation to reduce duplicated logic and replace hard-coded status strings with shared constants, aligning Fleet Free and Premium implementations.

Changes:

  • Centralize Android-specific wipe validations into a shared helper (fleet.ValidateAndroidWipeRequest) used by both Free and Premium WipeHost paths.
  • Introduce fleet.MDMEnrollmentStatus* string constants and update comparisons to use them instead of raw string literals.
  • Update Apple MDM and MySQL datastore logic to use the shared MDMEnrollmentStatusPending constant.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
server/service/scripts.go Uses shared Android wipe validation helper for Fleet Free wipe flow.
server/service/hosts.go Replaces Android BYOD enrollment status string comparison with a constant.
server/service/apple_mdm.go Replaces "Pending" enrollment status comparison with a constant.
server/fleet/hosts.go Adds shared enrollment status constants and the shared Android wipe validation helper.
server/datastore/mysql/apple_mdm.go Replaces "Pending" comparison with a constant when tracking pending hosts.
ee/server/service/hosts.go Reuses shared Android wipe validation helper and replaces enrollment status string comparisons with constants.

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

Comment thread server/fleet/hosts.go Outdated
Comment thread server/fleet/hosts.go Outdated
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 7d232777-06b5-4889-9ace-2bc2dc8fe0f9

📥 Commits

Reviewing files that changed from the base of the PR and between ec6f569 and b8cd0a6.

📒 Files selected for processing (2)
  • ee/server/service/hosts.go
  • server/service/apple_mdm.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • server/service/apple_mdm.go

Walkthrough

This PR adds exported MDM enrollment-status constants and a ValidateAndroidWipeRequest(ctx, ds, host) helper. It updates HostMDM.EnrollmentStatus() to return the new constants, replaces literal status string comparisons across Apple flows and DEP assignment deletion, and refactors Android wipe prechecks to call the new validation helper (wrapping validation errors where used).

Possibly related PRs

  • fleetdm/fleet#46653: Refactors Android wipe to be COBO-only and updates Android BYOD unenroll/wipe semantics, overlapping with this PR’s Android wipe validation consolidation.
🚥 Pre-merge checks | ✅ 1 | ❌ 4

❌ Failed checks (2 warnings, 2 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description only contains the related issue reference (Resolves #41683) and lacks comprehensive documentation of changes, motivation, and testing performed. Complete the description template by filling in the testing section, database migration checks, and other required checklist items to document the changes thoroughly.
Linked Issues check ⚠️ Warning The PR implements only partial refactoring of MDM enrollment status handling but does not address the main objectives of issue #41683 regarding Android MDM actions (Lock, Wipe, Clear passcode). Ensure the PR addresses the primary coding requirements of issue #41683: Android UI actions, CLI support, backend API changes, activity logging, and schema migrations.
Title check ❓ Inconclusive The title 'Fixes from Konstantin's code review' is vague and does not clearly convey what specific changes are made in the pull request. Provide a more specific title describing the actual changes, such as 'Refactor MDM enrollment status to use constants instead of string literals'.
Out of Scope Changes check ❓ Inconclusive The changes focus on refactoring string literals to constants for MDM enrollment status, which appears foundational but is narrower than the linked issue's scope. Clarify whether these refactoring changes are preparatory steps for the full Android MDM actions implementation or if they are incomplete fixes from the code review.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ 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 41683-review-fixes

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 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

🧹 Nitpick comments (1)
ee/server/service/hosts.go (1)

67-73: ⚡ Quick win

Finish the status-constant migration in this file.

This switches LockHost to fleet.MDMEnrollmentStatus*, but WipeHost still compares against the raw "On (personal)" string on Line 285. That leaves two sources of truth for the same enrollment state in the same file.

♻️ Suggested follow-up
-		if host.MDM.EnrollmentStatus != nil && *host.MDM.EnrollmentStatus == "On (personal)" {
+		if host.MDM.EnrollmentStatus != nil && *host.MDM.EnrollmentStatus == fleet.MDMEnrollmentStatusPersonal {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ee/server/service/hosts.go` around lines 67 - 73, WipeHost still compares
host enrollment using the raw string "On (personal)" while LockHost was migrated
to use fleet.MDMEnrollmentStatus* constants; update WipeHost to use the same
constants instead of raw strings—replace any comparisons against "On (personal)"
with checks against fleet.MDMEnrollmentStatusPersonal and any checks for the
manual state with fleet.MDMEnrollmentStatusManual, using the same
host.MDM.EnrollmentStatus nil-safe pattern as in LockHost to ensure consistent
single source of truth.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@server/datastore/mysql/apple_mdm.go`:
- Around line 2243-2245: The code builds pendingHostIDs using the constant
fleet.MDMEnrollmentStatusPending but later checks byStatus["Pending"], causing a
mismatch; update the lookup to use the same constant value (use
fleet.MDMEnrollmentStatusPending or dereferenced host.EnrollmentStatus value)
when gating/logging and when accessing byStatus so the pending bucket is read
consistently (update the occurrences around byStatus lookups and the gate/log
that currently uses the literal "Pending" — ensure both the construction of
byStatus keys and the lookup use fleet.MDMEnrollmentStatusPending or the actual
EnrollmentStatus value).

---

Nitpick comments:
In `@ee/server/service/hosts.go`:
- Around line 67-73: WipeHost still compares host enrollment using the raw
string "On (personal)" while LockHost was migrated to use
fleet.MDMEnrollmentStatus* constants; update WipeHost to use the same constants
instead of raw strings—replace any comparisons against "On (personal)" with
checks against fleet.MDMEnrollmentStatusPersonal and any checks for the manual
state with fleet.MDMEnrollmentStatusManual, using the same
host.MDM.EnrollmentStatus nil-safe pattern as in LockHost to ensure consistent
single source of truth.
🪄 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: 8b815ff9-21e1-45d4-915e-f5c36e6a4f67

📥 Commits

Reviewing files that changed from the base of the PR and between 5f0a03b and c0da10e.

📒 Files selected for processing (6)
  • ee/server/service/hosts.go
  • server/datastore/mysql/apple_mdm.go
  • server/fleet/hosts.go
  • server/service/apple_mdm.go
  • server/service/hosts.go
  • server/service/scripts.go

Comment thread server/datastore/mysql/apple_mdm.go
@getvictor
getvictor marked this pull request as ready for review June 3, 2026 03:26
@getvictor
getvictor requested a review from a team as a code owner June 3, 2026 03:26

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.18519% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.98%. Comparing base (fdd4ce6) to head (b8cd0a6).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
server/fleet/hosts.go 73.33% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #46701      +/-   ##
==========================================
+ Coverage   66.91%   66.98%   +0.06%     
==========================================
  Files        2836     2826      -10     
  Lines      225064   224540     -524     
  Branches    11619    11401     -218     
==========================================
- Hits       150610   150407     -203     
+ Misses      60789    60469     -320     
+ Partials    13665    13664       -1     
Flag Coverage Δ
backend 68.63% <85.18%> (+<0.01%) ⬆️

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.

@ksykulev ksykulev 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.

ee/server/service/hosts.go:285
if host.MDM.EnrollmentStatus != nil && *host.MDM.EnrollmentStatus == "On (personal)" {

is the only one missing that I detected with grep

@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 (vuln, mysql:8.0.44) / test

Failed stage: Run Go Tests [❌]

Failed test name: TestTranslateCPEToCVE/find_vulns_on_cpes

Failure summary:

The action failed during make test-go because a Go unit test assertion failed in
server/vulnerabilities/nvd.

- Failing test: TestTranslateCPEToCVE/find_vulns_on_cpes
- Location:
/home/runner/work/fleet/fleet/server/vulnerabilities/nvd/cve_test.go:932
- Reason: the returned CVE
list for the Docker Desktop Windows CPE (cpe:2.3:a:docker:desktop:4.39.0:::::windows::) did
not include the expected entry nvd.cve{ID:"CVE-2025-9074", resolvedInVersion:"4.44.3"}.
Instead,
the result contained only:
CVE-2025-3224 (resolved in 4.41.0), CVE-2026-2664 (resolved in 4.62.0),
and CVE-2025-14740 (no resolvedInVersion).

This test failure caused .run-go-tests (Makefile:286) and then test-go (Makefile:401) to exit
non-zero, ending the job with exit code 2.

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

1593:  �[36;1mattempt=1�[0m
1594:  �[36;1m�[0m
1595:  �[36;1mwhile [ $attempt -le $max_attempts ]; do�[0m
1596:  �[36;1m  echo "Attempt $attempt of $max_attempts"�[0m
1597:  �[36;1m�[0m
1598:  �[36;1m  # Try to connect to MySQL�[0m
1599:  �[36;1m  if wait_for_mysql "mysql_test"; then�[0m
1600:  �[36;1m    # If MySQL is ready, try to connect to MySQL replica�[0m
1601:  �[36;1m    if wait_for_mysql "mysql_replica_test"; then�[0m
1602:  �[36;1m      # Both are ready, we're done�[0m
1603:  �[36;1m      echo "All MySQL connections successful"�[0m
1604:  �[36;1m      exit 0�[0m
1605:  �[36;1m    fi�[0m
1606:  �[36;1m  fi�[0m
1607:  �[36;1m�[0m
1608:  �[36;1m  # If we get here, at least one connection failed�[0m
1609:  �[36;1m  echo "Failed to connect to MySQL on attempt $attempt"�[0m
1610:  �[36;1m�[0m
1611:  �[36;1m  if [ $attempt -lt $max_attempts ]; then�[0m
1612:  �[36;1m    echo "Restarting containers and trying again..."�[0m
1613:  �[36;1m    restart_containers�[0m
1614:  �[36;1m  else�[0m
1615:  �[36;1m    echo "Maximum attempts reached. Failing the job."�[0m
1616:  �[36;1m    exit 1�[0m
...

1748:  �[32m✓�[0m Is server core (0.00s)
1749:  �[32m✓�[0m Matches (0.00s)
1750:  �[32m✓�[0m Matches from differect arch (0.00s)
1751:  �[32m✓�[0m Matches from differect products (0.00s)
1752:  �[32m✓�[0m Matches operating system (0.00s)
1753:  �[32m✓�[0m Matches same product but for different architecture (0.00s)
1754:  �[32m✓�[0m Matches same product one with no architecture (0.00s)
1755:  �[32m✓�[0m Matches same product same arch (0.00s)
1756:  �[32m✓�[0m New product from OS (0.00s)
1757:  �[32m✓�[0m Product has display version (0.00s)
1758:  �[32m✓�[0m Security bulletin (0.00s)
1759:  �[32m✓�[0m Security bulletin # merge (0.00s)
1760:  �[32m✓�[0m Security bulletin # merge . products (0.00s)
1761:  �[32m✓�[0m Security bulletin # merge . vendor fixes (0.00s)
1762:  �[32m✓�[0m Security bulletin # merge . vulnerabilities (0.00s)
1763:  �[32m✓�[0m Security bulletin # merge fails if product names don't match (0.00s)
1764:  �[32m✓�[0m Security bulletin # merge with empty bulletins (0.00s)
1765:  �[32m✓�[0m Security bulletin # unmarshal JSON (0.00s)
1766:  �[32m✓�[0m Security bulletin # unmarshal JSON accepts new vulnerabilities key (0.00s)
1767:  �[32m✓�[0m Security bulletin # unmarshal JSON accepts old misspelled vulnerabities key (0.00s)
1768:  �[32m✓�[0m Security bulletin # unmarshal JSON marshal uses correct spelling (0.00s)
1769:  github.com/fleetdm/fleet/v4/server/vulnerabilities/goval_dictionary:
1770:  �[32m✓�[0m Database (0.00s)
1771:  �[32m✓�[0m Database close releases file handle (0.04s)
1772:  �[32m✓�[0m Database fixed version (0.00s)
1773:  �[32m✓�[0m Database multiple packages, fixed version (0.00s)
1774:  �[32m✓�[0m Database multiple packages, multiple vulnerabilities (0.00s)
1775:  �[32m✓�[0m Database newer than fixed version (0.00s)
1776:  �[32m✓�[0m Database non-matching architecture (0.00s)
1777:  �[32m✓�[0m Database non-matching package name (0.00s)
1778:  �[32m✓�[0m Database older than fixed version (0.00s)
1779:  �[32m✓�[0m Database verify returns no errors (0.00s)
1780:  �[32m✓�[0m Sync (0.00s)
1781:  �[32m✓�[0m Sync #what to download (0.00s)
1782:  �[32m✓�[0m Verify (0.00s)
1783:  �[32m✓�[0m Verify verify alerts of error (0.00s)
1784:  github.com/fleetdm/fleet/v4/server/vulnerabilities/msrc:
...

1815:  �[32m✓�[0m Parser (0.21s)
1816:  �[32m✓�[0m Parser map to security bulletins (0.00s)
1817:  �[32m✓�[0m Parser map to security bulletins each bulletin should have the right products (0.00s)
1818:  �[32m✓�[0m Parser map to security bulletins each bulletin should have the right vulnerabilities (0.00s)
1819:  �[32m✓�[0m Parser map to security bulletins should have one bulletin per product (0.00s)
1820:  �[32m✓�[0m Parser map to security bulletins should map the vendor fixes entries correctly (0.00s)
1821:  �[32m✓�[0m Parser map to security bulletins should map the vulnerability entries correctly (0.00s)
1822:  �[32m✓�[0m Parser parse XML (0.08s)
1823:  �[32m✓�[0m Parser parse XML only CVEs for windows products are included (0.00s)
1824:  �[32m✓�[0m Parser parse XML only windows products are included (0.00s)
1825:  �[32m✓�[0m Parser parse XML scores are parsed correctly (0.00s)
1826:  �[32m✓�[0m Parser parse XML should include windows server 2025 from 202 6- feb feed (0.08s)
1827:  �[32m✓�[0m Parser parse XML the remediations are parsed correctly (0.00s)
1828:  �[32m✓�[0m Parser parse XML the revision history is parsed correctly (0.00s)
1829:  �[32m✓�[0m Parser parse feed (0.00s)
1830:  �[32m✓�[0m Parser parse feed errors out if file does not exists (0.00s)
1831:  �[32m✓�[0m Sync (0.00s)
...

1968:  �[32m✓�[0m Extract ubuntu version future version 2 5.04 (0.00s)
1969:  �[32m✓�[0m Extract ubuntu version interim release 2 3.10 (0.00s)
1970:  �[32m✓�[0m Extract ubuntu version interim release 2 4.10 with patch (0.00s)
1971:  �[32m✓�[0m Extract ubuntu version invalid version - single digit (0.00s)
1972:  �[32m✓�[0m Extract ubuntu version ubuntu 1 6.04 with extra spaces (0.00s)
1973:  �[32m✓�[0m Extract ubuntu version ubuntu 1 8.04 (0.00s)
1974:  �[32m✓�[0m Extract ubuntu version ubuntu 2 0.04 LTS (0.00s)
1975:  �[32m✓�[0m Extract ubuntu version ubuntu 2 2.04 LTS (0.00s)
1976:  �[32m✓�[0m Extract ubuntu version ubuntu 2 4.04 no LTS suffix (0.00s)
1977:  �[32m✓�[0m Extract ubuntu version version with codename suffix (0.00s)
1978:  �[32m✓�[0m Extract ubuntu version very old version 1 4.04 (0.00s)
1979:  �[32m✓�[0m Find latest OSV artifact for version (0.00s)
1980:  �[32m✓�[0m Find latest OSV artifact for version finds latest 1 8.04 artifact (0.00s)
1981:  �[32m✓�[0m Find latest OSV artifact for version finds latest 2 0.04 artifact (0.00s)
1982:  �[32m✓�[0m Find latest OSV artifact for version finds latest 2 2.04 artifact (0.00s)
1983:  �[32m✓�[0m Find latest OSV artifact for version returns error for non-existent version (0.00s)
1984:  �[32m✓�[0m Get needed RHEL versions (0.00s)
...

2056:  �[32m✓�[0m Normalize kernel version generic 6 4k kernel (0.00s)
2057:  �[32m✓�[0m Normalize kernel version generic kernel (0.00s)
2058:  �[32m✓�[0m Normalize kernel version kernel with only one part (0.00s)
2059:  �[32m✓�[0m Normalize kernel version lowlatency kernel (0.00s)
2060:  �[32m✓�[0m OSV filename (0.00s)
2061:  �[32m✓�[0m OSV filename 1804 (0.00s)
2062:  �[32m✓�[0m OSV filename 2004 (0.00s)
2063:  �[32m✓�[0m OSV filename 2204 (0.00s)
2064:  �[32m✓�[0m RHELOSV filename (0.00s)
2065:  �[32m✓�[0m RHELOSV filename 10 (0.00s)
2066:  �[32m✓�[0m RHELOSV filename 8 (0.00s)
2067:  �[32m✓�[0m RHELOSV filename 9 (0.00s)
2068:  �[32m✓�[0m Release date from assets (0.00s)
2069:  �[32m✓�[0m Remove old OSV artifacts (0.00s)
2070:  �[32m✓�[0m Remove old OSV artifacts date boundary race (0.00s)
2071:  �[32m✓�[0m Remove old OSV artifacts preserves failed versions (0.00s)
2072:  �[32m✓�[0m Remove old OSV artifacts with skipped versions (0.00s)
2073:  �[32m✓�[0m Remove old RHELOSV artifacts (0.00s)
2074:  �[32m✓�[0m Sync OSV checksum match (0.00s)
2075:  �[32m✓�[0m Sync OSV fault tolerance (0.00s)
2076:  �[32m✓�[0m Sync OSV partial failure not returned as error (0.00s)
2077:  �[32m✓�[0m Version from asset name (0.01s)
...

2110:  �[32m✓�[0m CVE use existing sync cve-2. 0 .xml.gz (0.01s)
2111:  �[32m✓�[0m CVE use existing sync cve-2. 0 .xml.zip (0.01s)
2112:  �[33m∅�[0m End to end (0.00s)
2113:  �[32m✓�[0m Response not OK (0.00s)
2114:  github.com/fleetdm/fleet/v4/server/vulnerabilities/oval/input:
2115:  github.com/fleetdm/fleet/v4/server/vulnerabilities/oval/parsed:
2116:  �[32m✓�[0m Dpkg info test eval no host list (0.00s)
2117:  �[32m✓�[0m Dpkg info test eval no host list # eval (0.00s)
2118:  �[32m✓�[0m Dpkg info test eval no host list # eval test matches n objects (0.00s)
2119:  �[32m✓�[0m Dpkg info test eval no host list # eval test matches n states (0.00s)
2120:  �[32m✓�[0m Dpkg info test eval no host list # eval with no packages (0.00s)
2121:  �[32m✓�[0m Eval (0.00s)
2122:  �[32m✓�[0m Eval alt pattern match (0.00s)
2123:  �[32m✓�[0m Eval equal (0.00s)
2124:  �[32m✓�[0m Eval greater than (0.00s)
2125:  �[32m✓�[0m Eval higher version fails pattern match (0.00s)
2126:  �[32m✓�[0m Eval kernel (0.00s)
2127:  �[32m✓�[0m Eval less than (0.00s)
2128:  �[32m✓�[0m Eval lower version fails pattern match (0.00s)
2129:  �[32m✓�[0m Eval suffix doesn't match (0.00s)
...

2141:  �[32m✓�[0m Object info state # eval OS version name (0.00s)
2142:  �[32m✓�[0m Object info state # eval OS version version (0.00s)
2143:  �[32m✓�[0m Object info state # eval software (0.00s)
2144:  �[32m✓�[0m Object info state # eval software arch (0.00s)
2145:  �[32m✓�[0m Object info state # eval software evr (0.00s)
2146:  �[32m✓�[0m Object info state # eval software name (0.00s)
2147:  �[32m✓�[0m Object info state # eval software release (0.00s)
2148:  �[32m✓�[0m Object info state # eval software signature key id (0.00s)
2149:  �[32m✓�[0m Object info state # eval software version (0.00s)
2150:  �[32m✓�[0m Object match type (0.00s)
2151:  �[32m✓�[0m Object match type # eval (0.00s)
2152:  �[32m✓�[0m Object match type new object match type (0.00s)
2153:  �[32m✓�[0m Object state evr string (0.00s)
2154:  �[32m✓�[0m Object state evr string # eval (0.00s)
2155:  �[32m✓�[0m Object state evr string # eval evaluates an evr string (0.00s)
2156:  �[32m✓�[0m Object state evr string # eval it errors out if operation can not be computed (0.00s)
2157:  �[32m✓�[0m Object state simple value (0.00s)
2158:  �[32m✓�[0m Object state simple value # eval (0.00s)
2159:  �[32m✓�[0m Object state simple value # eval compares simple data types (0.00s)
2160:  �[32m✓�[0m Object state simple value # eval compares simple data types booleans (0.00s)
2161:  �[32m✓�[0m Object state simple value # eval compares simple data types floats (0.00s)
2162:  �[32m✓�[0m Object state simple value # eval compares simple data types ints (0.00s)
2163:  �[32m✓�[0m Object state simple value # eval compares simple data types strings (0.00s)
2164:  �[32m✓�[0m Object state simple value # eval it errors out if complex type used (0.00s)
2165:  �[32m✓�[0m Object state simple value #unpack (0.00s)
2166:  �[32m✓�[0m Object state simple value new object state simple value (0.00s)
2167:  �[32m✓�[0m Object state string (0.00s)
2168:  �[32m✓�[0m Object state string # eval (0.00s)
2169:  �[32m✓�[0m Object state string # eval it errors out if operation can not be computed (0.00s)
2170:  �[32m✓�[0m Object state string # eval it errors out if regexp can not be parsed (0.00s)
2171:  �[32m✓�[0m Object state string # eval it evaluates string values (0.00s)
...

2252:  �[32m✓�[0m Integration check version unknown version returns no vulnerabilities (0.00s)
2253:  �[32m✓�[0m Integration check version version not in bulletin returns empty (0.00s)
2254:  �[32m✓�[0m Parse office version (0.00s)
2255:  �[32m✓�[0m Parse office version invalid version - no prefix (0.00s)
2256:  �[32m✓�[0m Parse office version invalid version - too few parts (0.00s)
2257:  �[32m✓�[0m Parse office version invalid version - wrong prefix (0.00s)
2258:  �[32m✓�[0m Parse office version valid version (0.00s)
2259:  �[32m✓�[0m Parse security markdown (0.00s)
2260:  �[32m✓�[0m Parse security markdown keeps minimum build suffix for same version (0.00s)
2261:  �[32m✓�[0m Parse security markdown parses LTSC versions (0.00s)
2262:  �[32m✓�[0m Parse security markdown parses multiple releases (0.00s)
2263:  �[32m✓�[0m Parse security markdown parses single release with multiple versions (0.00s)
2264:  �[32m✓�[0m Parse security markdown skips releases without CVEs (0.00s)
2265:  �[32m✓�[0m Parse security markdown skips retail versions (0.00s)
2266:  �[32m✓�[0m Sync bulletin (0.00s)
2267:  �[32m✓�[0m Sync bulletin on FS error (0.00s)
2268:  �[32m✓�[0m Sync bulletin on GH error (0.00s)
2269:  �[32m✓�[0m Sync bulletin on error when deleting (0.00s)
2270:  �[32m✓�[0m Sync bulletin on error when downloading GH asset (0.00s)
2271:  �[32m✓�[0m Sync bulletin removes multiple out of date copies (0.00s)
2272:  �[32m✓�[0m Sync bulletin when local copy is not out of date (0.00s)
2273:  �[32m✓�[0m Sync bulletin when local copy is out of date (0.00s)
2274:  �[32m✓�[0m Sync bulletin when local is newer than remote (0.00s)
2275:  �[32m✓�[0m Sync bulletin when nothing published on GH (0.00s)
2276:  �[32m✓�[0m Sync bulletin when there are no local files (0.00s)
2277:  github.com/fleetdm/fleet/v4/server/vulnerabilities/macoffice:
2278:  �[32m✓�[0m Analyzer (0.00s)
2279:  �[32m✓�[0m Analyzer analyze (0.00s)
2280:  �[32m✓�[0m Analyzer analyze when no release notes on path (0.00s)
2281:  �[32m✓�[0m Analyzer analyze when release notes contain no valid security updates (0.00s)
2282:  �[32m✓�[0m Analyzer analyze when using wrong path (0.00s)
2283:  �[32m✓�[0m Analyzer collect vulnerabilities (0.00s)
2284:  �[32m✓�[0m Analyzer collect vulnerabilities no release notes (0.00s)
2285:  �[32m✓�[0m Analyzer get stored vulnerabilities (0.00s)
2286:  �[32m✓�[0m Analyzer get stored vulnerabilities on error (0.00s)
2287:  �[32m✓�[0m Analyzer latest release notes (0.00s)
2288:  �[32m✓�[0m Analyzer latest release notes returns release notes in order (0.00s)
2289:  �[32m✓�[0m Analyzer latest release notes when the JSON file is invalid (0.00s)
2290:  �[32m✓�[0m Analyzer latest release notes when vuln path does not exists (0.00s)
2291:  �[32m✓�[0m Analyzer latest release notes when vuln path exists (0.00s)
2292:  �[32m✓�[0m Analyzer update vulns in DB (0.00s)
2293:  �[32m✓�[0m Analyzer update vulns in DB on error when deleting vulns (0.00s)
2294:  �[32m✓�[0m Analyzer update vulns in DB on error when inserting vulns (0.00s)
2295:  �[32m✓�[0m Build number (0.00s)
...

2301:  �[32m✓�[0m Integrations parse release HTML (0.28s)
2302:  �[32m✓�[0m Integrations parse release HTML should parse dates (0.01s)
2303:  �[32m✓�[0m Integrations parse release HTML should parse release versions (0.01s)
2304:  �[32m✓�[0m Integrations parse release HTML should parse security updates (0.02s)
2305:  �[32m✓�[0m Integrations sync (0.80s)
2306:  �[32m✓�[0m Release note (0.00s)
2307:  �[32m✓�[0m Release note # cmp version (0.00s)
2308:  �[32m✓�[0m Release note # cmp version when release version is newer than (0.00s)
2309:  �[32m✓�[0m Release note # cmp version when release version is older than (0.00s)
2310:  �[32m✓�[0m Release note # cmp version when the same (0.00s)
2311:  �[32m✓�[0m Release note # collect vulnerabilities (0.00s)
2312:  �[32m✓�[0m Release note # office product from bundle id (0.00s)
2313:  �[32m✓�[0m Short version format (0.00s)
2314:  �[32m✓�[0m Sync (0.00s)
2315:  �[32m✓�[0m Sync #sync (0.00s)
2316:  �[32m✓�[0m Sync #sync on FS error (0.00s)
2317:  �[32m✓�[0m Sync #sync on GH error (0.00s)
2318:  �[32m✓�[0m Sync #sync on error when deleting (0.00s)
2319:  �[32m✓�[0m Sync #sync on error when downloading GH asset (0.00s)
2320:  �[32m✓�[0m Sync #sync removes multiple out of date copies (0.00s)
...

2323:  �[32m✓�[0m Sync #sync when nothing published on GH (0.00s)
2324:  �[32m✓�[0m Sync #sync when there are no local files (0.00s)
2325:  �[32m✓�[0m Sync #sync when there are no remote rel notes (0.00s)
2326:  github.com/fleetdm/fleet/v4/server/vulnerabilities/oval:
2327:  �[32m✓�[0m Oval analyzer (0.00s)
2328:  �[32m✓�[0m Oval analyzer #load (0.00s)
2329:  �[32m✓�[0m Oval analyzer #load invalid vuln path (0.00s)
2330:  �[32m✓�[0m Oval analyzer #load rejects empty definition file (0.00s)
2331:  �[32m✓�[0m Oval analyzer analyzing RHEL software (10.68s)
2332:  �[32m✓�[0m Oval analyzer analyzing ubuntu software (6.83s)
2333:  �[32m✓�[0m Oval download definitions matching host info (0.00s)
2334:  �[32m✓�[0m Oval download definitions platform not found (0.00s)
2335:  �[32m✓�[0m Oval mapper (0.00s)
2336:  �[32m✓�[0m Oval mapper #extract id (0.00s)
2337:  �[32m✓�[0m Oval mapper #map criteria (0.00s)
2338:  �[32m✓�[0m Oval mapper #map criteria errors out if id can not be parsed on any criterion (0.00s)
2339:  �[32m✓�[0m Oval mapper #map criteria errors out if no criteriums or nested criterias (0.00s)
2340:  �[32m✓�[0m Oval mapper #map criteria maps criteriums (0.00s)
2341:  �[32m✓�[0m Oval mapper #map criteria maps nested criterias (0.00s)
2342:  �[32m✓�[0m Oval mapper #map definition (0.00s)
2343:  �[32m✓�[0m Oval mapper #map definition errors out if no vulnerabilities (0.00s)
2344:  �[32m✓�[0m Oval mapper #map dpkg info state (0.00s)
2345:  �[32m✓�[0m Oval mapper #map dpkg info state errors out if one of non-supported state information is provided (0.00s)
2346:  �[32m✓�[0m Oval mapper #map dpkg info test (0.00s)
2347:  �[32m✓�[0m Oval mapper #map dpkg info test errors out if id can not be parsed (0.00s)
2348:  �[32m✓�[0m Oval mapper #map dpkg info test maps a dpkg info test XML (0.00s)
2349:  �[32m✓�[0m Oval mapper #map package info test object (0.00s)
2350:  �[32m✓�[0m Oval mapper #map package info test object name defined in var ref (0.00s)
2351:  �[32m✓�[0m Oval mapper #map package info test object name defined inline (0.00s)
2352:  �[32m✓�[0m Oval mapper #map package info test object name not defined inline nor using a variable ref (0.00s)
2353:  �[32m✓�[0m Oval mapper #map rpm info state (0.00s)
2354:  �[32m✓�[0m Oval mapper #map rpm info state errors out if not supported state is provided (0.00s)
2355:  �[32m✓�[0m Oval mapper #map rpm info state maps a rpm info state XML (0.00s)
2356:  �[32m✓�[0m Oval mapper #map rpm info state maps the operator, if any (0.00s)
2357:  �[32m✓�[0m Oval mapper #map rpm info test (0.00s)
2358:  �[32m✓�[0m Oval mapper #map rpm info test errors out if id can not be parsed (0.00s)
2359:  �[32m✓�[0m Oval mapper #map rpm info test maps a rpm info test XML (0.00s)
2360:  �[32m✓�[0m Oval mapper #map rpm verify file object (0.00s)
2361:  �[32m✓�[0m Oval mapper #map rpm verify file object errors out if invalid children provided (0.00s)
2362:  �[32m✓�[0m Oval mapper #map rpm verify file object maps to a filepath (0.00s)
2363:  �[32m✓�[0m Oval mapper #map rpm verify file state (0.00s)
2364:  �[32m✓�[0m Oval mapper #map rpm verify file state errors out if not supported state is provided (0.00s)
2365:  �[32m✓�[0m Oval mapper #map rpm verify file state maps a rpm verify file state XML (0.00s)
...

2524:  �[32m✓�[0m FS client (0.00s)
2525:  �[32m✓�[0m FS client #MSRC bulletins (0.00s)
2526:  �[32m✓�[0m FS client #MSRC bulletins directory does not exists (0.00s)
2527:  �[32m✓�[0m FS client #MSRC bulletins returns a list of file matching the MSRC file prefix (0.00s)
2528:  �[32m✓�[0m FS client delete (0.00s)
2529:  �[32m✓�[0m FS client delete file does not exists (0.00s)
2530:  �[32m✓�[0m FS client mac office release notes (0.00s)
2531:  �[32m✓�[0m FS client mac office release notes directory does not exists (0.00s)
2532:  �[32m✓�[0m FS client mac office release notes returns a list of file matching the mac office file prefix (0.00s)
2533:  �[32m✓�[0m FS client mac office release notes when files contain the wrong date format (0.00s)
2534:  �[32m✓�[0m Integrations github client (290.43s)
2535:  �[32m✓�[0m Integrations github client # download (290.43s)
2536:  �[32m✓�[0m Integrations github client # download with invalid URL (290.42s)
2537:  �[32m✓�[0m Integrations github client #MSRC bulletins (0.00s)
2538:  �[32m✓�[0m Integrations github client mac office release notes (0.00s)
2539:  �[32m✓�[0m Integrations github client mac office release notes on error (0.00s)
2540:  �[32m✓�[0m Integrations github client mac office release notes with HTTP error code (0.00s)
2541:  �[32m✓�[0m Integrations github client mac office release notes with a single release note asset (0.00s)
...

2548:  �[32m✓�[0m Security bulletin name # before when b is empty (0.00s)
2549:  �[32m✓�[0m Security bulletin name # product name (0.00s)
2550:  �[32m✓�[0m Security bulletin name #date (0.00s)
2551:  �[32m✓�[0m Security bulletin name MSRC file name (0.00s)
2552:  �[32m✓�[0m Security bulletin name date not included in filename (0.00s)
2553:  �[32m✓�[0m Security bulletin name mac office rel notes file name (0.00s)
2554:  �[32m✓�[0m Security bulletin name product name not included in filename (0.00s)
2555:  �[32m✓�[0m Security bulletin name string (0.00s)
2556:  �[32m✓�[0m Security bulletin name validates timestamp on filename at construction time (0.00s)
2557:  �[32m✓�[0m Security bulletin name win office file name (0.00s)
2558:  === �[33mSkipped�[0m
2559:  === �[33mSKIP�[0m: server/vulnerabilities/nvd/tools/providers/nvd TestEndToEnd (0.00s)
2560:  e2e_test.go:45: e2e tests not enabled
2561:  === �[33mSKIP�[0m: server/vulnerabilities/vulntest TestGenerateVulnFixtures (0.00s)
2562:  gen_fixture_test.go:123: set GENERATE_FIXTURES=1 to run this test
2563:  === �[31mFailed�[0m
2564:  === �[31mFAIL�[0m: server/vulnerabilities/nvd TestTranslateCPEToCVE/find_vulns_on_cpes (31.71s)
2565:  cve_test.go:932: 
2566:  Error Trace:	/home/runner/work/fleet/fleet/server/vulnerabilities/nvd/cve_test.go:932
2567:  Error:      	[]nvd.cve{nvd.cve{ID:"CVE-2025-3224", resolvedInVersion:"4.41.0"}, nvd.cve{ID:"CVE-2026-2664", resolvedInVersion:"4.62.0"}, nvd.cve{ID:"CVE-2025-14740", resolvedInVersion:""}} does not contain nvd.cve{ID:"CVE-2025-9074", resolvedInVersion:"4.44.3"}
2568:  Test:       	TestTranslateCPEToCVE/find_vulns_on_cpes
2569:  Messages:   	cpe:2.3:a:docker:desktop:4.39.0:*:*:*:*:windows:*:* does not contain CVE nvd.cve{ID:"CVE-2025-9074", resolvedInVersion:"4.44.3"}
2570:  --- FAIL: TestTranslateCPEToCVE/find_vulns_on_cpes (31.71s)
2571:  === �[31mFAIL�[0m: server/vulnerabilities/nvd TestTranslateCPEToCVE (9.65s)
2572:  DONE 832 tests, 2 skipped, 2 failures in 291.762s
2573:  make[1]: *** [Makefile:286: .run-go-tests] Error 1
2574:  make[1]: Leaving directory '/home/runner/work/fleet/fleet'
2575:  make: *** [Makefile:401: test-go] Error 2
2576:  ##[error]Process completed with exit code 2.
2577:  ##[group]Run actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
2578:  with:
2579:  name: vuln-mysql8.0.44-coverage
2580:  path: ./coverage.txt
2581:  if-no-files-found: error
2582:  compression-level: 6
...

2594:  With the provided path, there will be 1 file uploaded
2595:  Artifact name is valid!
2596:  Root directory input is valid!
2597:  Beginning upload of artifact content to blob storage
2598:  Uploaded bytes 1999106
2599:  Finished uploading artifact content to blob storage!
2600:  SHA256 hash of uploaded artifact zip is 15e97492e15c7abc16f9ed7953a36eda5753ae0468d1076fbf6c86e6bf7df920
2601:  Finalizing artifact upload
2602:  Artifact vuln-mysql8.0.44-coverage.zip successfully finalized. Artifact ID 7395265888
2603:  Artifact vuln-mysql8.0.44-coverage has been successfully uploaded! Final size is 1999106 bytes. Artifact ID is 7395265888
2604:  Artifact download URL: https://github.com/fleetdm/fleet/actions/runs/26909052556/artifacts/7395265888
2605:  ##[group]Run c1grep() { grep "$@" || test $? = 1; }
2606:  �[36;1mc1grep() { grep "$@" || test $? = 1; }�[0m
2607:  �[36;1mc1grep -oP 'FAIL: .*$' /tmp/gotest.log > /tmp/summary.txt�[0m
2608:  �[36;1mc1grep 'test timed out after' /tmp/gotest.log >> /tmp/summary.txt�[0m
2609:  �[36;1mc1grep 'fatal error:' /tmp/gotest.log >> /tmp/summary.txt�[0m
2610:  �[36;1mc1grep -A 10 'panic: runtime error: ' /tmp/gotest.log >> /tmp/summary.txt�[0m
2611:  �[36;1mc1grep ' FAIL\t' /tmp/gotest.log >> /tmp/summary.txt�[0m
2612:  �[36;1mGO_FAIL_SUMMARY=$(head -n 5 /tmp/summary.txt | sed ':a;N;$!ba;s/\n/\\n/g')�[0m
2613:  �[36;1mecho "GO_FAIL_SUMMARY=$GO_FAIL_SUMMARY"�[0m
2614:  �[36;1mif [[ -z "$GO_FAIL_SUMMARY" ]]; then�[0m
2615:  �[36;1m  GO_FAIL_SUMMARY="unknown, please check the build URL"�[0m
2616:  �[36;1mfi�[0m
2617:  �[36;1mGO_FAIL_SUMMARY=$GO_FAIL_SUMMARY envsubst < .github/workflows/config/slack_payload_template.json > ./payload.json�[0m
2618:  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2619:  env:
2620:  RACE_ENABLED: false
2621:  GO_TEST_TIMEOUT: 20m
2622:  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
2623:  RUN_TESTS_ARG: 
2624:  CI_TEST_PKG: vuln
2625:  NEED_DOCKER: 1
2626:  ARTIFACT_PREFIX: vuln-mysql8.0.44
2627:  GOTOOLCHAIN: local
2628:  ##[endgroup]
2629:  GO_FAIL_SUMMARY=FAIL: TestTranslateCPEToCVE/find_vulns_on_cpes (31.71s)
2630:  ##[group]Run actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
2631:  with:
2632:  name: vuln-mysql8.0.44-test-log
2633:  path: /tmp/gotest.log
2634:  if-no-files-found: error
2635:  compression-level: 6

@getvictor
getvictor merged commit 02d1738 into main Jun 5, 2026
40 of 42 checks passed
@getvictor
getvictor deleted the 41683-review-fixes branch June 5, 2026 06:13
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.

Android commands: Lock, wipe, & clear passcode

3 participants