Skip to content

Document the "Export agents to CSV" bulk action in Fleet - #8742

Merged
vishaangelova merged 6 commits into
mainfrom
7702-document-export-agents
Oct 9, 2026
Merged

vishaangelova merged 6 commits into
mainfrom
7702-document-export-agents

Conversation

@vishaangelova

@vishaangelova vishaangelova commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Summary

This PR documents the "Export agents to CSV" bulk action in Fleet.

Closes #7702

Validation against Kibana source

Labels and workflow were checked at Kibana v9.2.0 for the 9.0–9.2 window and at main for 9.3+ behavior.

9.0–9.2 workflow (verified at v9.2.0)
  • The export action was added as a top-level Actions menu item on the Agents list in elastic/kibana#196635 (9.0).
  • The column-picker modal landed in elastic/kibana#203103 (9.0), and the Download CSV button stays disabled until a column is selected after elastic/kibana#225368 (9.1+).
  • At v9.2.0, the menu label (Export {n} agent(s) as CSV), modal title (Download table results as a CSV file), six default columns (Agent ID, Status, Host Name, Policy ID, Last Checkin Time, Agent Version), submit button (Download CSV), toast title (Queued report for CSV), and Reporting job title (Agent List) all match the doc.
  • Agent rows on hosted policies have their checkboxes disabled with the tooltip "This action is not available for agents enrolled in an externally managed agent policy" (isAgentSelectable).
  • The Select everything on all pages header link, the Done status in Reporting, and the download icon in the Reporting Actions column also match.
9.3+ menu path (verified at main)
  • The Fleet bulk-actions menu was redesigned in elastic/kibana#245174 (9.3.0). From 9.3, the export action lives under Actions → Maintenance and diagnostics. The menu label itself is unchanged.
9.4+ Generate reports privilege (verified at main)
  • Introduced in elastic/kibana#247185 (9.4.0+). The new fleetv2.generate_report Fleet sub-feature privilege gates the menu item: disabled: !authz.fleet.generateAgentReports || !reporting, where generateAgentReports requires fleet.generateReports?.all && (fleet.agents?.read || fleet.agents?.all). The server endpoint /internal/fleet/agents/reporting/generate requires the same two privileges.
  • The Fleet feature registers with no scope, and the Serverless Observability authorization snapshot test (x-pack/solutions/observability/test/serverless/api_integration/test_suites/platform_security/authorization.ts) includes fleetv2.generate_report, so the privilege is available on Serverless as well.

Generative AI disclosure

  1. Did you use a generative AI (GenAI) tool to assist in creating this contribution?
  • Yes
  • No
  1. If you answered "Yes" to the previous question, please specify the tool(s) and model(s) used (e.g., Google Gemini, OpenAI ChatGPT-4, etc.).

Tool(s) and model(s) used: Cursor (Claude Opus)

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Elastic Docs AI PR menu

Check the box to run an AI review for this pull request.

Powered by GitHub Agentic Workflows and docs-actions. For more information, reach out to the docs team.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🔍 Preview links for changed docs

⏳ Building and deploying preview... View progress

This comment will be updated with preview links when the build is complete.

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

✅ Elastic Docs Style Checker (Vale)

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale.

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

Docs review summary

Action required

  • Product behavior is unverified against Kibana source. The labels and behaviors below could not be checked, because GitHub code search was rate-limited during this run. An SME or the author needs to confirm them at HEAD and for each tagged range:
    • the Export x agents as CSV action name and its Maintenance and diagnostics location from 9.3
    • the Generate reports privilege from 9.4
    • the header checkbox selecting every agent that matches the filters
    • the default columns
    • the Queued report for CSV and Agent List report names

Issue satisfaction

Satisfied — the PR adds a how-to for exporting agents to CSV, links it from the Agents actions table and the Fleet privileges table, and adds it to toc.yml. Linked issue: #7702 (reviewed through the PR description only).

Review coverage
  • Content type: how-to (declared as type: how-to), with a title, outcome-focused intro, requirements section, numbered steps, and related pages. The fit is good.
  • Checked: user focus, technical accuracy, applicability, maintainability, language, and style.
  • Not checked: Technical accuracy of UI labels and behavior against the Kibana code repo (search rate-limited, see above). The published-docs search surfaced no on-topic page for this feature, so no cross-page contradiction was assessed for it.

Generated from Docs review agent

Comment thread reference/fleet/export-agents-csv.md Resolved
@vishaangelova
vishaangelova force-pushed the 7702-document-export-agents branch from 90120e3 to 7ffc244 Compare October 8, 2026 12:23
@vishaangelova
vishaangelova marked this pull request as ready for review October 8, 2026 12:44
@vishaangelova
vishaangelova requested a review from a team as a code owner October 8, 2026 12:44

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

Docs review summary

Action required

  • The 9.0-9.3 prerequisite "read access to the .fleet-agents index" (export-agents-csv.md, Before you begin) is not covered by the validation notes in the PR description, and a search of the published docs found no page that states it. An SME needs to confirm that requirement before merge.

Issue satisfaction

Satisfied. The new how-to covers the export action, the active filters and sort order, Reporting, and the required privileges, and manage-agents.md links to it.

Review coverage
  • Content type: how-to (declared type: how-to), with a short reference-table addition in fleet-roles-privileges.md and a link row in manage-agents.md. The how-to has the expected structure: outcome-focused intro, requirements, numbered steps, and a completion checkpoint.
  • Checked: user focus, technical accuracy, applicability, maintainability, language, and style.

Generated from Docs review agent

Comment thread reference/fleet/export-agents-csv.md Resolved
@vishaangelova

Copy link
Copy Markdown
Member Author

