Skip to content

Rename skipped install activity flag - #51102

Merged
cdcme merged 1 commit into
mainfrom
fix-51052-rename-pwc-flags
Aug 14, 2026
Merged

Rename skipped install activity flag#51102
cdcme merged 1 commit into
mainfrom
fix-51052-rename-pwc-flags

Conversation

@cdcme

@cdcme cdcme commented Aug 12, 2026

Copy link
Copy Markdown
Member

Related issue: Resolves #51052

Renames the installed_software activity detail flag from install_skipped_when_app_open to skipped_install, the name Product approved and the one docs-v4.91.0 already publishes (audit-logs.md:1661). The implementation (#49858) landed six days before the activity docs (#49106), so the two diverged; since patch-when-closed is unreleased, this renames outright rather than aliasing.

The name is deliberately reason-agnostic: #39178 will set the same flag for a second skip reason (notify-then-defer), where install_skipped_when_app_open would be false.

Rename only — no behavior change. Covers the JSON tag, the Go field (InstallSkippedWhenAppOpenSkippedInstall), and the frontend, where all four readers were swept: activity feed, host activity card, policy automations table, and the install-details modal (including its installSkippedWhenAppOpen prop). No endpoint paths changed.

Deliberately unchanged: isAppOpenSkip in orbit.go still names the detection of the app-open case specifically, and the pre-existing frontend-only "skipped_install" display status (interfaces/software.ts) is not an API value — after this rename the two simply agree.

No changes file: ~unreleased bug, and changes/39962-patch-when-closed already covers the feature. No migration: activity details are an opaque activity_past.details JSON blob and no SQL reads this key. A renameto: alias was considered and rejected — aliases are applied before the INSERT, so it would permanently double-write a never-released key into every row.

Important

rc-minor-fleet-v4.91.0 was cut on 2026-08-11 and still carries the old name. This needs a cherry-pick into that branch before the 4.91.0 cut, or 4.91.0 ships install_skipped_when_app_open while its own reference docs document skipped_install.

Checklist for submitter

Testing

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

For unreleased bug fixes in a release candidate, one of:

  • Confirmed that the fix is not expected to adversely impact load test results

Summary by CodeRabbit

  • Bug Fixes

    • Updated installed-software activity handling to consistently identify installations skipped because the app was open.
    • Preserved skipped-install status messages, labels, icons, and detail visibility across activity views and policy automation tables.
  • Refactor

    • Standardized the activity field name used for skipped installations across the application.

@cdcme
cdcme marked this pull request as ready for review August 12, 2026 21:51
@cdcme
cdcme requested review from a team as code owners August 12, 2026 21:51
Copilot AI lite review requested due to automatic review settings August 12, 2026 21:51
@cdcme
cdcme marked this pull request as draft August 12, 2026 21:52
@cdcme
cdcme marked this pull request as ready for review August 12, 2026 21:52
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.64%. Comparing base (813fd97) to head (13241c6).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #51102      +/-   ##
==========================================
- Coverage   68.65%   68.64%   -0.01%     
==========================================
  Files        3993     3995       +2     
  Lines      257448   257616     +168     
  Branches    13806    13806              
==========================================
+ Hits       176749   176853     +104     
- Misses      64988    65030      +42     
- Partials    15711    15733      +22     
Flag Coverage Δ
backend 69.74% <100.00%> (-0.01%) ⬇️
frontend 62.84% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Renames the installed software activity detail flag for patch-when-closed “skip” events from install_skipped_when_app_open to the Product-approved skipped_install, aligning backend JSON, Go types, and all frontend consumers.

Changes:

  • Renamed the activity details field in ActivityTypeInstalledSoftware (InstallSkippedWhenAppOpenSkippedInstall) and updated emission code and backend tests.
  • Updated frontend readers (activity feed, host activity item, policy automations activities table, install details modal) and their unit tests to use skipped_install.
  • Updated frontend activity details typing to reflect the new API field.

Reviewed changes

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

Show a summary per file
File Description
server/service/orbit.go Emits SkippedInstall on the installed software activity payload.
server/service/orbit_test.go Updates assertions to validate SkippedInstall behavior.
server/fleet/activities.go Renames the Go field + JSON tag to skipped_install.
frontend/pages/policies/details/components/PolicyAutomationsActivitiesTable/PolicyAutomationsActivitiesTable.tests.tsx Updates test fixtures to use skipped_install.
frontend/pages/policies/details/components/PolicyAutomationsActivitiesTable/helpers.tsx Switches logic to read details.skipped_install.
frontend/pages/hosts/details/cards/Activity/ActivityItems/InstalledSoftwareActivityItem/InstalledSoftwareActivityItem.tsx Switches host activity rendering to use details.skipped_install.
frontend/pages/hosts/details/cards/Activity/ActivityItems/InstalledSoftwareActivityItem/InstalledSoftwareActivityItem.tests.tsx Updates test helper/fixtures for skipped_install.
frontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tsx Switches global activity feed template logic to skipped_install.
frontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tests.tsx Updates activity feed test fixtures for skipped_install.
frontend/interfaces/activity.ts Replaces install_skipped_when_app_open with skipped_install in the activity details interface.
frontend/components/ActivityDetails/InstallDetails/SoftwareInstallDetailsModal/SoftwareInstallDetailsModal.tsx Renames modal details + props to skipped_install / skippedInstall and updates conditional rendering.
frontend/components/ActivityDetails/InstallDetails/SoftwareInstallDetailsModal/SoftwareInstallDetailsModal.tests.tsx Updates modal tests to pass and assert the renamed flag.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread frontend/interfaces/activity.ts
Comment thread server/fleet/activities.go
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The skipped-install activity flag is renamed from install_skipped_when_app_open to skipped_install in server payloads and frontend activity types. The software-install modal uses skippedInstall for status rendering. Dashboard, host activity, and policy automation views use the renamed detail field. Backend and frontend tests update their fixtures and assertions.

Possibly related PRs

  • fleetdm/fleet#49871: Modifies the patch-when-closed software installation flow and related activity data.
  • fleetdm/fleet#50726: Introduced the app-open skipped-install activity fields renamed by this PR.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR completes the first rename in #51052 but does not rename patch_only_when_closed to patch_when_closed as also required. Also rename patch_only_when_closed to patch_when_closed, or split and explicitly track that requirement in a separate linked issue or PR.
✅ Passed checks (4 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed All listed changes support the install_skipped_when_app_open to skipped_install rename, with no unrelated code changes identified.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description check ✅ Passed The description clearly explains the rename, scope, testing, migration decision, release impact, and related issue.
Title check ✅ Passed The title clearly and concisely identifies the primary change: renaming the skipped-install activity flag.
✨ 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 fix-51052-rename-pwc-flags

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.

@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)
server/service/orbit_test.go (1)

1365-1365: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Add a JSON contract assertion for the renamed field.

These assertions inspect SkippedInstall on the Go struct. They do not verify that the emitted payload uses skipped_install. Add a focused assertion in server/fleet/activities_test.go or an API-level test for the new key and the absence of install_skipped_when_app_open.

Also applies to: 1390-1390

🤖 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 `@server/service/orbit_test.go` at line 1365, The tests only validate the Go
field SkippedInstall and do not verify the serialized JSON contract. Add a
focused JSON/API assertion covering the activity payload, requiring the renamed
skipped_install key and confirming install_skipped_when_app_open is absent.
🤖 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/fleet/activities.go`:
- Around line 1218-1219: Update the activity detail handling around
SkippedInstall so historical install_skipped_when_app_open JSON is interpreted
as skipped_install when listing activities. Preserve the existing raw activity
details and current skipped_install behavior for newly stored records, using
either an API read fallback, frontend fallback, or migration rather than
discarding historical information.

---

Nitpick comments:
In `@server/service/orbit_test.go`:
- Line 1365: The tests only validate the Go field SkippedInstall and do not
verify the serialized JSON contract. Add a focused JSON/API assertion covering
the activity payload, requiring the renamed skipped_install key and confirming
install_skipped_when_app_open is absent.
🪄 Autofix

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 Plus

Run ID: 75821d2b-6ea1-45bf-a022-7e6929806dec

📥 Commits

Reviewing files that changed from the base of the PR and between fd1b0f9 and 13241c6.

📒 Files selected for processing (12)
  • frontend/components/ActivityDetails/InstallDetails/SoftwareInstallDetailsModal/SoftwareInstallDetailsModal.tests.tsx
  • frontend/components/ActivityDetails/InstallDetails/SoftwareInstallDetailsModal/SoftwareInstallDetailsModal.tsx
  • frontend/interfaces/activity.ts
  • frontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tests.tsx
  • frontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tsx
  • frontend/pages/hosts/details/cards/Activity/ActivityItems/InstalledSoftwareActivityItem/InstalledSoftwareActivityItem.tests.tsx
  • frontend/pages/hosts/details/cards/Activity/ActivityItems/InstalledSoftwareActivityItem/InstalledSoftwareActivityItem.tsx
  • frontend/pages/policies/details/components/PolicyAutomationsActivitiesTable/PolicyAutomationsActivitiesTable.tests.tsx
  • frontend/pages/policies/details/components/PolicyAutomationsActivitiesTable/helpers.tsx
  • server/fleet/activities.go
  • server/service/orbit.go
  • server/service/orbit_test.go

Comment thread server/fleet/activities.go
@cdcme
cdcme merged commit 94207f1 into main Aug 14, 2026
49 checks passed
@cdcme
cdcme deleted the fix-51052-rename-pwc-flags branch August 14, 2026 18:04
cdcme added a commit that referenced this pull request Aug 14, 2026
Cherry-pick of #51102 into the 4.91 RC branch.

Renames the `installed_software` activity detail flag
`install_skipped_when_app_open` → `skipped_install` (Resolves #51052).
Needed here because this branch was cut on 2026-08-11, before the rename
landed on main, and `docs-v4.91.0` already publishes the field as
`skipped_install` — without this, 4.91.0 ships an API field whose own
reference docs name something else.
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.

Patch when app closed: Wrong name for API flags

4 participants