elastic / elastic/integrations

[bug-hunter] PR Actions Detective listens for non-existent docs-cleanup workflow

Open
#18,233 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Handlebars
Stars
333
Forks
647
Avg merge
2d 17h
Merged PRs (30d)
225

Description

## Impact
Failures in the docs preview cleanup workflow are not analyzed by PR Actions Detective, so maintainers miss automated failure triage/comments for those PRs.

## Reproduction Steps
1. Create and run this minimal script:

```python
from pathlib import Path
import re
import sys

repo = Path('/home/runner/work/integrations/integrations')
trigger = repo / '.github/workflows/trigger-pr-actions-detective.yml'
workflows_dir = repo / '.github/workflows'

all_names = {}
for wf in workflows_dir.glob('*.yml'):
for line in wf.read_text(encoding='utf-8', errors='replace').splitlines()[:30]:
m = re.match(r'^name:\s*(.+?)\s*$', line)
if m:
all_names[m.group(1)] = wf.name
break

lines = trigger.read_text(encoding='utf-8', errors='replace').splitlines()
inside_workflows = False
watched = []
for line in lines:
if re.match(r'^\s*workflows:\s*', line):
inside_workflows = True
continue
if inside_workflows and re.match(r'^\s*types:\s*', line):
break
if inside_workflows:
watched.extend(re.findall(r'"([^"]+)"', line))

missing = [name for name in watched if name not in all_names]
print('Watched workflows:', watched)
print('Missing workflow names:', missing)
if missing:
print('FAIL: trigger-pr-actions-detective.yml references non-existent workflow names.')
sys.exit(1)
print('PASS')
```

2. Execute it from the repo root with `python /tmp/gh-aw/agent/repro_pr_actions_detective_workflow_name.py`.

## Expected vs Actual
**Expected:** Every workflow name listed in `on.workflow_run.workflows` exists in `.github/workflows/*` `name:` fields, so failures from that workflow can trigger PR Actions Detective.

**Actual:** `docs-cleanup` is listed as a trigger, but no workflow with `name: docs-cleanup` exists; the actual workflow is `name: docs-preview-cleanup`.

Script output:

```text
Watched workflows: ['Validate Dashboard Compilation', 'Vale Lint', 'Documentation edit helper', 'catalog-info', 'docs-cleanup', 'docs-build']
Missing workflow names: ['docs-cleanup']
FAIL: trigger-pr-actions-detective.yml references non-existent workflow names.
```

## Failing Test
See the reproduction script above. It fails deterministically with exit code `1` because `docs-cleanup` is not a defined workflow name.

## Evidence
- `.github/workflows/trigger-pr-actions-detective.yml:10` includes `"docs-cleanup"` in `workflow_run.workflows`.
- `.github/workflows/docs-preview-cleanup.yml:1` defines the workflow as `name: docs-preview-cleanup`.
- Because `workflow_run.workflows` must match workflow `name` exactly, docs preview cleanup failures cannot trigger this detective workflow.

> [!NOTE]
>
> 🔒 Integrity filtering filtered 5 items
>
> Integrity filtering activated and filtered the following items during workflow execution.
> This happens when a tool call accesses a resource that does not meet the required integrity or secrecy level of the workflow.
>
> - issue:#unknown (`search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
> - [#16666](https://github.com/elastic/integrations/issues/16666) (`search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
> - [#18134](https://github.com/elastic/integrations/issues/18134) (`search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
> - [#15472](https://github.com/elastic/integrations/issues/15472) (`search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
> - [#17562](https://github.com/elastic/integrations/issues/17562) (`search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
>
>

---
[What is this?](https://ela.st/github-ai-tools) | [From workflow: Bug Hunter](https://github.com/elastic/integrations/actions/runs/24029838730)

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
> - [x] expires on Apr 13, 2026, 11:32 AM UTC

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.