Hi @MichelLosier, I've added you as a reviewer for this PR as you worked on elastic/kibana#247185 which updated the necessary privileges for this action. Could you have a look?

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

LGTM! Just have one recommendation to consider

Comment thread reference/fleet/export-agents-csv.md Resolved
@vishaangelova
vishaangelova force-pushed the 7702-document-export-agents branch from 83342ec to 51bff3f Compare October 9, 2026 09:00
@vishaangelova
vishaangelova force-pushed the 7702-document-export-agents branch from 51bff3f to 1f37bf4 Compare October 9, 2026 09:06

@florent-leborgne florent-leborgne left a comment

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.

LGTM

Comment thread reference/fleet/export-agents-csv.md Resolved
@vishaangelova
vishaangelova added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit e9f91eb Oct 9, 2026
12 checks passed
@vishaangelova
vishaangelova deleted the 7702-document-export-agents branch October 9, 2026 15:27
mdbirnstiehl pushed a commit to mdbirnstiehl/docs-content that referenced this pull request Oct 14, 2026
…lastic#8827)

## Summary

The AI PR menu keeps a finished docs review's status after a push, and
it says `Status: completed, no findings.` when the review posted only
its summary comment.

## Why

The menus on elastic#8742, elastic#8757, and elastic#8208 all said `Status: queued.` although
the reviews posted. The edit history of each menu comment shows the same
sequence. The post-review job writes `Status: completed.`. Between 6 and
30 minutes later, a push triggers the `Post or refresh AI PR menu` job
through `Docs PR AI menu (collect)`. That job refreshes the menu with no
status override and finds no `Docs AI` check run on the PR head commit,
and `getStatusText` has no fallback to the status already in the
comment, so it writes `Status: queued.`. The issue menu script has that
fallback.

| PR | completed | reset to queued |
|---|---|---|
| elastic#8742 | Oct 8 12:16:02 and 12:46:06 UTC | 12:22:18 and 12:56:12 |
| elastic#8757 | Oct 9 08:56:00 | 09:22:05 |
| elastic#8208 | Sep 22 14:41:54 and 15:30:24 | 14:50:54 and 15:57:31 |

The two reviews that looked like they never ran, elastic#8186 and elastic#8385, did
run. A review with no findings posts its "Docs review summary" as a
regular PR comment, not as a PR review. The menu stayed on "queued", so
nothing showed that the review had finished.

## What

#### A finished status survives a refresh
`getStatusText` in `.github/scripts/docs_pr_ai_menu.cjs` keeps the
status already in the comment when the box is ticked and the status is
neither "not started" nor "queued". An unticked menu still reads "not
started", and an explicit override still wins.

#### The menu shows the outcome of a finished review
`getDocsReviewOutcome` looks at what `github-actions[bot]` posted since
the box was ticked, using the menu comment's `updated_at` from the event
payload as the start time. A PR review means findings, so the text stays
`Status: completed.`. A "## Docs review summary" issue comment and no
review means no findings, so the text becomes `Status: completed, no
findings.`. `upsertMenuComment` runs this only for a successful
completed override, so a failed or cancelled job makes no API calls. If
the lookup throws, the menu falls back to `Status: completed.` with a
warning. No change to `docs-pr-ai-menu.yml` is needed.

**Out of scope:** A run that leaves nothing visible, for example a
`noop` when no markdown file is eligible, still shows `Status:
completed.`. I cannot tell it apart from a silent failure. elastic#8385 run 1
is such a run. The status also stays "completed" after a later push,
even if the new commit has not been reviewed. The check-run lookup on
the PR head commit is unchanged.

## Verify
**Tested** with local Node checks, which are not committed. I ran the
script from `main` and from this branch through `upsertMenuComment` with
a mocked GitHub client and a real menu body from elastic#8742.

```text
# no findings: bot posted only the summary comment
  main   Status: completed.
  now    Status: completed, no findings.
# findings: bot submitted a PR review
  now    Status: completed.
# old summary comment from an earlier run only (before the tick)
  now    Status: completed.
# nothing posted (noop or silent run)
  now    Status: completed.
# failed / cancelled review job
  now    Status: needs attention. / Status: cancelled.   (no API calls)
# classification API error
  now    Status: completed.   (warning logged)
# later refresh (push, no override) on a "completed, no findings" menu
  main   Status: queued.
  now    Status: completed, no findings.
```

The six cases from the previous commit give the same text before and
after this commit. I also ran the real `getDocsReviewOutcome` against
live PRs, with the start time set to the tick time from each menu's edit
history and the data cut off when the run completed:

| Run | Result | Menu text |
|---|---|---|
| elastic#8186, Sep 3 (summary comment only) | no findings | completed, no
findings |
| elastic#8385 run 1, Sep 18 18:11 (nothing visible) | none | completed |
| elastic#8385 run 2, Sep 18 18:38 (summary comment only) | no findings |
completed, no findings |
| elastic#8742 runs 1 and 2, Oct 8 (PR review) | findings | completed |
| elastic#8757, Oct 9 (PR review) | findings | completed |

I read these PRs before I wrote down what each run should return, so
this shows that the logic reproduces what I saw. It is not an
independent test.

**Not tested:** the workflows themselves, the `github.paginate` calls in
a real `github-script` step, and whether
`context.payload.comment.updated_at` equals the tick time in a live
`issue_comment` event. The comparison reads that field and not the
review's start time.

Related to elastic/docs-eng-team#1035

## Generative AI disclosure
1. Did you use a generative AI (GenAI) tool to assist in creating this
contribution?
- [x] Yes

Tool(s) and model(s) used: Claude Code (Claude Sonnet 5.5)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
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.

Document the "Export agents to CSV" bulk action in Fleet

3 participants