Skip to content

Add activities for user actions on labels#44522

Open
lucasmrod wants to merge 3 commits intomainfrom
36976-activities-for-labels
Open

Add activities for user actions on labels#44522
lucasmrod wants to merge 3 commits intomainfrom
36976-activities-for-labels

Conversation

@lucasmrod
Copy link
Copy Markdown
Member

@lucasmrod lucasmrod commented Apr 30, 2026

Resolves #36976

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes files for more information.

Testing

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

Summary by CodeRabbit

  • New Features

    • Label operations (create, edit, delete) now generate activities shown in the activity feed with label and optional fleet context.
    • Host label add/remove operations emit corresponding label edited activities; duplicate label names are deduplicated.
    • Label activity types are selectable/filterable in the activity dashboard.
  • Tests

    • Added comprehensive tests and integration coverage for label activity emission, filtering, rendering, and GitOps label lifecycle scenarios.

@lucasmrod lucasmrod requested a review from a team as a code owner April 30, 2026 18:21
Copilot AI review requested due to automatic review settings April 30, 2026 18:21
@lucasmrod lucasmrod requested a review from a team as a code owner April 30, 2026 18:21
Copy link
Copy Markdown

@claude claude Bot left a comment

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
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

❌ Patch coverage is 71.62162% with 63 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.79%. Comparing base (a52e4ff) to head (b4decac).
⚠️ Report is 22 commits behind head on main.

Files with missing lines Patch % Lines
server/service/labels.go 73.33% 22 Missing and 18 partials ⚠️
server/service/hosts.go 67.56% 6 Missing and 6 partials ⚠️
...d/fleetctl/fleetctl/testing_utils/testing_utils.go 25.00% 3 Missing and 3 partials ⚠️
...vityFeed/GlobalActivityItem/GlobalActivityItem.tsx 85.71% 3 Missing ⚠️
server/datastore/mysql/labels.go 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #44522      +/-   ##
==========================================
+ Coverage   66.76%   66.79%   +0.02%     
==========================================
  Files        2636     2637       +1     
  Lines      211834   212348     +514     
  Branches     9425     9449      +24     
