Skip to content

Enable "Show example payload" buttons in GitOps mode - #46355

Merged
spalmesano0 merged 1 commit into
mainfrom
example-payloads-with-gitops
May 29, 2026
Merged

Enable "Show example payload" buttons in GitOps mode#46355
spalmesano0 merged 1 commit into
mainfrom
example-payloads-with-gitops

Conversation

@spalmesano0

@spalmesano0 spalmesano0 commented May 28, 2026

Copy link
Copy Markdown
Member

We allow this already with "Preview payload" under Settings > Integrations > MDM > End user migration workflow.

Related issue: Resolves #44719

Checklist for submitter

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

Testing

  • QA'd all new/changed functionality manually
    • I was able to test the "Other workflows" modal, but not the "Calendar events" modal.

Summary by CodeRabbit

Bug Fixes

  • Fixed the "Show example payload" button being incorrectly disabled in GitOps mode for policy automation configurations across calendar events and other workflows.

Review Change Stack

We allow this already with "Preview payload" under Settings > Integrations
> MDM > End user migration workflow.
@spalmesano0 spalmesano0 self-assigned this May 28, 2026
Copilot AI review requested due to automatic review settings May 28, 2026 16:29
@spalmesano0
spalmesano0 requested a review from a team as a code owner May 28, 2026 16:29

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

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

Enables viewing “Show example payload” in policy automation modals even when GitOps mode is enabled, aligning behavior with other areas that allow payload preview without permitting configuration edits.

Changes:

  • Removed the gitOpsModeEnabled gating from “Show example payload” toggles in the “Other workflows” and “Calendar events” modals.
  • Added a changelog entry documenting the GitOps-mode UX fix.

Reviewed changes

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

File Description
frontend/pages/policies/ManagePoliciesPage/components/OtherWorkflowsModal/OtherWorkflowsModal.tsx Allows expanding the example payload in GitOps mode while keeping actual config inputs disabled.
frontend/pages/policies/ManagePoliciesPage/components/CalendarEventsModal/CalendarEventsModal.tsx Allows expanding the example payload in GitOps mode while keeping configuration controls gated appropriately.
changes/fix-show-example-payload-gitops-mode Adds user-facing changelog note for the GitOps-mode enablement.

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

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Actionable comments posted: 0

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

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: bb10bd26-cb92-4404-8a8f-8fbed8cab701

📥 Commits

Reviewing files that changed from the base of the PR and between 2b8c341 and 8616995.

📒 Files selected for processing (3)
  • changes/fix-show-example-payload-gitops-mode
  • frontend/pages/policies/ManagePoliciesPage/components/CalendarEventsModal/CalendarEventsModal.tsx
  • frontend/pages/policies/ManagePoliciesPage/components/OtherWorkflowsModal/OtherWorkflowsModal.tsx

Walkthrough

This PR fixes a bug where the "Show example payload" button was incorrectly disabled in GitOps mode for the "Calendar events" and "Other workflows" policy automation modals. The fix removes the gitOpsModeEnabled condition from the button's disabled state in both modals, so the button is now disabled only when its respective feature is not enabled or configured. A changelog entry documents this correction.

Possibly related PRs

  • fleetdm/fleet#46023: Introduced the gitOpsModeEnabled disable condition in these modals during policy automations modal work; this PR corrects that condition.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: enabling 'Show example payload' buttons in GitOps mode, which is the primary focus of the changeset.
Description check ✅ Passed The description includes the required linked issue reference (#44719) and confirms a changes file was added and manual QA was performed, covering the key checklist items.
Linked Issues check ✅ Passed The changes directly address issue #44719 by removing the GitOps mode restriction from the 'Show example payload' buttons in both the OtherWorkflowsModal and CalendarEventsModal components.
Out of Scope Changes check ✅ Passed All changes are focused on the single objective of enabling 'Show example payload' buttons in GitOps mode; no out-of-scope modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 example-payloads-with-gitops

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.

@codecov

codecov Bot commented May 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.89%. Comparing base (bac2a70) to head (8616995).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #46355   +/-   ##
=======================================
  Coverage   66.89%   66.89%           
=======================================
  Files        2782     2783    +1     
  Lines      221734   221734           
  Branches    11221    11219    -2     
=======================================
  Hits       148334   148334           
  Misses      60000    60000           
  Partials    13400    13400           
Flag Coverage Δ
frontend 56.28% <ø> (ø)

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.

@spalmesano0

Copy link
Copy Markdown
Member Author

Before:

Screenshot 2026-05-28 at 11-03-32 Policies Fleet

After:

Screenshot 2026-05-28 at 11-14-54 Policies Fleet Screenshot 2026-05-28 at 11-15-39 Policies Fleet

@spalmesano0
spalmesano0 merged commit 121a6df into main May 29, 2026
25 checks passed
@spalmesano0
spalmesano0 deleted the example-payloads-with-gitops branch May 29, 2026 10:27
@spalmesano0

Copy link
Copy Markdown
Member Author

@MagnusHJensen I merged this, then noticed #44719 has an "Awaiting QA" status. Should I not merge these until that's done, or is it safe to do so when GitHub allows me to?

@MagnusHJensen

Copy link
Copy Markdown
Member

@spalmesano0 All good, I moved it to the board and put it to that status after approving with the assumption it would merge in reasonable time (which you did) so no worries. I could see it wasn't tagged with a group, so wanted to help you out.

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.

'Show example payload' in failing policy webhook modal greyed out in GitOps mode

3 participants