elastic / elastic/ai-github-actions

[product-manager-impersonator] Preview matching workflow runs before log download

Open
#1,244 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
11
Forks
16
Avg merge
22h 9m
Merged PRs (30d)
31

Description

## Feature Idea

**Summary:** Add a `--list-only` mode to `scripts/fetch-workflow-logs.py` that previews matching workflow runs (and writes metadata-only manifest output) without downloading log archives.

## Why a Customer Would Want This
When maintainers are debugging noisy CI periods, they often need to confirm **which runs** match `--since/--until/--conclusion` before pulling ZIP logs. Today the script always downloads logs once matches are found, which makes quick investigation loops slower and more expensive.

## Rough Implementation Sketch
- Add `--list-only` (and optional `--format table|json`) CLI flags in `scripts/fetch-workflow-logs.py`.
- Reuse existing `_fetch_runs(...)` output to print a compact run summary (`run_id`, `created_at`, `conclusion`, `html_url`) and skip `_download_runs(...)` when list-only is enabled.
- Keep manifest output behavior, but in list-only mode write run metadata with empty `log_files` arrays.
- Extend `tests/test_fetch_workflow_logs.py` with coverage for list-only path (no download call, correct manifest/screen output).

## Why It Won't Be That Hard
This is a focused change in one script plus one test module. The script already has clear phase boundaries (`_fetch_runs`, `_download_runs`, `_write_manifest`) and existing tests around filtering behavior, so list-only is mostly a control-flow addition rather than new infrastructure.

## Evidence
- `scripts/fetch-workflow-logs.py` currently always downloads when runs exist (`main()` calls `_download_runs` unconditionally after `_fetch_runs`, lines 200-213).
- The download phase is already isolated in `_download_runs(...)` (`scripts/fetch-workflow-logs.py`, lines 171-190), making it straightforward to bypass for preview mode.
- Existing test coverage for run filtering and fetch behavior is in `tests/test_fetch_workflow_logs.py` (lines 17-97), providing a natural place to add list-only assertions.
- Recent related activity shows active operator pain in this script’s filtering path: issue #1236 and PR #1237.

> [!NOTE]
>
> 🔒 Integrity filter blocked 15 items
>
> The following items were blocked because they don't meet the GitHub integrity level.
>
> - [#1175](https://github.com/elastic/ai-github-actions/pull/1175) `search_pull_requests`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#1128](https://github.com/elastic/ai-github-actions/pull/1128) `search_pull_requests`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#359](https://github.com/elastic/ai-github-actions/issues/359) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#1175](https://github.com/elastic/ai-github-actions/pull/1175) `list_pull_requests`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#121](https://github.com/elastic/ai-github-actions/issues/121) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#437](https://github.com/elastic/ai-github-actions/issues/437) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#575](https://github.com/elastic/ai-github-actions/issues/575) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - elastic/ai-github-actions#1067 `list_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - elastic/ai-github-actions#1025 `list_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#318](https://github.com/elastic/ai-github-actions/issues/318) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#295](https://github.com/elastic/ai-github-actions/issues/295) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#235](https://github.com/elastic/ai-github-actions/issues/235) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#353](https://github.com/elastic/ai-github-actions/issues/353) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#547](https://github.com/elastic/ai-github-actions/issues/547) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#53](https://github.com/elastic/ai-github-actions/issues/53) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
>
> To allow these resources, lower `min-integrity` in your GitHub frontmatter:
>
> ```yaml
> tools:
> github:
> min-integrity: approved # merged | approved | unapproved | none
> ```
>
>

---
[What is this?](https://ela.st/github-ai-tools) | [From workflow: Trigger Product Manager Impersonator](https://github.com/elastic/ai-github-actions/actions/runs/27201682103)

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.