==========================================
+ Hits       141437   141833     +396     
- Misses      57551    57617      +66     
- Partials    12846    12898      +52     
Flag Coverage Δ
backend 68.56% <70.14%> (+0.01%) ⬆️
frontend 54.80% <85.71%> (+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.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

Walkthrough

Adds activity generation for label lifecycle events by introducing three new activity detail types (created_label, edited_label, deleted_label). Backend: new datastore method to fetch label membership host IDs, datastore interface and mock extensions, service logic to emit activities on label create/modify/delete, host label add/remove, and ApplyLabelSpecs comparisons to detect semantic changes before emitting activities. Frontend: new activity types, extended activity detail fields, filter mappings, UI templates, and tests to render label activities. Tests and GitOps integration updated to capture and validate emitted label activities.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.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 title accurately reflects the main objective of the PR: adding activity logging for label user actions (create, edit, delete).
Description check ✅ Passed The PR description follows the template with required sections marked, including changes file, testing (automated tests and QA), but omits most optional checklist items that don't apply.
Linked Issues check ✅ Passed The code changes comprehensively implement the linked issue #36976 requirements: activity generation for label create/edit/delete across UI and GitOps paths for global and team labels.
Out of Scope Changes check ✅ Passed All changes are tightly scoped to label activity generation and directly support the PR objective with no unrelated modifications detected.

✏️ 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 36976-activities-for-labels

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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/hosts.go`:
- Around line 3629-3673: emitEditedLabelActivities can emit duplicate activities
when labelNames contains duplicates; before the final loop over labelNames
deduplicate them (e.g., build a seen map[string]bool and either produce an
ordered slice of unique names or skip repeats during iteration) so you only call
svc.NewActivity once per distinct label name; use the existing labels map lookup
(labels[name]) and keep the rest of the logic (fleetName resolution,
svc.NewActivity) unchanged.

In `@server/service/labels.go`:
- Around line 816-827: The function labelSpecMatchesLabel currently ignores
platform-only changes so add a platform comparison to detect those edits: in
labelSpecMatchesLabel (params *fleet.LabelSpec, *fleet.Label) compare
spec.Platforms (or spec.Platform) with label.Platforms (or label.Platform) and
return false when they differ; for slice fields use a slice-equality check
(e.g., reflect.DeepEqual) and place this check before the HostVitalsCriteria
comparison so platform-only changes cause the function to return false and
trigger edited_label activity.
🪄 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: 9532040c-16de-4191-9777-6514d20c3a30

📥 Commits

Reviewing files that changed from the base of the PR and between f94b66f and 287b4d9.

📒 Files selected for processing (15)
  • changes/36976-activities-for-labels
  • cmd/fleetctl/fleetctl/apply_test.go
  • cmd/fleetctl/fleetctl/testing_utils/testing_utils.go
  • cmd/fleetctl/integrationtest/gitops/gitops_enterprise_integration_test.go
  • frontend/interfaces/activity.ts
  • frontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tests.tsx
  • frontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tsx
  • server/datastore/mysql/labels.go
  • server/datastore/mysql/labels_test.go
  • server/fleet/activities.go
  • server/fleet/datastore.go
  • server/mock/datastore_mock.go
  • server/service/hosts.go
  • server/service/labels.go
  • server/service/labels_test.go

Comment thread server/service/hosts.go
Comment thread server/service/labels.go
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adds first-class activity feed events for label lifecycle changes (create/edit/delete) across UI actions, GitOps spec apply, and host manual-label membership changes, and renders those new activities in the Dashboard Activity Feed.

Changes:

  • Add new activity types: created_label, edited_label, deleted_label, and emit them from relevant service paths (label CRUD, ApplyLabelSpecs, add/remove labels on host).
  • Add unfiltered label membership host-ID lookup to support “manual label hosts changed” detection during GitOps apply.
  • Update frontend activity feed templates/types/tests to display and filter the new label activities.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
server/service/labels.go Emits label activities on create/edit/delete and GitOps spec apply, including change detection helpers.
server/service/hosts.go Emits edited_label activities when manual labels are added/removed from a host.
server/fleet/activities.go Registers new activity detail types for label actions.
server/fleet/datastore.go Extends datastore interface with LabelMembershipHostIDs.
server/mock/datastore_mock.go Adds mock support for LabelMembershipHostIDs.
server/datastore/mysql/labels.go Implements LabelMembershipHostIDs in MySQL datastore.
server/datastore/mysql/labels_test.go Adds datastore test coverage for unfiltered membership lookup.
server/service/labels_test.go Adds/updates unit tests verifying label activity emission paths.
frontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tsx Renders new label activities in the global activity feed.
frontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tests.tsx Adds frontend test coverage for new activity renderings.
frontend/interfaces/activity.ts Adds new activity enum values, details fields, and filter-label mappings.
cmd/fleetctl/integrationtest/gitops/gitops_enterprise_integration_test.go Adds GitOps integration test that validates per-label activities across create/edit/no-op/delete scenarios.
cmd/fleetctl/fleetctl/testing_utils/testing_utils.go Extends default mocked DS behavior to support new ApplyLabelSpecs activity detection paths.
cmd/fleetctl/fleetctl/apply_test.go Adjusts invocation tracking for LabelsByName to account for new calls.
changes/36976-activities-for-labels Adds user-visible change entry for the new label activities.

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

Comment thread server/service/labels.go
Comment thread server/fleet/activities.go
Comment thread server/service/labels.go Outdated
Comment thread server/service/labels.go Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

816-827: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Compare platform in spec-vs-label matching to avoid missing real edit activities.

Platform-only GitOps updates currently evaluate as unchanged, so edited_label is not emitted for a real label edit.

Suggested fix
 func labelSpecMatchesLabel(spec *fleet.LabelSpec, label *fleet.Label) bool {
 	if spec.Description != label.Description {
 		return false
 	}
+	if spec.Platform != label.Platform {
+		return false
+	}
 	if spec.Query != label.Query {
 		return false
 	}
 	if spec.LabelMembershipType != label.LabelMembershipType {
 		return false
 	}
 	return jsonRawMessageEqual(spec.HostVitalsCriteria, label.HostVitalsCriteria)
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@server/service/labels.go` around lines 816 - 827, The labelSpecMatchesLabel
function currently omits comparing the platform fields, causing platform-only
GitOps updates to be treated as unchanged; update labelSpecMatchesLabel (used to
detect edits) to also compare spec.Platform with label.Platform (e.g.,
spec.Platform != label.Platform) as part of the equality checks so that a
difference in platform triggers a non-match and allows edited_label to be
emitted.
🤖 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/service/labels.go`:
- Around line 816-827: The labelSpecMatchesLabel function currently omits
comparing the platform fields, causing platform-only GitOps updates to be
treated as unchanged; update labelSpecMatchesLabel (used to detect edits) to
also compare spec.Platform with label.Platform (e.g., spec.Platform !=
label.Platform) as part of the equality checks so that a difference in platform
triggers a non-match and allows edited_label to be emitted.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 48c97a94-7090-47de-94d4-825eaff8a13f

📥 Commits

Reviewing files that changed from the base of the PR and between 287b4d9 and de8db29.

📒 Files selected for processing (2)
  • cmd/fleetctl/integrationtest/gitops/gitops_enterprise_integration_test.go
  • server/service/labels.go

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
server/service/labels.go (1)

195-230: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Skip edited_label for no-op ModifyLabel requests.

This path now emits an edit activity even when the payload doesn't change the label at all (empty payload, same name/description, same manual host set). That will create false audit entries and is inconsistent with the semantic no-op check added in ApplyLabelSpecs. Compare against the pre-update state and return without SaveLabel/NewActivity when nothing changed.

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

In `@server/service/labels.go` around lines 195 - 230, The ModifyLabel flow
currently always calls SaveLabel and NewActivity even when the incoming payload
makes no changes; update the logic in the ModifyLabel handler to first compute
whether any actual changes would occur (compare the incoming payload fields —
name, description, label.LabelMembershipType, and the resolved hostIDs — against
the existing label state and its current membership set obtained from the DS),
and if nothing would change, return early without calling
svc.ds.UpdateLabelMembershipByHostIDs, svc.ds.SaveLabel, or svc.NewActivity;
reuse the existing variables (label, payload, hostIDs, savedHostIDs) and the
same filter/context so the check mirrors ApplyLabelSpecs behavior and only
proceeds to UpdateLabelMembershipByHostIDs/SaveLabel/NewActivity when a real
change is detected.
server/service/hosts.go (1)

3581-3585: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Only emit edited_label when the host's membership actually changed.

Both paths now log an edit for every requested label name, even when the datastore write is a no-op (for example, adding a label the host already has or removing one it never had). That makes the activity feed inaccurate and easy to spam. Capture the host's label set before the write and emit activities only for labels whose membership changed.

Also applies to: 3621-3625

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

In `@server/service/hosts.go` around lines 3581 - 3585, Before calling
svc.ds.AddLabelsToHost, read the host's current label membership (e.g., via
host.LabelIDs or a datastore reader like svc.ds.GetLabelsForHost) and compute
which of the requested labelIDs/labelNames will actually change membership;
after the AddLabelsToHost call only invoke svc.emitEditedLabelActivities with
the subset of labelNames that were added or removed (i.e., whose membership
toggled). Apply the same change to the other occurrence around
svc.ds.RemoveLabelsFromHost / the block referenced at 3621-3625 so
emitEditedLabelActivities is only called for labels with actual membership
changes.
🧹 Nitpick comments (1)
cmd/fleetctl/integrationtest/gitops/gitops_enterprise_integration_test.go (1)

3382-3539: ⚡ Quick win

Cover the remaining team-scoped label types in this GitOps activity test.

This test only exercises team label activities with a dynamic label. The PR scope also includes team-scoped manual and host_vitals/IdP-created labels, so a regression in either path would still pass here.

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

In `@cmd/fleetctl/integrationtest/gitops/gitops_enterprise_integration_test.go`
around lines 3382 - 3539, The test currently only exercises team-scoped dynamic
labels; extend it to cover team-scoped manual and host_vitals/IdP-created label
flows by adding parallel phases that call writeTeam (in addition to writeGlobal)
to create a team manual label (with hosts list) and a team host_vitals label
(with criteria), then run apply() and flush() and assert the emitted activities
include ActivityTypeCreatedLabel, ActivityTypeEditedLabel and
ActivityTypeDeletedLabel for those team labels (verifying FleetID/FleetName
presence for team-scoped activities), and also include no-op re-apply checks and
edits (change query -> change hosts -> change criteria) using the same pattern
as existing global label phases; locate changes around the existing
writeTeam/writeGlobal/apply/flush sequences and reuse the same assertions that
check types (ActivityTypeCreatedLabel, ActivityTypeEditedLabel,
ActivityTypeDeletedLabel) and name membership to ensure team manual and
host_vitals paths are covered.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@server/service/hosts.go`:
- Around line 3581-3585: Before calling svc.ds.AddLabelsToHost, read the host's
current label membership (e.g., via host.LabelIDs or a datastore reader like
svc.ds.GetLabelsForHost) and compute which of the requested labelIDs/labelNames
will actually change membership; after the AddLabelsToHost call only invoke
svc.emitEditedLabelActivities with the subset of labelNames that were added or
removed (i.e., whose membership toggled). Apply the same change to the other
occurrence around svc.ds.RemoveLabelsFromHost / the block referenced at
3621-3625 so emitEditedLabelActivities is only called for labels with actual
membership changes.

In `@server/service/labels.go`:
- Around line 195-230: The ModifyLabel flow currently always calls SaveLabel and
NewActivity even when the incoming payload makes no changes; update the logic in
the ModifyLabel handler to first compute whether any actual changes would occur
(compare the incoming payload fields — name, description,
label.LabelMembershipType, and the resolved hostIDs — against the existing label
state and its current membership set obtained from the DS), and if nothing would
change, return early without calling svc.ds.UpdateLabelMembershipByHostIDs,
svc.ds.SaveLabel, or svc.NewActivity; reuse the existing variables (label,
payload, hostIDs, savedHostIDs) and the same filter/context so the check mirrors
ApplyLabelSpecs behavior and only proceeds to
UpdateLabelMembershipByHostIDs/SaveLabel/NewActivity when a real change is
detected.

---

Nitpick comments:
In `@cmd/fleetctl/integrationtest/gitops/gitops_enterprise_integration_test.go`:
- Around line 3382-3539: The test currently only exercises team-scoped dynamic
labels; extend it to cover team-scoped manual and host_vitals/IdP-created label
flows by adding parallel phases that call writeTeam (in addition to writeGlobal)
to create a team manual label (with hosts list) and a team host_vitals label
(with criteria), then run apply() and flush() and assert the emitted activities
include ActivityTypeCreatedLabel, ActivityTypeEditedLabel and
ActivityTypeDeletedLabel for those team labels (verifying FleetID/FleetName
presence for team-scoped activities), and also include no-op re-apply checks and
edits (change query -> change hosts -> change criteria) using the same pattern
as existing global label phases; locate changes around the existing
writeTeam/writeGlobal/apply/flush sequences and reuse the same assertions that
check types (ActivityTypeCreatedLabel, ActivityTypeEditedLabel,
ActivityTypeDeletedLabel) and name membership to ensure team manual and
host_vitals paths are covered.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0196fe1e-47b0-4d05-b05b-f4de04af5baf

📥 Commits

Reviewing files that changed from the base of the PR and between de8db29 and b4decac.

📒 Files selected for processing (4)
  • cmd/fleetctl/integrationtest/gitops/gitops_enterprise_integration_test.go
  • server/service/hosts.go
  • server/service/labels.go
  • server/service/labels_test.go

@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 a Go integration test failed: cmd/fleetctl/integrationtest/vuln
TestIntegrationsVulnerabilityDataStream (reported at vulnerability_data_stream_test.go:44).
The test
repeatedly attempted to download Ubuntu OVAL definitions from
https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2 but could not
establish a reliable network connection (errors included i/o timeout, connection refused, connection
reset by peer, and TLS handshake timeout).
After retries, the download ultimately timed out and the
test returned Error downloading Oval definitions, 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
...

1686:  �[36;1mattempt=1�[0m
1687:  �[36;1m�[0m
1688:  �[36;1mwhile [ $attempt -le $max_attempts ]; do�[0m
1689:  �[36;1m  echo "Attempt $attempt of $max_attempts"�[0m
1690:  �[36;1m�[0m
1691:  �[36;1m  # Try to connect to MySQL�[0m
1692:  �[36;1m  if wait_for_mysql "mysql_test"; then�[0m
1693:  �[36;1m    # If MySQL is ready, try to connect to MySQL replica�[0m
1694:  �[36;1m    if wait_for_mysql "mysql_replica_test"; then�[0m
1695:  �[36;1m      # Both are ready, we're done�[0m
1696:  �[36;1m      echo "All MySQL connections successful"�[0m
1697:  �[36;1m      exit 0�[0m
1698:  �[36;1m    fi�[0m
1699:  �[36;1m  fi�[0m
1700:  �[36;1m�[0m
1701:  �[36;1m  # If we get here, at least one connection failed�[0m
1702:  �[36;1m  echo "Failed to connect to MySQL on attempt $attempt"�[0m
1703:  �[36;1m�[0m
1704:  �[36;1m  if [ $attempt -lt $max_attempts ]; then�[0m
1705:  �[36;1m    echo "Restarting containers and trying again..."�[0m
1706:  �[36;1m    restart_containers�[0m
1707:  �[36;1m  else�[0m
1708:  �[36;1m    echo "Maximum attempts reached. Failing the job."�[0m
1709:  �[36;1m    exit 1�[0m
...

1801:  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/... 
1802:  go: downloading github.com/urfave/cli/v2 v2.27.7
1803:  go: downloading github.com/stretchr/testify v1.11.1
1804:  go: downloading github.com/AbGuthrie/goquery/v2 v2.0.1
1805:  go: downloading github.com/go-git/go-git/v5 v5.18.0
1806:  go: downloading github.com/beevik/etree v1.6.0
1807:  go: downloading github.com/briandowns/spinner v1.23.1
1808:  go: downloading github.com/google/go-github/v37 v37.0.0
1809:  go: downloading github.com/gosuri/uilive v0.0.4
1810:  go: downloading github.com/manifoldco/promptui v0.9.0
1811:  go: downloading github.com/mitchellh/go-ps v1.0.0
1812:  go: downloading github.com/olekukonko/tablewriter v0.0.5
1813:  go: downloading github.com/sethvargo/go-password v0.3.0
1814:  go: downloading github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
1815:  go: downloading github.com/patrickmn/go-cache v2.1.0+incompatible
1816:  go: downloading github.com/hashicorp/go-multierror v1.1.1
1817:  go: downloading github.com/davecgh/go-spew v1.1.1
...

2066:  �[32m✓�[0m Apply specs deprecated keys app config windows updates.grace period days not a number (0.32s)
2067:  �[32m✓�[0m Apply specs deprecated keys app config windows updates.grace period days out of range (0.34s)
2068:  �[32m✓�[0m Apply specs deprecated keys config with FIM values for agent options (#869 9) (0.40s)
2069:  �[32m✓�[0m Apply specs deprecated keys config with blank required org name (0.37s)
2070:  �[32m✓�[0m Apply specs deprecated keys config with blank required server url (0.33s)
2071:  �[32m✓�[0m Apply specs deprecated keys config with invalid agent options command-line flags (0.35s)
2072:  �[32m✓�[0m Apply specs deprecated keys config with invalid agent options data type in dry-run (0.37s)
2073:  �[32m✓�[0m Apply specs deprecated keys config with invalid agent options data type with force (0.34s)
2074:  �[32m✓�[0m Apply specs deprecated keys config with invalid agent options in dry-run (0.28s)
2075:  �[32m✓�[0m Apply specs deprecated keys config with invalid key type (0.40s)
2076:  �[32m✓�[0m Apply specs deprecated keys config with invalid value for agent options command-line flags (0.38s)
2077:  �[32m✓�[0m Apply specs deprecated keys config with unknown key (0.48s)
2078:  �[32m✓�[0m Apply specs deprecated keys config with valid agent options command-line flags (0.31s)
2079:  �[32m✓�[0m Apply specs deprecated keys dry-run set with unsupported spec (0.44s)
2080:  �[32m✓�[0m Apply specs deprecated keys dry-run set with various specs, appconfig warning for legacy (0.40s)
2081:  �[32m✓�[0m Apply specs deprecated keys dry-run set with various specs, no errors (0.28s)
2082:  �[32m✓�[0m Apply specs deprecated keys empty config (0.40s)
...

2085:  �[32m✓�[0m Apply specs deprecated keys invalid agent options dry-run (0.48s)
2086:  �[32m✓�[0m Apply specs deprecated keys invalid agent options field type (0.31s)
2087:  �[32m✓�[0m Apply specs deprecated keys invalid agent options field type in overrides (0.35s)
2088:  �[32m✓�[0m Apply specs deprecated keys invalid agent options for existing team (0.40s)
2089:  �[32m✓�[0m Apply specs deprecated keys invalid agent options for new team (0.36s)
2090:  �[32m✓�[0m Apply specs deprecated keys invalid agent options force (0.39s)
2091:  �[32m✓�[0m Apply specs deprecated keys invalid known key's value type for team cannot be forced (0.60s)
2092:  �[32m✓�[0m Apply specs deprecated keys invalid team agent options command-line flag (0.35s)
2093:  �[32m✓�[0m Apply specs deprecated keys invalid top-level key for team (0.48s)
2094:  �[32m✓�[0m Apply specs deprecated keys macos updates deadline set but minimum version empty (0.31s)
2095:  �[32m✓�[0m Apply specs deprecated keys macos updates minimum version set but deadline empty (0.30s)
2096:  �[32m✓�[0m Apply specs deprecated keys macos updates.deadline with incomplete date (0.49s)
2097:  �[32m✓�[0m Apply specs deprecated keys macos updates.deadline with invalid date (0.58s)
2098:  �[32m✓�[0m Apply specs deprecated keys macos updates.deadline with timestamp (0.40s)
2099:  �[32m✓�[0m Apply specs deprecated keys macos updates.minimum version with build version (0.50s)
2100:  �[32m✓�[0m Apply specs deprecated keys missing required failing policies destination url (0.60s)
2101:  �[32m✓�[0m Apply specs deprecated keys missing required host status days count (0.44s)
...

2109:  �[32m✓�[0m Apply specs deprecated keys team config macos settings.enable disk encryption true (0.36s)
2110:  �[32m✓�[0m Apply specs deprecated keys team config macos settings.enable disk encryption with invalid value type (0.31s)
2111:  �[32m✓�[0m Apply specs deprecated keys team config macos settings.enable disk encryption without a value (0.36s)
2112:  �[32m✓�[0m Apply specs deprecated keys unknown key for team can be forced (0.42s)
2113:  �[32m✓�[0m Apply specs deprecated keys valid team agent options command-line flag (0.35s)
2114:  �[32m✓�[0m Apply specs deprecated keys windows updates unset valid (0.42s)
2115:  �[32m✓�[0m Apply specs deprecated keys windows updates valid (0.45s)
2116:  �[32m✓�[0m Apply specs deprecated keys windows updates.deadline days but grace period empty (0.33s)
2117:  �[32m✓�[0m Apply specs deprecated keys windows updates.deadline days not a number (0.37s)
2118:  �[32m✓�[0m Apply specs deprecated keys windows updates.deadline days out of range (0.32s)
2119:  �[32m✓�[0m Apply specs deprecated keys windows updates.grace period days but deadline empty (0.35s)
2120:  �[32m✓�[0m Apply specs deprecated keys windows updates.grace period days not a number (0.41s)
2121:  �[32m✓�[0m Apply specs deprecated keys windows updates.grace period days out of range (0.41s)
2122:  �[32m✓�[0m Apply specs dry-run set with unsupported spec (0.39s)
2123:  �[32m✓�[0m Apply specs dry-run set with various specs, appconfig warning for legacy (0.31s)
2124:  �[32m✓�[0m Apply specs dry-run set with various specs, no errors (0.40s)
2125:  �[32m✓�[0m Apply specs empty config (0.35s)
...

2128:  �[32m✓�[0m Apply specs invalid agent options dry-run (0.28s)
2129:  �[32m✓�[0m Apply specs invalid agent options field type (0.36s)
2130:  �[32m✓�[0m Apply specs invalid agent options field type in overrides (0.34s)
2131:  �[32m✓�[0m Apply specs invalid agent options for existing team (0.50s)
2132:  �[32m✓�[0m Apply specs invalid agent options for new team (0.33s)
2133:  �[32m✓�[0m Apply specs invalid agent options force (0.47s)
2134:  �[32m✓�[0m Apply specs invalid known key's value type for team cannot be forced (0.33s)
2135:  �[32m✓�[0m Apply specs invalid team agent options command-line flag (0.33s)
2136:  �[32m✓�[0m Apply specs invalid top-level key for team (0.38s)
2137:  �[32m✓�[0m Apply specs macos updates deadline set but minimum version empty (0.40s)
2138:  �[32m✓�[0m Apply specs macos updates minimum version set but deadline empty (0.40s)
2139:  �[32m✓�[0m Apply specs macos updates.deadline with incomplete date (0.35s)
2140:  �[32m✓�[0m Apply specs macos updates.deadline with invalid date (0.43s)
2141:  �[32m✓�[0m Apply specs macos updates.deadline with timestamp (0.34s)
2142:  �[32m✓�[0m Apply specs macos updates.minimum version with build version (0.36s)
2143:  �[32m✓�[0m Apply specs missing required failing policies destination url (0.42s)
2144:  �[32m✓�[0m Apply specs missing required host status days count (0.35s)
...

2230:  �[32m✓�[0m Filename functions (0.00s)
2231:  �[32m✓�[0m Filename functions outfile name builds a file name using the name provided + current time (0.00s)
2232:  �[32m✓�[0m Filename functions outfile name with ext builds a file name using the name and extension provided + current time (0.00s)
2233:  �[32m✓�[0m FleetctlUpgradePacks empty packs (0.31s)
2234:  �[32m✓�[0m FleetctlUpgradePacks no pack (0.39s)
2235:  �[32m✓�[0m FleetctlUpgradePacks non empty (0.33s)
2236:  �[32m✓�[0m FleetctlUpgradePacks not admin (0.30s)
2237:  �[32m✓�[0m Format XML (0.00s)
2238:  �[32m✓�[0m Format XML XML with attributes (0.00s)
2239:  �[32m✓�[0m Format XML basic XML (0.00s)
2240:  �[32m✓�[0m Format XML empty XML (0.00s)
2241:  �[32m✓�[0m Format XML invalid XML (0.00s)
2242:  �[32m✓�[0m Format XML nested XML (0.00s)
2243:  �[32m✓�[0m Generate MDM apple (0.56s)
2244:  �[32m✓�[0m Generate MDM apple BM (0.34s)
2245:  �[32m✓�[0m Generate MDM apple CSR API call fails (0.29s)
2246:  �[32m✓�[0m Generate MDM apple successful run (0.27s)
2247:  �[32m✓�[0m Generate MDMVPP tokens (0.00s)
2248:  �[32m✓�[0m Generate MDMVPP tokens get VPP tokens error (0.00s)
2249:  �[32m✓�[0m Generate MDMVPP tokens multiple tokens with different teams (0.00s)
...

2261:  �[32m✓�[0m Generate org settings insecure (0.00s)
2262:  �[32m✓�[0m Generate org settings masked google calendar api key (0.00s)
2263:  �[32m✓�[0m Generate policies (0.00s)
2264:  �[32m✓�[0m Generate queries (0.00s)
2265:  �[32m✓�[0m Generate software (0.00s)
2266:  �[32m✓�[0m Generate software auto update schedule (0.00s)
2267:  �[32m✓�[0m Generate software script packages (0.00s)
2268:  �[32m✓�[0m Generate team settings (0.00s)
2269:  �[32m✓�[0m Generate team settings insecure (0.00s)
2270:  �[32m✓�[0m Generated org settings no SSO (0.00s)
2271:  �[32m✓�[0m Generated org settings okta conditional access not included (0.00s)
2272:  �[32m✓�[0m Get MDM command results (0.45s)
2273:  �[32m✓�[0m Get MDM command results command flag required (0.00s)
2274:  �[32m✓�[0m Get MDM command results command not found (0.01s)
2275:  �[32m✓�[0m Get MDM command results command results empty (0.01s)
2276:  �[32m✓�[0m Get MDM command results command results error (0.01s)
2277:  �[32m✓�[0m Get MDM command results darwin command results (0.00s)
2278:  �[32m✓�[0m Get MDM command results host specific results (0.01s)
2279:  �[32m✓�[0m Get MDM command results windows command results (0.00s)
2280:  �[32m✓�[0m Get MDM commands (0.46s)
2281:  �[32m✓�[0m Get apple BM (1.53s)
2282:  �[32m✓�[0m Get apple BM free license (0.39s)
2283:  �[32m✓�[0m Get apple BM premium license, multiple tokens (0.36s)
2284:  �[32m✓�[0m Get apple BM premium license, no token (0.41s)
2285:  �[32m✓�[0m Get apple BM premium license, single token (0.35s)
2286:  �[32m✓�[0m Get apple MDM (0.32s)
2287:  �[32m✓�[0m Get carve (0.27s)
2288:  �[32m✓�[0m Get carve with error (0.31s)
2289:  �[32m✓�[0m Get carves (0.27s)
...

2315:  �[32m✓�[0m Get queries as observer (0.48s)
2316:  �[32m✓�[0m Get queries as observer global observer (0.01s)
2317:  �[32m✓�[0m Get queries as observer observer of multiple teams (0.01s)
2318:  �[32m✓�[0m Get queries as observer team observer (0.01s)
2319:  �[32m✓�[0m Get query (0.39s)
2320:  �[32m✓�[0m Get software titles (0.43s)
2321:  �[32m✓�[0m Get software versions (0.40s)
2322:  �[32m✓�[0m Get teams (0.67s)
2323:  �[32m✓�[0m Get teams YAML and apply (0.27s)
2324:  �[32m✓�[0m Get teams by name (0.31s)
2325:  �[32m✓�[0m Get teams expired license (0.34s)
2326:  �[32m✓�[0m Get teams not expired license (0.33s)
2327:  �[32m✓�[0m Get user roles (0.39s)
2328:  �[32m✓�[0m Git ops ABM (5.01s)
2329:  �[32m✓�[0m Git ops ABM backwards compat (0.52s)
2330:  �[32m✓�[0m Git ops ABM both keys errors (0.39s)
2331:  �[32m✓�[0m Git ops ABM deprecated config with two tokens in the db fails (0.48s)
2332:  �[32m✓�[0m Git ops ABM new key all valid (0.49s)
2333:  �[32m✓�[0m Git ops ABM new key multiple elements (0.50s)
2334:  �[32m✓�[0m Git ops ABM no team is supported (0.51s)
2335:  �[32m✓�[0m Git ops ABM non existent org name fails (0.51s)
2336:  �[32m✓�[0m Git ops ABM not provided teams defaults to no team (0.54s)
2337:  �[32m✓�[0m Git ops ABM renamed new key all valid (0.57s)
2338:  �[32m✓�[0m Git ops ABM using an undefined team errors (0.50s)
2339:  �[32m✓�[0m Git ops EULA setting (3.59s)
...

2342:  �[32m✓�[0m Git ops EULA setting not a PDF file (0.53s)
2343:  �[32m✓�[0m Git ops EULA setting relative path to working dir to pdf file (no existing EULA uploaded) (0.47s)
2344:  �[32m✓�[0m Git ops EULA setting relative path to yaml file to pdf file (no existing EULA uploaded) (0.43s)
2345:  �[32m✓�[0m Git ops EULA setting uploading the same EULA again (0.37s)
2346:  �[32m✓�[0m Git ops EULA setting valid new pdf file (different EULA already uploaded) (0.48s)
2347:  �[32m✓�[0m Git ops EULA setting valid pdf file (no existing EULA uploaded) (0.42s)
2348:  �[32m✓�[0m Git ops MDM auth settings (0.45s)
2349:  �[32m✓�[0m Git ops SMTP settings (0.43s)
2350:  �[32m✓�[0m Git ops SSO server URL (0.41s)
2351:  �[32m✓�[0m Git ops SSO settings (0.48s)
2352:  �[32m✓�[0m Git ops android certificates add (0.49s)
2353:  �[32m✓�[0m Git ops android certificates change (0.53s)
2354:  �[32m✓�[0m Git ops android certificates delete all (0.45s)
2355:  �[32m✓�[0m Git ops android certificates delete one (0.40s)
2356:  �[32m✓�[0m Git ops app store app auto update (0.34s)
2357:  �[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.01s)
2358:  �[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.01s)
...

2361:  �[32m✓�[0m Git ops apple OS updates (0.43s)
2362:  �[32m✓�[0m Git ops apple OS updates ios updates (0.04s)
2363:  �[32m✓�[0m Git ops apple OS updates ios updates changed deadline triggers bulk set pending MDM host profiles (0.02s)
2364:  �[32m✓�[0m Git ops apple OS updates ios updates changed minimum version triggers bulk set pending MDM host profiles (0.01s)
2365:  �[32m✓�[0m Git ops apple OS updates ios updates same values do not trigger bulk set pending MDM host profiles (0.01s)
2366:  �[32m✓�[0m Git ops apple OS updates ipados updates (0.04s)
2367:  �[32m✓�[0m Git ops apple OS updates ipados updates changed deadline triggers bulk set pending MDM host profiles (0.02s)
2368:  �[32m✓�[0m Git ops apple OS updates ipados updates changed minimum version triggers bulk set pending MDM host profiles (0.01s)
2369:  �[32m✓�[0m Git ops apple OS updates ipados updates same values do not trigger bulk set pending MDM host profiles (0.01s)
2370:  �[32m✓�[0m Git ops apple OS updates macos updates (0.04s)
2371:  �[32m✓�[0m Git ops apple OS updates macos updates changed deadline triggers bulk set pending MDM host profiles (0.01s)
2372:  �[32m✓�[0m Git ops apple OS updates macos updates changed minimum version triggers bulk set pending MDM host profiles (0.01s)
2373:  �[32m✓�[0m Git ops apple OS updates macos updates same values do not trigger bulk set pending MDM host profiles (0.01s)
2374:  �[32m✓�[0m Git ops basic global and no team (0.41s)
2375:  �[32m✓�[0m Git ops basic global and no team basic global and no-team.yml (0.04s)
2376:  �[32m✓�[0m Git ops basic global and no team both global and no-team.yml define controls -- should fail (0.01s)
2377:  �[32m✓�[0m Git ops basic global and no team controls only defined in no-team.yml (0.04s)
2378:  �[32m✓�[0m Git ops basic global and no team global DOES NOT define controls -- should fail (0.01s)
2379:  �[32m✓�[0m Git ops basic global and no team global and no-team.yml DO NOT define controls -- should fail (0.01s)
2380:  �[32m✓�[0m Git ops basic global and no team global defines software -- should fail (0.01s)
2381:  �[32m✓�[0m Git ops basic global and no team no-team provided without global -- should fail (0.01s)
2382:  �[32m✓�[0m Git ops basic global and no team no-team.yml defines policy with calendar events enabled -- should fail (0.01s)
2383:  �[32m✓�[0m Git ops basic global and no team unassigned provided without global -- should fail (0.01s)
2384:  �[32m✓�[0m Git ops basic global and team (0.47s)
...

2389:  �[32m✓�[0m Git ops custom settings global macos custom settings valid deprecated.yml (0.41s)
2390:  �[32m✓�[0m Git ops custom settings global macos windows custom settings valid.yml (0.42s)
2391:  �[32m✓�[0m Git ops custom settings global windows custom settings invalid label mix 2 .yml (0.35s)
2392:  �[32m✓�[0m Git ops custom settings global windows custom settings invalid label mix.yml (0.37s)
2393:  �[32m✓�[0m Git ops custom settings global windows custom settings unknown label.yml (0.49s)
2394:  �[32m✓�[0m Git ops custom settings team macos custom settings valid deprecated.yml (0.46s)
2395:  �[32m✓�[0m Git ops custom settings team macos windows custom settings invalid labels mix 2 .yml (0.35s)
2396:  �[32m✓�[0m Git ops custom settings team macos windows custom settings invalid labels mix.yml (0.36s)
2397:  �[32m✓�[0m Git ops custom settings team macos windows custom settings unknown label.yml (0.34s)
2398:  �[32m✓�[0m Git ops custom settings team macos windows custom settings valid.yml (0.49s)
2399:  �[32m✓�[0m Git ops exception enforcement (0.38s)
2400:  �[32m✓�[0m Git ops exception enforcement free tier (0.39s)
2401:  �[32m✓�[0m Git ops exceptions preserve omitted keys (0.31s)
2402:  �[32m✓�[0m Git ops features (0.49s)
2403:  �[32m✓�[0m Git ops filename validation (0.00s)
2404:  �[32m✓�[0m Git ops fleet failing policies webhook policy IDs (0.56s)
2405:  �[32m✓�[0m Git ops fleet webhooks and tickets enabled (0.45s)
...

2560:  �[32m✓�[0m Run api command get scripts full path missing (0.00s)
2561:  �[32m✓�[0m Run api command get scripts team (0.00s)
2562:  �[32m✓�[0m Run api command get scripts team no cache (0.00s)
2563:  �[32m✓�[0m Run api command get typo (0.00s)
2564:  �[32m✓�[0m Run api command upload script (0.00s)
2565:  �[32m✓�[0m Run script command (0.44s)
2566:  �[32m✓�[0m Run script command disabled scripts globally (0.00s)
2567:  �[32m✓�[0m Run script command host not found (0.00s)
2568:  �[32m✓�[0m Run script command invalid file type (0.00s)
2569:  �[32m✓�[0m Run script command invalid hashbang (0.00s)
2570:  �[32m✓�[0m Run script command invalid utf 8 (0.01s)
2571:  �[32m✓�[0m Run script command missing one of script-path and script-nqme (0.00s)
2572:  �[32m✓�[0m Run script command output truncated (0.00s)
2573:  �[32m✓�[0m Run script command posix shell hashbang (0.00s)
2574:  �[32m✓�[0m Run script command script empty (0.01s)
2575:  �[32m✓�[0m Run script command script failed (0.00s)
2576:  �[32m✓�[0m Run script command script killed (0.00s)
...

2612:  �[32m✓�[0m User create force password reset (0.41s)
2613:  �[32m✓�[0m User delete (0.34s)
2614:  �[32m✓�[0m User is observer (0.00s)
2615:  �[32m✓�[0m User is observer global maintainer (0.00s)
2616:  �[32m✓�[0m User is observer global observer (0.00s)
2617:  �[32m✓�[0m User is observer global observer+ (0.00s)
2618:  �[32m✓�[0m User is observer team maintainer (0.00s)
2619:  �[32m✓�[0m User is observer team observer (0.00s)
2620:  �[32m✓�[0m User is observer team observer and maintainer (0.00s)
2621:  �[32m✓�[0m User is observer team observer+ (0.00s)
2622:  �[32m✓�[0m User is observer user without roles (0.00s)
2623:  github.com/fleetdm/fleet/v4/cmd/fleetctl/integrationtest/vuln:
2624:  �[31m✖�[0m Integrations vulnerability data stream (308.12s)
2625:  github.com/fleetdm/fleet/v4/cmd/fleetctl/integrationtest/preview:
2626:  �[32m✓�[0m Integrations preview (409.22s)
2627:  �[32m✓�[0m Preview fails on invalid license key (0.00s)
2628:  github.com/fleetdm/fleet/v4/cmd/fleetctl/integrationtest/gitops:
2629:  �[32m✓�[0m Git ops VPP (3.50s)
2630:  �[32m✓�[0m Git ops VPP all teams is supported (0.44s)
2631:  �[32m✓�[0m Git ops VPP new key all valid (0.45s)
2632:  �[32m✓�[0m Git ops VPP new key multiple elements (0.53s)
2633:  �[32m✓�[0m Git ops VPP no team is supported (0.57s)
2634:  �[32m✓�[0m Git ops VPP non existent location fails (0.42s)
2635:  �[32m✓�[0m Git ops VPP not provided teams defaults to no team (0.54s)
2636:  �[32m✓�[0m Git ops VPP using an undefined team errors (0.56s)
2637:  �[32m✓�[0m Git ops existing team VPP apps with missing team (0.49s)
...

2717:  �[32m✓�[0m Git ops team software installers team software installer with display name.yml (1.74s)
2718:  �[32m✓�[0m Integrations enterprise gitops (305.10s)
2719:  �[32m✓�[0m Integrations enterprise gitops test CA integrations (3.94s)
2720:  �[32m✓�[0m Integrations enterprise gitops test FMA labels include all (6.54s)
2721:  �[32m✓�[0m Integrations enterprise gitops test IPA software installers (10.53s)
2722:  �[32m✓�[0m Integrations enterprise gitops test JSON configuration profile escaping (1.38s)
2723:  �[32m✓�[0m Integrations enterprise gitops test add manual labels (1.84s)
2724:  �[32m✓�[0m Integrations enterprise gitops test configuration profile escaping (1.54s)
2725:  �[32m✓�[0m Integrations enterprise gitops test delete CA with certificate templates (6.46s)
2726:  �[32m✓�[0m Integrations enterprise gitops test delete mac OS setup (5.86s)
2727:  �[32m✓�[0m Integrations enterprise gitops test deleting no team YAML (3.12s)
2728:  �[32m✓�[0m Integrations enterprise gitops test disallow software setup experience (124.46s)
2729:  �[32m✓�[0m Integrations enterprise gitops test disallow software setup experience all VPP with setup experience (1.43s)
2730:  �[32m✓�[0m Integrations enterprise gitops test disallow software setup experience no team VPP (1.25s)
2731:  �[32m✓�[0m Integrations enterprise gitops test disallow software setup experience no team installers (60.74s)
2732:  �[32m✓�[0m Integrations enterprise gitops test disallow software setup experience packages fail (60.88s)
2733:  �[32m✓�[0m Integrations enterprise gitops test env substitution in profiles (1.51s)
...

2755:  �[32m✓�[0m Integrations enterprise gitops test omitted top level keys global (2.68s)
2756:  �[32m✓�[0m Integrations enterprise gitops test remove custom settings from default YAML (2.86s)
2757:  �[32m✓�[0m Integrations enterprise gitops test special case teams VPP apps (4.25s)
2758:  �[32m✓�[0m Integrations enterprise gitops test special case teams VPP apps all teams (2.66s)
2759:  �[32m✓�[0m Integrations enterprise gitops test special case teams VPP apps no team (1.44s)
2760:  �[32m✓�[0m Integrations enterprise gitops test unset configuration profile labels (5.45s)
2761:  �[32m✓�[0m Integrations enterprise gitops test unset software installer labels (9.23s)
2762:  �[32m✓�[0m Integrations enterprise starter library (4.77s)
2763:  �[32m✓�[0m Integrations enterprise starter library test apply starter library premium (3.67s)
2764:  �[32m✓�[0m Integrations gitops (2.10s)
2765:  �[32m✓�[0m Integrations gitops test fleet gitops (0.52s)
2766:  �[32m✓�[0m Integrations gitops test fleet gitops DDM fleet vars requires premium (0.14s)
2767:  �[32m✓�[0m Integrations gitops test fleet gitops with fleet secrets (0.35s)
2768:  �[32m✓�[0m Integrations starter library (1.29s)
2769:  �[32m✓�[0m Integrations starter library test apply starter library free (0.24s)
2770:  === �[31mFailed�[0m
2771:  === �[31mFAIL�[0m: cmd/fleetctl/integrationtest/vuln TestIntegrationsVulnerabilityDataStream (308.12s)
2772:  nettest.go:33: network test start: TestIntegrationsVulnerabilityDataStream
2773:  Download failed on https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2": dial tcp 185.125.190.29:443: i/o timeout. Retrying in 404.663736ms
2774:  Download failed on https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2": dial tcp 185.125.190.29:443: connect: connection refused. Retrying in 985.823773ms
2775:  Download failed on https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2": dial tcp 185.125.190.21:443: i/o timeout. Retrying in 1.157129601s
2776:  Download failed on https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2": read tcp 10.1.0.131:54958->185.125.190.21:443: read: connection reset by peer. Retrying in 851.819633ms
2777:  Download failed on https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2": net/http: TLS handshake timeout. Retrying in 3.15406559s
2778:  Download failed on https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2": dial tcp 185.125.190.29:443: i/o timeout. Retrying in 3.471957349s
2779:  Download failed on https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2": dial tcp 185.125.190.29:443: i/o timeout. Retrying in 3.142798832s
2780:  Download failed on https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2": net/http: TLS handshake timeout. Retrying in 9.418384412s
2781:  Download failed on https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2": dial tcp 185.125.190.20:443: i/o timeout. Retrying in 12.531899597s
2782:  vulnerability_data_stream_test.go:44: 
2783:  Error Trace:	/home/runner/work/fleet/fleet/cmd/fleetctl/integrationtest/vuln/vulnerability_data_stream_test.go:44
2784:  Error:      	Received unexpected error:
2785:  Error downloading Oval definitions: downloadDefinitions: download and extract url https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2: download and write file: do request: Get "https://security-metadata.canonical.com/oval/com.ubuntu.xenial.usn.oval.xml.bz2": dial tcp 185.125.190.20:443: i/o timeout
2786:  Test:       	TestIntegrationsVulnerabilityDataStream
2787:  nettest.go:36: network test done: TestIntegrationsVulnerabilityDataStream
2788:  DONE 807 tests, 1 failure in 623.419s
2789:  make[1]: *** [Makefile:278: .run-go-tests] Error 1
2790:  make[1]: Leaving directory '/home/runner/work/fleet/fleet'
2791:  make: *** [Makefile:393: test-go] Error 2
2792:  ##[error]Process completed with exit code 2.
2793:  ##[group]Run actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
2794:  with:
2795:  name: fleetctl-mysql8.0.44-coverage
2796:  path: ./coverage.txt
2797:  if-no-files-found: error
2798:  compression-level: 6
...

2810:  With the provided path, there will be 1 file uploaded
2811:  Artifact name is valid!
2812:  Root directory input is valid!
2813:  Beginning upload of artifact content to blob storage
2814:  Uploaded bytes 2834656
2815:  Finished uploading artifact content to blob storage!
2816:  SHA256 hash of uploaded artifact zip is 67785a70eaccb3651ca84685c97bf532d52241ebe5adcabbae01910023a7e472
2817:  Finalizing artifact upload
2818:  Artifact fleetctl-mysql8.0.44-coverage.zip successfully finalized. Artifact ID 6738859814
2819:  Artifact fleetctl-mysql8.0.44-coverage has been successfully uploaded! Final size is 2834656 bytes. Artifact ID is 6738859814
2820:  Artifact download URL: https://github.com/fleetdm/fleet/actions/runs/25185365369/artifacts/6738859814
2821:  ##[group]Run c1grep() { grep "$@" || test $? = 1; }
2822:  �[36;1mc1grep() { grep "$@" || test $? = 1; }�[0m
2823:  �[36;1mc1grep -oP 'FAIL: .*$' /tmp/gotest.log > /tmp/summary.txt�[0m
2824:  �[36;1mc1grep 'test timed out after' /tmp/gotest.log >> /tmp/summary.txt�[0m
2825:  �[36;1mc1grep 'fatal error:' /tmp/gotest.log >> /tmp/summary.txt�[0m
2826:  �[36;1mc1grep -A 10 'panic: runtime error: ' /tmp/gotest.log >> /tmp/summary.txt�[0m
2827:  �[36;1mc1grep ' FAIL\t' /tmp/gotest.log >> /tmp/summary.txt�[0m
2828:  �[36;1mGO_FAIL_SUMMARY=$(head -n 5 /tmp/summary.txt | sed ':a;N;$!ba;s/\n/\\n/g')�[0m
2829:  �[36;1mecho "GO_FAIL_SUMMARY=$GO_FAIL_SUMMARY"�[0m
2830:  �[36;1mif [[ -z "$GO_FAIL_SUMMARY" ]]; then�[0m
2831:  �[36;1m  GO_FAIL_SUMMARY="unknown, please check the build URL"�[0m
2832:  �[36;1mfi�[0m
2833:  �[36;1mGO_FAIL_SUMMARY=$GO_FAIL_SUMMARY envsubst < .github/workflows/config/slack_payload_template.json > ./payload.json�[0m
2834:  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2835:  env:
2836:  RACE_ENABLED: false
2837:  GO_TEST_TIMEOUT: 20m
2838:  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
2839:  RUN_TESTS_ARG: 
2840:  CI_TEST_PKG: fleetctl
2841:  NEED_DOCKER: 1
2842:  ARTIFACT_PREFIX: fleetctl-mysql8.0.44
2843:  GOTOOLCHAIN: local
2844:  ##[endgroup]
2845:  GO_FAIL_SUMMARY=
2846:  ##[group]Run actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
2847:  with:
2848:  name: fleetctl-mysql8.0.44-test-log
2849:  path: /tmp/gotest.log
2850:  if-no-files-found: error
2851:  compression-level: 6

Copy link
Copy Markdown
Member

@nulmete nulmete left a comment

Choose a reason for hiding this comment

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

Haven't tested locally but code LGTM.
I think the only comment that we might need to address is the one related to "treating no rows as an error, or return an empty slice". The other are stylistic/architectural.

const fleetText = activity.details?.fleet_name ? (
<>
{" "}
on the <b>{activity.details.fleet_name}</b> fleet
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Figma doesn't show the Fleet that the label was deleted from, but I think it's worth showing so I'd keep this 👍

Comment on lines +749 to +752
if err := sqlx.SelectContext(ctx, ds.reader(ctx), &hostIDs,
`SELECT host_id FROM label_membership WHERE label_id = ?`, labelID); err != nil {
return nil, ctxerr.Wrap(ctx, err, "selecting label membership host IDs")
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should we treat no rows as an error, or return an empty slice instead?

Comment thread server/service/hosts.go
Comment on lines +3632 to +3634
if len(labelNames) == 0 {
return nil
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see that both callers already check len(labelIDs) not being 0 before calling this function, so maybe we can remove this defensive check?

Comment thread server/service/hosts.go
Comment on lines +3650 to +3651
if l.TeamID != nil {
teamName, err = svc.lookupTeamNameForLabel(ctx, l.TeamID)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: maybe we could have a single query that combines what LabelsByName does and what this one does, so that we have a single query with a JOIN instead of having two queries (and this one being in a loop).

That way, we get "everything we need" before iterating labels and then emitting the activities.

I think the main challenge would be to add the "TeamName" to the fleet.Label struct, since I think we don't distinguish between DB types and fleet/service types, right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok I looked at the edited label activity created in labels.go (L218-232), I see that labelDB is called and we already have a LabelWithTeamName struct... so perhaps we could reuse some of that?

Comment thread server/service/labels.go
Comment on lines +114 to +115
ID: label.ID,
Name: label.Name,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If I remember correctly, all labels are treated as global as of now, correct?
(So, in the UI we'll never show which fleet this label was created for)

If so, should we put a comment or create a sub-task to pass in the FleetID and FleetName here for future reference?

Comment thread server/service/labels.go
Comment on lines +805 to +807
// labelMatchesScope reports whether the given label belongs to the team scope
// identified by teamID (nil means global scope).
func labelMatchesScope(l *fleet.Label, teamID *uint) bool {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: what about renaming to labelMatchesTeamScope and dropping the comment? I think the function is small enough that we can infer it does that.

same comment for:

  • the labelSpecMatchesLabel function below (though the function name and arguments are clear to me)
  • the lookupTeamNameForLabel function at the bottom.

Comment thread server/service/labels.go

// lookupTeamNameForLabel returns the team name for the given team ID, or nil
// if the team ID is nil (global label).
func (svc *Service) lookupTeamNameForLabel(ctx context.Context, teamID *uint) (*string, error) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤔 I thought we were passing a label as an argument (since I read "ForLabel" in the function name)

could this function name be simplified to just "lookupTeamName" or "getTeamName"? (we can infer it's for the given teamID that we pass, so no need to include the "For..." suffix IMHO)

Comment thread server/service/labels.go
Comment on lines +570 to +582
if err := svc.ds.DeleteLabel(ctx, label.Name, filter); err != nil {
return err
}

if err := svc.NewActivity(ctx, vc.User, fleet.ActivityTypeDeletedLabel{
ID: label.ID,
Name: label.Name,
FleetID: label.TeamID,
FleetName: label.TeamName,
}); err != nil {
return ctxerr.Wrap(ctx, err, "create activity for label deletion")
}
return nil
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if the label was deleted but the activity creation failed we'd report an error back to the UI, correct? Not likely to happen, but who knows

anyways, I think this is an existing pattern to create activities right after the main operation of the endpoints (I've seen this in other endpoints as well)

IMHO, creating an activity after something is done is a side effect that should be done asynchronously and shouldn't affect the return status/body of the endpoint

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

going to deep here 😅 but in a past project, we had an "operations" layer that was in between the API layer (handler.go) and service layer (this method)... so:

  • if we needed to perform ANY async operation, then we would call the operations layer (API -> operations -> service)
  • if everything was synchronous, then we'd directly call the service layer (API -> service)

usually operations would involve some enqueuing an async job, so in this case I think we'd enqueue a job to create such activity after the service call to DeleteLabel.

happy to follow-up on this if this is something that would add value in the long run :)

Comment thread server/service/hosts.go
Comment on lines +3612 to 3613
labelNames = server.RemoveDuplicatesFromSlice(labelNames)
labelIDs, err := svc.validateLabelNames(ctx, "remove", labelNames, tmID)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: we call validateLabelNames in two different places, so we have to call RemoveDuplicatesFromSlice in both places. Should we consider deduping inside validateLabelNames?

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.

New activities for creating/editing/deleting labels

3 participants